[FieldTrip] ft_freqanalysis time and freq settings
Martin Rosenfelder
martin.rosenfelder at uni-ulm.de
Wed Jul 3 10:52:14 CEST 2019
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
--
M.Sc.-Psych. Martin Rosenfelder
Wissenschaftlicher Mitarbeiter
Klinische und Biologische Psychologie
Universität Ulm
Raum 47.2.259
+49 731-50 26592
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