Calculating SEF (spectral edge frequency) of a EEG

51 views (last 30 days)
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 Comments
Christoph F.
Christoph F. on 3 Nov 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?

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 3 Nov 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 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on EEG/MEG/ECoG in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!