Trouble using Common Spatial Patterns
1 次查看(过去 30 天)
显示 更早的评论
Hello, I'm trying to use CSP on multiple trials of EEG data but I am unsure if it is correct. There are two classes, think left and think right.
I am using the data set and CSP method described in this paper: http://www.ncbi.nlm.nih.gov/pubmed/23204288
For every trial I calculate this value:
C = (xl*xl')/trace(xl*xl');
where xl is the EEG trial data NxP where N is the number of channels and P the data samples.
Then I get the average of all the values of C for think Left and again for think Right. Then I sum those 2 averages together to get the matrix "CC". Then I do this:
CC = CbarL + CbarR;
[V,D] = eig(CC); %V*D*V'==CC
[lamda, ind] = sort(diag(D),'descend');
V = V(:,ind);
P = sqrt(inv(diag(lamda))) * V';
S1 = P*CbarL*P'; % eig(P*CC*P')==ones
S2 = P*CbarR*P';
[B,I] = eig(S1, S2);
[I,ind] = sort(diag(I));
B = B(:,ind);
W = (B'*P);
Finally
W*xl
gets me my filtered trials. Is this all correct so far?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 EEG/MEG/ECoG 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!