Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Matlab FFT to extract frequencies from EEG signal

I am new to BCI. I have a Mindset EEG device from Neurosky and I record the Raw data values coming from the device in a csv file. I can read and extract the data from the csv into Matlab and I apply FFT. I now need to extract certain frequencies (Alpha, Beta, Theta, Gamma) from the FFT.

Where Delta = 1-3 Hz

Theta= 4-7 Hz

Alpha = 8-12 Hz

Beta = 13-30 Hz

Gamma = 31-40 Hz

This is what I did so far:

f = (0:N-1)*(Fs/N);
plot(rawDouble);
title ('Raw Signal');
p = abs(fft(rawDouble));
figure,plot (f,p);
title('Magnitude of FFT of Raw Signal');

Can anyone tell me how to extract those particular frequency ranges from the signal?? Thank you very much!

like image 486
Mariam H Avatar asked May 09 '12 13:05

Mariam H


2 Answers

For convenient analysis of EEG data with MatLab you might consider to use the EEGLAB toolbox (http://sccn.ucsd.edu/eeglab/) or the fieldtrip toolbox (http://fieldtrip.fcdonders.nl/start).

Both toolboxes come with good tutorials:

http://sccn.ucsd.edu/eeglab/eeglabtut.html

http://fieldtrip.fcdonders.nl/tutorial

like image 105
H.Muster Avatar answered Sep 25 '22 15:09

H.Muster


You may find it easier to start off with MATLAB's periodogram function, rather than trying to use the FFT directly. This takes care of windowing the data for you and various other implementation details.

like image 35
Paul R Avatar answered Sep 23 '22 15:09

Paul R