query on coherence analysis

Jan Mathijs Schoffelen Jan.Schoffelen at FCDONDERS.RU.NL
Fri Jun 16 09:15:15 CEST 2006


Dear Muthuraman,

At first glance I don't have a clue what's going on.
Did you have a look into fd.powspctrm, and fd.cohspctrm?
Does it contain normal numbers, zeros, or nan?
It might be a bug in freqanalysis_mtmwelch.
Did you try out other methods, to be specified in cfg.method?
If yes, did this also give strange results? If no, could you try out
cfg.method = 'mtmconvol' instead of 'mtmwelch'? Please have a look at the
documentation which additional options you have to specify.
What matlab-version do you use? Do you use the latest fieldtrip-version?

One additional thing: please note that you specified the odd frequencies
1:2:29, whereas your time-window is half a second wide. These are not
optimal settings, since the frequency-resolution of your time-window is 2
Hz. This means that your time-window never contains an integer amount of
cycles of the frequency you want to estimate. This might lead to strange
results, though I don't think it has anything to do with your present
problem. However, I would use cfg.freq = 2:2:30 in combination with a
time-window of 0.5 s

Yours,

Jan-Mathijs

-----Original Message-----
From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Muthuraman Muthuraman
Sent: Thursday, June 15, 2006 4:00 PM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: Re: [FIELDTRIP] query on coherence analysis

Hello

Thankyou for the previous help it works now
i am able to proceed further to calculate the coherence

The problem now the coherence obtained using the mtmwelch
when i plot the coherence figures for the channels
all the coherence figures for the different channel looks the same
is there is a bug in how i am calculating the coherence

These are the steps i carried out in calculating the coherence

headerfile='pd_mof_tr0_c_0306.cnt';
hdr = read_fcdc_header(headerfile);
cfg.trl = [];
for i=1:floor(hdr.nSamples/hdr.Fs)
  cfg.trl(i,1) = (i-1)*hdr.Fs + 1;
  cfg.trl(i,2) = (i  )*hdr.Fs;
  cfg.trl(i,3) = 0;
end

cfg.headerfile=headerfile;
>>cfg.datafile=headerfile;
>>[data] = preprocessing(cfg);

-and after the data is preprocessed i change the channel labels from actual
cz to eeg26 and so on



cfg=[];
cfg.output='powandcsd';
cfg.method='mtmwelch';
cfg.foi=1:2:30;
numfoi = length(cfg.foi);
cfg.taper='hanning';
cfg.t_ftimwin=zeros(1,numfoi);
cfg.t_ftimwin(:)=0.5;
cfg.channel=channelselection({'EEG' 'EMG2'},data.label);
cfg.channelcmb={'EEG' 'EMG2'};
freq=freqanalysis(cfg,data);


-when i calculate using freqanalysis i get these warnings

1.000 Hz : WARNING - using only one taper for specified smoothing
Warning: Size vector should be a row vector with integer elements.
>In freqanalysis_mtmconvol at 360
  In freqanalysis at 182
  In freqanalysis_mtmwelch at 67
  In freqanalysis at 182
and so on till 30.000 hz

-and while processing

processing trial 2: 1000 samples
Warning: Size vector should be a row vector with integer elements.
>In freqanalysis_mtmconvol at 398
  In freqanalysis at 182
  In freqanalysis_mtmwelch at 67
  In freqanalysis at 182



fd=freqdescriptives([],freq);


cfg=[];
cfg.xparam='freq';
cfg.yparam='cohspctrm';
cfg.xlim=[3 30];
cfg.cohrefchannel='EMG2';
cfg.box='yes';
cfg.showlabels='yes';

cfg.channelname='EEG27';
singleplotER(cfg,fd);
-when i try to plot i get this error
??? Error using ==> char
Cell elements must be character arrays.

Error in ==> singleplotER at 326
  t=[char(cfg.channelname) ' / ' num2str(cfg.channelindex) ];


please , look at it and help me in this regard

thanking you
with regards
muthuraman



More information about the fieldtrip mailing list