How can I decompose the EEG data to 'alpha,beta gamma,theta,delta' bends correctly?
11 views (last 30 days)
Show older comments
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:
- Delta (0–4 Hz)
- Theta (4–8 Hz)
- Alpha (8–16 Hz)
- Beta (16–32 Hz)
- 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?
- how can i know if the code is correct and can i verify it ?
- 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.
- 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?
- What i need to do next for the diffusion map?
- how can i insert the classification vector?
- 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
0 Comments
Answers (2)
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.
0 Comments
See Also
Categories
Find more on EEG/MEG/ECoG 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!