[Eeglablist] CSP in EEGLAB

Arnaud Delorme arno at ucsd.edu
Wed Jan 2 23:00:53 PST 2019

I know of custom solutions. There is custom CSP code in the paper below

Delorme, A., Kothe, C., Bigdely, N., Vankov, A., Oostenveld, R., Makeig, S. (2010) Matlab Tools for BCI Research? In "human-computer interaction and brain-computer interfaces". Editors : Tan, D. and Nijholt, A. Springer Publishing.

Then there is some code on the Matlab Exchange site


I have tried with this dataset (https://sccn.ucsd.edu/mediawiki/images/5/59/SimpleOddball.zip) to run CSP on oddball versus standard trials and the simple code below.

EEG = pop_loadset('filename','SimpleOddball.set');
TMPEEG = pop_eegfiltnew(EEG, 'locutoff',1,'hicutoff',45);
EEG1 = pop_epoch( TMPEEG, {  '1'  }, [0 1], 'newname', 'Standard epochs', 'epochinfo', 'yes');
EEG2 = pop_epoch( TMPEEG, {  '2'  }, [0 1], 'newname', 'Oddball epochs', 'epochinfo', 'yes');

cov1 = cov(EEG1.data(:,:)');
cov2 = cov(EEG2.data(:,:)');
[V,D] = eig(cov1,cov1+cov2);
figure; topoplot(V(:,1), EEG.chanlocs);
figure; topoplot(V(:,end), EEG.chanlocs);

First and last CSP available at https://sccn.ucsd.edu/mediawiki/images/6/65/CSP.png
First and last CSP are usually the most discriminant. https://www.researchgate.net/profile/Herbert_Ramoser/publication/12127239_Optimal_Spatial_Filtering_of_Single_Trial_EEG_During_Imagined_Hand_Movement/links/57c6993808ae9d64047d332d/Optimal-Spatial-Filtering-of-Single-Trial-EEG-During-Imagined-Hand-Movement.pdf

Since the data has not been cleaned, these components are still likely to be dominated by noise. Comments by expert CSP users are welcome.

Best wishes,


> On Dec 22, 2018, at 5:46 PM, tr rt <trrt19800 at gmail.com> wrote:
> Hi all,
> Is there CSP: Common Spatial Patterns in EEGLAB. Is it good enough?
> I heared about CSP in mne-python. But I prefer to use EEGLAB. I could install CSP plugin in EEGLAB from File->Manage EEGLAB Extensions ->Data Processing Extensions.   but couldn't run it or find it after installing it.
> Is there also documentation for using CSP in EEGLAB?
> Thanks in Advance for any reply
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu

More information about the eeglablist mailing list