Need to break down EEG signals into 4 frequency bands

Hi all, I'm having a bit of a trouble breaking down an EEG signal into these bands, i dont have a wavelet toolbox, would i need it?
theta = 4 - 7.9 Hz
Lower Alpha = 7.9 - 10 Hz
Upper Alpha = 10 - 13 Hz % edited
Lower Beta = 13 - 17.9 Hz
Upper Beta = 18 - 24.9 Hz
I have attached the signal EEG recording with this, it has 22 arrays, the eeg channels are from 2 - 15 and the sampling frequency is 128.
thank you!

4 Comments

Note that I incorporated the approximate passband for:
Upper Alpha = 10 - 13 Hz % edited
in my Answer. You can use your passband or mine, since I seriously doubt there is any practical difference.
Sir can U plz send me the code to decompose the EEG signal in 4 parts, I need to submit it next few hrs, PLZ mail me the code and RAW EEG signal if possible. EMAIL: ayush.yash.abyb@gmail.com
Hello sir do you have the code to decompose the eeg signal into 4 parts.If you do have plz send methe code...
Am fresher sir, Please send all frequency band like alpha beta gamma theta delta, separate matlab coding and caculate the parameter like standard deviation,variance,entropy etc

Sign in to comment.

 Accepted Answer

You can design stable filters that do what you want relatively easily. Here is one:
Fs = 128; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
Wp = [4 7.9]/Fn; % Theta Passband
Ws = Wp .* [0.6 1.05]; % Bandstop Frequencies
Rp = 10; % Passband Ripple
Rs = 40; % Stopband Ripple
[n,Ws] = cheb2ord(Wp,Ws,Rp,Rs); % Determine Optimal Order
[b,a] = cheby2(n,Rs,Ws); % Transfer Function Coefficients
[sos_theta,g_theta] = tf2sos(b,a); % Second-Order-Section For Stability
figure(1)
freqz(sos_theta, 4096, Fs); % Filter Bode Plot
You can also put them in a loop:
Wpm = [4 7.9; 7.9 10; 10.1 12.9; 13 17.9; 18 27.9]; % Passband Matrix
Fs = 128; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
Rp = 10; % Passband Ripple
Rs = 40; % Stopband Ripple
for k1 = 1:size(Wpm,1)
Wp = Wpm(k1,:)/Fn;
Ws = Wp .* [0.6 1.05];
[n,Ws] = cheb2ord(Wp,Ws,Rp,Rs); % Determine Optimal Order
[b,a] = cheby2(n,Rs,Ws); % Transfer Function Coefficients
[sos{k1},g{k1}] = tf2sos(b,a); % Second-Order-Section For Stability
end
Please check the ‘Wpm’ entries, since ‘Upper Alpha’ and ‘Lower Alpha’ were the same in your list. I changed ‘Upper Alpha’ to what I guess they should be. The cell arrays correspond to the appropriate second-order-section filter matrices.
I looked at these filters with the freqz function, and I’m happy with them. Don’t worry about the high ‘Rp’ value, since the Cnebyshev Type II filter has a flat passband.
Use the filtfilt function to do the actual filtering. I didn’t specifically load your data and filter it. I just designed the filters. I will filter your data if you’re getting anomalous results and need further help.

7 Comments

This works out great, i repeated the theta filter you designed and was able to get a pretty decent seperation of the frequency bands, thanks! (the upper alpha was wrong in the original entry, it should be fixed now)
hello sir, i am himanshu srivastava and i am working with eeg raw data and i got problem on filering the different brain waves from raw eeg data so please help me for this . as from your suggested answer you talk about filtfilt function in matlab so i just want you to help me to use this function and to load the eeg raw data to this so, that will help me a lot .
Hello. I am trying to do the same thing with 32 channels of EEG data. I could not use the filter design as given above by importing the data into it. Could anyone please help me to import the data into the filter. Will really appreciate the help.
I am very new to matlab.
Sir, can you explain why you choose Chebyshev type II rather than the other?
The Chebyshev II passband and stopband characteristics.
I would now use an elliptic filter, since it is significantly more computationally efficient.
Dear @Star Strider, I thank you in advace my questions (I am new in signal processing).
I started to work with EEG, I tried to apply your filters, but they give NAN values, so I am processing with the classic bandpass().
  1. What is the advantage of using your filter over bandpass() ?
  2. I think, before to band pass, the signal could be denoised, isn’t it? Which do you suggest?
  3. In which part of processing is useful Fourier Transform or Wavelets T ? I so confused about filtering.
kalarmago —
1. The bandpass function was introduced in R2018a, two years after I wrote this! (I would currently use ellip and its friends.)
2. There are several ways to denoise a signal. For broadband noise, wdenoise or sgolayfilt are likely best, in my experience at least.
3. I have no idea what you are asking!

Sign in to comment.

More Answers (1)

Todd Leonhardt
Todd Leonhardt on 20 May 2016
Edited: Todd Leonhardt on 20 May 2016
If you have the Signal Processing Toolbox, then you can design 4 bandpass filters, one for each band, using the Filter Design and Analysis Tool (FDATool): http://www.mathworks.com/help/signal/examples/introduction-to-the-filter-design-and-analysis-tool-fdatool.html
You can also do this with a script using various MATLAB functions instead of the GUI FDATool. But if you are unfamiliar with filter design, the GUI makes it easier.
Then you can apply those FIR filters to generate 4 output signals, one for each band.
There are many other ways you could solve this problem as well. This is one approach which should be relatively easy and effective.

Categories

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!