Needed FRequency analysis of an EEG signal
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
Accepted Answer
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
onur
on 26 Mar 2012
Srey
on 24 Apr 2013
And how the frequency range can be found out, corresponding to each wave ??
Srey
on 3 May 2013
What will be the decomposition level if the sampling frequency is 128 hz?
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 vote
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
0 votes
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
Sandeep B
on 4 Dec 2013
Hi Salaheldin,
freq=(1:N/2)*fs/N; plot(freq,PS);To plot these two vectors they are of different length, i wonder why the frequency range is of half of the signal length and it is multiplied by fs/N. It would be greatly appreciated if you could help me. Thanks
NavMood
on 2 Mar 2015
Hello Salaheldin
I have done the steps as you've mentioned. But I am having problem in plotting the graph between PS and frequency. I will be grateful if you help me
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
pavan kumar
on 23 Nov 2020
make PS to half to plot
upasana talukdar
on 7 Oct 2015
0 votes
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
suganya sri
on 22 Oct 2017
my EEG data has 256 Hz sampling freuency ,please tell me that in how many level should i decomposes my signal?
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 ?
pavan kumar
on 23 Nov 2020
use max level decomposition
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!