MATLAB Answers

How can I decompose the EEG data to 'alpha,beta gamma,theta,delta' bends correctly?

18 views (last 30 days)
yair
yair on 2 Aug 2014
hello i have an EEG signal form 14 channels.
i want to perform a diffusion map on each channel separately.
i have done STFT on the data.
The sample rate is 128H,
I took a window size of 256 and i have done 90% overlap. The size of the matrix is (129*766)
now i want to decompose the signal in 5 subbands:
  1. Delta (0–4 Hz)
  2. Theta (4–8 Hz)
  3. Alpha (8–16 Hz)
  4. Beta (16–32 Hz)
  5. Gamma (32–64 Hz)
for later on using diffusion maps on the data as 5 dimension matrix.
So after the decomposition i should have a (5*766) matrix, and one more vector for classification (1*766) There are events in [T=45s', 65s' , 90s' , 92s'] shown in the pic.
I wrote this code for the decomposition after some web search:
waveletFunction = 'db1';
[C,L] = wavedec(mySignal,5,waveletFunction);
%Calculation The Coificients Vectors of every Band :
cD1 = detcoef(C,L,1); %NOISY
cD2 = detcoef(C,L,2); %GAMMA
cD3 = detcoef(C,L,3); %BETA
cD4 = detcoef(C,L,4); %ALPHA
cD5 = detcoef(C,L,5); %THETA
cA5 = appcoef(C,L,waveletFunction,5); %DELTA
% Calculation the Details Vectors of every Band :
D1 = wrcoef('d',C,L,waveletFunction,1); %NOISY
Gamma = wrcoef('d',C,L,waveletFunction,2); %GAMMA
Beta = wrcoef('d',C,L,waveletFunction,3); %BETA
Alpha = wrcoef('d',C,L,waveletFunction,4); %ALPHA
Theta = wrcoef('d',C,L,waveletFunction,5); %THETA
Delta = wrcoef('a',C,L,waveletFunction,5); %DELTA
my questions are?
  1. how can i know if the code is correct and can i verify it ?
  2. when i use 'a' in the delta coefficient i get values *10^3 larger than the other coefficients , and when i use 'd' the values are in the same order.
  3. For my understanding the STFT(spectrogram plot) doesn't help my cause except maybe to distinguish the incidents in the time scale, am i right?
  4. What i need to do next for the diffusion map?
  5. how can i insert the classification vector?
  6. sadly i'm not sure what the meaning of the decomposition and how it can help me?
i hope someone can help me
best regards
yair

Answers (2)


Mahsa Hassankashi
Mahsa Hassankashi on 3 Aug 2021
Unfortunately, it seems late but I hope that it would be useful. This code decomposes EEG signal and reconstructs it by the aid of waverec and comparisons if the similarity to be sure if decomposition comes well. It also compares two solutions for Gamma decomposition by ellipord and waverec.

Community Treasure Hunt

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

Start Hunting!