[FieldTrip] multitaper and NaN
Ingrid Nieuwenhuis
inieuwenhuis at berkeley.edu
Tue Jun 26 18:43:10 CEST 2012
Hi Silvia,
Also see here:
http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_contain_nans
good luck,
Ingrid
On 6/26/2012 9:41 AM, Conrado Bosman wrote:
> Dear Silvia,
>
> The cfg.t_ftimwin parameter sets your current windows of analysis. In your actual configuration, you are using a pretty much similar wavelet approach in which your time window changes according to the frequency increase. Then your first time window is 5/2 = 2.5 sec which is bigger than your actual trial length (1.2 sec). Thats the reason why you get only NaNs in your low-frequency analyses and also a boundary of NaNs in the subsequent analyses.
> It is recommended to use in case of lower frequencies just one taper approach, unless you have several seconds of signal to analyze. Reading carefully, the Gould et al. suggestion goes in that direction. They said that they're using a .5 s window Ther (Rayleigh) frequency of resolution of this analysis is 1/0.5 = 2 Hz, which is precisely what they described. So,according to this, I suggest you to use the following parameters:
>
> cfg = [];
> cfg.output = 'pow';
> cfg.channel = 'EEG';
> cfg.method = 'mtmconvol';
> cfg.foi = 2:2:30;
> numfoi = length(cfg.foi)
> cfg.timwin = ones(1,numfoi).*0.5;
> cfg.tapsmofrq = ones(1,numfoi).*2;
> cfg.taper = 'hanning';
>
> Best,
> Conrado
>
>
> On Jun 26, 2012, at 6:04 PM, Silvia Pagano wrote:
>
>> Dear list subscribers,
>>
>> I am an ERPer looking for the first time into the world of time-frequency analysis. I am trying to perform some multitaper analysis on a data set. Ideally I would like to perform similar analysis as described in a paper by Gould et al (2011) on Journal of Neurophysiology. (i.e. in their own words "Time-frequency analysis was performed on
>> all epochs using a multitaper approach (2–30 Hz, 0.5-Hz steps, 500-ms temporal smoothing window, 2-Hz frequency resolution)" )
>>
>> I have epochs from -1100 ms to 100 time locked to the stimulus onset and I am trying to replicate the analysis they did. The problem is that I got boundary effects on all my conditions, namely I obtain NaN in the extreme 100 ms of the time window for all frequencies and for very low frequencies (e.g. 2-4Hz) I have no data in the whole time window. I thought I had time windows large enough to avoid boundary effects, however there must be something I am missing in my code.
>>
>> Here's what I did following the tutorial:
>>
>> cfg = [];
>> cfg.output = 'pow';
>> cfg.channel = 'EEG';
>> cfg.method = 'mtmconvol';
>> cfg.foi = 2:2:30;
>> cfg.t_ftimwin = 5./cfg.foi;
>> cfg.tapsmofrq = 0.4*cfg.foi;
>> cfg.toi = -1.1:0.02:0.1;
>> cfg.pad = 'maxperlen';
>> TFRmult = ft_freqanalysis(cfg, data);
>>
>>
>> Does anyone have a clue on this?
>>
>>
>> Thank you very much
>>
>> Silvia
>> --
>> __________________________________
>>
>> Silvia Pagano PhD student
>> CIMeC - Center for Mind/Brain Science
>> Corso Bettini, 31 38068 Rovereto (TN)
>> Tel. +39 0464 808709
>>
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
--
Ingrid Nieuwenhuis PhD
Postdoctoral Fellow
Sleep and Neuroimaging Laboratory
Department of Psychology
University of California, Berkeley
California 94720-1650
Tolman Hall, room 5305
More information about the fieldtrip
mailing list