Calculating SEF (spectral edge frequency) of a EEG
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Francisco Dias
el 3 de Nov. de 2017
Comentada: Star Strider
el 23 de Mayo de 2022
I currently have a file with a 4 channel EEG, and I want to calculate the SEF (95%) using that raw data. I wanted to know if there is as automated way of doing so using Matlab. I also have computed data Hz x time x dB of the given raw EEG file.
ADICIONAL INFO: The SEF is a Hz by time chart where the Hz shown is the threshold frequency where 95% of the EEG power lies beneath it at a given time (I don't know which algorithm to use) though.
Thank you in advance!
2 comentarios
Christoph F.
el 3 de Nov. de 2017
So you have a vector P of numbers of the power at certain frequencies, and you want to find the vector index n at which sum(P(1:n))/sum(P) >= 0.95?
Respuesta aceptada
Star Strider
el 3 de Nov. de 2017
I would use cumtrapz to do the integration, and interp1 using the cumtrapz result and the frequency vector to find the SEF.
Example —
% First, Create Data
t = 0 : 0.01 : 1;
for f = 1 : 2 : 10
y(f,:) = sin (2 * pi .* f .* t);
end
L = length(t); % Signal Length
Ts = t(2) - t(1); % Sampling Time Interval
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:length(Fv); % Index Vector
Fourier = fft(y, [], 2)/L; % Fourier Transform (Along Rows Of Matrix)
Fouriers = sum(abs(Fourier)); % Spectrum
IntSpectrum = cumtrapz(Fv, Fouriers(Iv)); % Numeric Integration
SEF = interp1(IntSpectrum, Fv, 0.95*IntSpectrum(end), 'linear'); % Interploate To Find ‘SEF’
figure(1)
plot(Fv, Fouriers(Iv)*2)
hold on
plot([1 1]*SEF, ylim, '--r')
hold off
5 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre EEG/MEG/ECoG en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!