Time frequency Analysis!

Jan Mathijs Schoffelen Jan.Schoffelen at FCDONDERS.RU.NL
Tue Jan 30 17:37:09 CET 2007


Dear Muthumaran,

Both Ingrid and I were replying to your question at the same moment. Please
note that you explicitly specify the time-axis of your trials to start at
time-point zero (the third column in your trl-matrix). As a consequence, no
'negative' time exists in your data, so baseline-correction with negative
numbers in your cfg.baseline cannot be applied.

Yours,

Jan-Mathijs

-----Original Message-----
From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Ingrid Nieuwenhuis
Sent: Tuesday, January 30, 2007 5:23 PM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: Re: [FIELDTRIP] Time frequency Analysis!

Hi Muthumaran

The following things I see are not correct. Maybe there is more, I do not
understand everything...

About your cfg for the freqanalysis
cfg.sgn='data';
you shouldn't define cfg.sgn, this is old, now cfg.channel is used, and you
define that already.

cfg.tapsmofrq(:)=10;
This means smoothing with 10 Hz above and below your foi. That is not
logical since your foi is 2 to 30 Hz. For instance, for foi=2 Hz you can not
smooth with 10 Hz under 2 Hz. For these low frequencies I wouldn't use the
dpss tapers, but a hanning window, so cfg.taper='hanning' and no
cfg.tapsmofrq

cfg.toi=-0.5:0.05:1.0;
I would take -1.0:0.05:1.0, else you get in trouble with baseline correction
with plotting. Since your using 500 ms timewindow, also power data before
t=0 will contain activity from after t=0

%---Plotting
cfg.baseline = [-1.0 -0.5];
In this way you prevent activity from after t=0 in your baseline

Hope this helps a bit,

Bests Ingrid

-----Original Message-----
From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Muthuraman Muthuraman
Sent: Tuesday, January 30, 2007 3:40 PM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: [FIELDTRIP] Time frequency Analysis!

Hello Fieldtrippers,

I have question regarding the Time-Frequency analysis using tapers,
'mtmconvol' or time frequency analysis using wavelets 'wltconvol'
these are the parameters i use, i get all the values to be Nan's
Is there something wrong which i need to change in the parameters for the
timefrequency analysis

hdr     = read_fcdc_header('pd_mof_tr0_c_0306.cnt');
emgindx = strmatch('M', hdr.label);
rstindx = setdiff(1:length(hdr.label),emgindx);

trl = [];
trl(:,1) = [21:1000:74520-1000]';
trl(:,2) = [1020:1000:74520]';
trl(:,3) = 0;


cfg.dataset = 'pd_mof_tr0_c_0306.cnt';
cfg.trl     = trl;
cfg.channel = hdr.label(rstindx);
cfg.blc     = 'yes';
data        = preprocessing(cfg);

cfg.channel  = hdr.label(emgindx);
cfg.hpfilter = 'yes';
cfg.hpfreq   = 10;
cfg.rectify  = 'yes';
emg          = preprocessing(cfg);

for j = 1:length(emg.trial)
  emg.trial{j} = blc(emg.trial{j});
end
data         = appenddata([],data,emg);

%---freqanalysis-mtmconvol
cfg=[];
cfg.ouput='pow';
cfg.sgn='data';
cfg.method='mtmconvol';
cfg.channel    = channelselection({'all' 'M1'}, data.label);
cfg.foi=2:2:30;
numfoi=length(cfg.foi);
cfg.t_ftimwin=zeros(1,numfoi);
cfg.t_ftimwin(:)=0.5;
cfg.tapsmofrq=zeros(1,numfoi);
cfg.tapsmofrq(:)=10;
cfg.toi=-0.5:0.05:1.0;
cfg.taper='dpss';
cfg.pad=2;
cfg.keeptrials='no';
TFRmult=freqanalysis(cfg,data);

%---Plotting
cfg=[];
cfg.baselinetype='relative';
cfg.zlim=[-2e-27 2e-27];
cfg.showlabels='yes';
cfg.channel='C3';
singleplotTFR(cfg,TFRmult);


Thanking you

With regards
M.Muthuraman.

_________________________________________________________________
Tickle your funny bone with Rahul Phondke
http://content.msn.co.in/Lifestyle/Moreonlifestyle/LifestyleFB_101106_1455.h
tm



More information about the fieldtrip mailing list