Needed FRequency analysis of an EEG signal
16 views (last 30 days)
Show older comments
Hi everyone.i am poor about matlab. i need to decompose EEG signals to ALpha,beta,gama... by using FFT. İ do not have a EEG database neither i do not know to use to database. please show me a way. thanks
0 Comments
Accepted Answer
Salaheldin
on 9 May 2012
to be more clear
x=load('EEG_data.txt'); y=fft(x); PS=abs(y).^2; N=length(x); fs=1000; freq=(1:N/2)*fs/N; plot(freq,PS)
0 Comments
More Answers (4)
Kosai
on 13 Mar 2012
Onur i didn't see any Question in your Post, but i got that you like to extract the Band Frequancy from EEG-Data-Raw. At first the recorded EEG-Data were usually saved in Dataset not in Database, so you dont need to have a database of EEG but you need to make search in google about "EEG-DATASET". Second, The best way to extract the Band-Frequancy fromm EEG-Raw is the wavelet analysis, so if you have the wavelet-toolbox in your matlab version you can use this following code to extract the Band-Frequancy, but a very important piont is what is the sampling frequancy of your EEG-Raw ?? it is very important to determine how many Level do you have to extract to achieve the Band-Frequancy, so i will assume that your Fs = 1000Hz, so you need (8 Level wavelet decompostion):
S = "your EEG-Data-Row";
waveletFunction = 'db8' OR 'sym8' ;
[C,L] = wavedec(S,8,waveletFunction);
%%Calculation The Coificients Vectors
cD1 = detcoef(C,L,1); %NOISY
cD2 = detcoef(C,L,2); %NOISY
cD3 = detcoef(C,L,3); %NOISY
cD4 = detcoef(C,L,4); %NOISY
cD5 = detcoef(C,L,5); %GAMA
cD6 = detcoef(C,L,6); %BETA
cD7 = detcoef(C,L,7); %ALPHA
cD8 = detcoef(C,L,8); %THETA
cA8 = appcoef(C,L,waveletFunction,8); %DELTA
%%%%Calculation the Details Vectors
D1 = wrcoef('d',C,L,waveletFunction,1); %NOISY
D2 = wrcoef('d',C,L,waveletFunction,2); %NOISY
D3 = wrcoef('d',C,L,waveletFunction,3); %NOISY
D4 = wrcoef('d',C,L,waveletFunction,4); %NOISY
D5 = wrcoef('d',C,L,waveletFunction,5); %GAMMA
D6 = wrcoef('d',C,L,waveletFunction,6); %BETA
D7 = wrcoef('d',C,L,waveletFunction,7); %ALPHA
D8 = wrcoef('d',C,L,waveletFunction,8); %THETA
A8 = wrcoef('a',C,L,waveletFunction,8); %DELTA
4 Comments
mamta p
on 11 Feb 2019
I dont have wavelet toolbox, can you please tell me how can i decompose EEG signals using FFT. can you please provide me the code.
onur
on 26 Dec 2012
1 Comment
Shan Ahmed
on 22 Feb 2018
Hi I'm trying to detect epilepsy from eeg signals, can you pls help me with the code for any feature extraction?
Salaheldin
on 9 May 2012
Hi Onur,
I hope this message isn't too late...Here is what you need to do x=load('EEG_data.txt'); % assuming your data is stored in a text file called 'EEG_data.txt' y=fft(x); % this line computes the Fast Fourier Transform of your EEG data PS=abs(y).^2; this line computes the power spectrum N=length(x); % this line determines number of data points in your data for plotting fs=1000; % I am assuming your sampling frequency is 1000 Hz freq=(1:N/2)*fs/N; % this line generates a frequency vector for plotting your data...only plotting half your spectrum is sufficient..rest doesn't have unique information. plot(freq,PS) % ENJOY!!!
4 Comments
suganya sri
on 22 Oct 2017
i am plting(freq,PS); ,i got error vector must be same length,pls help me how to clear
upasana talukdar
on 7 Oct 2015
Hi,
My EEG Data has 250 Hz Sampling frequency, And I want to extract signals of all bands from given main signal using DWT. Please tell me that in how many levels should I decompose my Signal for Fs=250?
3 Comments
Rasa
on 8 Apr 2019
Did you find any method to find out the number of levels needed ? Do you have matlab code to find out the frequency sub-bands of the EEG signal ?
See Also
Categories
Find more on Biomedical Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!