[Eeglablist] Applying runica on a synthetic dataset

Stefan Debener s.debener at uke.uni-hamburg.de
Fri Jun 2 02:37:04 PDT 2006


Dear Christos,
I get a perfect decomposition using infomax and eeglab 5.02 with the code attached below. Note that syn_dat is slightly modified compared to your synthetic_dataset, which was buggy.
Best,
Stefan

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%For the sin waveform (f = 6Hz)
t1 = 0:0.0025:60;
hmi = sin(12*pi*t1);

%For the cosin waveform (f = 8Hz)
t2 = 0:0.0025:60;
syn = cos(20*pi*t2);

%For the triangular pulse waveform (f = 4Hz)
t3 = 0:0.0025:60;
d = 0:0.0025:0.25;
tri = 0 + zeros(1, 24001);
for i = 0:239
    up = 1 + 100*i;
    down = 101 + 100*i;
    tri(1,up:down) = d;
end

%For the synthetic dataset
syn_org(1,1:24001) = hmi;
syn_org(2,1:24001) = syn;
syn_org(3,1:24001) = tri;

syn_dat = [];
syn_dat(1,1:24001)=2*hmi+3*syn+4*tri;
syn_dat(2,1:24001)=5*hmi+6*syn+7*tri;
syn_dat(3,1:24001)=8*hmi+9*syn+1*tri;

[ALLEEG EEG CURRENTSET ALLCOM] = eeglab;
EEG = pop_importdata( 'dataformat', 'array', 'data', ...
    'syn_dat', 'srate',100, 'pnts',0, 'xmin',0, 'nbchan',3);
[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 0);
EEG = eeg_checkset( EEG );
pop_eegplot( EEG, 1, 1, 1);

EEG = pop_runica(EEG,  'icatype', 'runica', 'dataset',1, ...
    'options',{ 'extended',1});
[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET);
pop_eegplot( EEG, 0, 1, 1);




%%%%%%%%%%%%%%%%%%%%%%

xristos-alex wrote:
> Hello to everybody and congratulations for this project!
> I 've tried to apply infomax ICA (runica function - EEGlab v4.515 under
> Matlab 6) to a synthetic dataset of my own and the components I get aren't
> the correct ones. The synthetic dataset that I 've constructed consists of 3
> channels of 24001 datapoints each. Every channel is a linear combination of
> a triangular pulse function, a sine function and a cosine function. When I
> use jader() or sobi() the components are ok. The sampling frequency is
> 400Hz.
> The Matlab functions that I 've used are :
>
> For the sin waveform (f = 6Hz)
> t1 = 0:0.0025:60;
> hmi = sin(12*pi*t1);
>
> For the cosin waveform (f = 8Hz)
> t2 = 0:0.0025:60;
> syn = cos(16*pi*t2);
>
> For the triangular pulse waveform (f = 4Hz)
> t3 = 0:0.0025:60;
> d = 0:0.0025:0.25;
> tri = 0 + zeros(1, 24001);
>
> for i = 0:239
>     up = 1 + 100*i;
>     down = 101 + 100*i;
>     tri(1,up:down) = d;
> end
>
> For the synthetic dataset
> synthetic_dataset(1,1:24001)=2*syn+3*cos+4*tri
> synthetic_dataset(2,1:24001)=5*syn+6*cos+7*tri
> synthetic_dataset(3,1:24001)=8*syn+9*cos+tri
>
> Finally I import the synthetic_dataset matrix into EEGlab as a Matlab array.
>
> What am I doing the wrong way?
> I need some help. I'm looking forward to any response.
> Thank you in advance!
> Christos Chantzis
> Athens - Greece
>
> _______________________________________________
> eeglablist mailing list eeglablist at sccn.ucsd.edu
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
>
>
>   






More information about the eeglablist mailing list