[FieldTrip] [ext] ft_freqanalysis time and freq settings

Martin Rosenfelder martin.rosenfelder at uni-ulm.de
Thu Jul 11 09:00:07 CEST 2019


Hi Mathis,

Thank you very much for your explanation and sorry for the late reply. 
The setting of parameters now definitely makes more sense to me.
As I read your explanation, it would be advantageous to select a 
frequency-dependent window, e.g. if I want to analyze between 7-30Hz 
with a 1Hz resolution, there are 24 steps in frequency. So I would have 
to select either 3 / 4 / 6 cycles. If I take 6 cycles, the temporal 
resolution should be better as with 3 cycles. Is this correct?

Best regards,
Martin

Am 05.07.19 um 12:12 schrieb Mathis Kaiser:
> Hi Martin,
>
> it's correct that if you want 1Hz resolution, you need to increase the
> length of your cfg.t_ftimwin to 1s, at the expense of decreasing your
> temporal resolution. Another way would be to increase padding of your
> data, at the expense of decreasing total power.
> What is often done, and makes the time-freq analysis similar to a
> wavelet analysis, is using a frequency-dependent time window (e.g. 3-7
> cycles of a given frequency, depending on the desired temporal resolution).
> Your cfg. toi does not depend on the time window, it just specifies on
> which time points the chosen window will be centered.
> Most of this is explained in some detail in the tutorial (sections
> Background and TFR analysis I and II).
>
> Hope this helps,
> Mathis
>
> On 03.07.19 10:52, Martin Rosenfelder wrote:
>> Dear Fieldtrip community,
>>
>> I am analyzing a two-class motor imagery task using power spectra as features for training and testing in a machine-learning setting.
>> Reading through the tutorial on "Time-frequency analysis using Hanning window, multitapers and wavelets" I found out about how to set the time and frequency parameters (cfg.t_ftimwin, cfg.toi and cfg.foi). However I did not figure out how to determine a good way of setting all these parameters.
>>
>> My current configuration loooks like this:
>>
>> % Motor Imagery condition
>>          cfg = [];
>>          cfg.output = 'pow';
>>          cfg.method = 'mtmconvol';
>>          cfg.taper = 'hanning';
>>          cfg.foi = 7:30
>>          cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5;
>>          cfg.channel = {'E8' 'E9' 'E17' 'E43' 'E44' 'E45' 'E51' 'E52' 'E53' 'E58' 'E59' 'E60' 'E65' 'E66' 'E79' 'E80' 'E81' 'E131' 'E132' 'E143' 'E144' 'E155' 'E164' 'E182' 'E183' 'E184' 'E185' 'E186' 'E195' 'E196' 'E197' 'E198'}
>>          cfg.toi = 1.0:0.25:4.0;
>>          cfg.trials = find(data_ref.trialinfo(:,4) == 1);
>>          cfg.keeptrials = 'yes';
>>          cfg.pad = 'nextpow2';
>>          tfrswim = ft_freqanalysis(cfg,data_ref);
>>          
>> % Rest condition
>>          cfg = [];
>>          cfg.output = 'pow';
>>          cfg.method = 'mtmconvol';
>>          cfg.taper = 'hanning';
>>          cfg.foi = 7:30
>>          cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5;
>>          cfg.channel = {'E8' 'E9' 'E17' 'E43' 'E44' 'E45' 'E51' 'E52' 'E53' 'E58' 'E59' 'E60' 'E65' 'E66' 'E79' 'E80' 'E81' 'E131' 'E132' 'E143' 'E144' 'E155' 'E164' 'E182' 'E183' 'E184' 'E185' 'E186' 'E195' 'E196' 'E197' 'E198'}
>>          cfg.toi = 1.0:0.25:4.0;
>>          cfg.trials = find(data_ref.trialinfo(:,4) == 2);
>>          cfg.keeptrials = 'yes';
>>          cfg.pad = 'nextpow2';
>>          tfrrest = ft_freqanalysis(cfg,data_ref);
>>
>> So far I selected a time window of 0.5 seconds, which results in a power calculation at 2Hz, 4Hz, 6Hz etc. Presumably, this does not fit the selected frequency bands between 7 and 30 Hz.
>>
>> My main concerns are:
>> Would another time window in cfg.t_ftimwin (e.g. 1 second) fit better here?
>> In which relation is cfg.toi to the setting in cfg.t_ftimwin and what steps would match the 1 second in cfg.t_ftimwin?
>>
>> I hope that the description was adequately understandable and would like to thank you in advance for any kind of comment.
>>
>> Kind regards,
>> Martin
>>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202

-- 
M.Sc.-Psych. Martin Rosenfelder
Research Associate
PhD Student
Clinical and Biological Psychology
Ulm University
Room: 47.2.259
Phone: +49 731-50 26592
E-mail: martin.rosenfelder at uni-ulm.de

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202


More information about the fieldtrip mailing list