[FieldTrip] Time-frequency analysis of EEG data - non-integer frequency multiples

Nikolaos Vardalakis N.Vardalakis at student.tudelft.nl
Thu Nov 7 20:12:18 CET 2019


Hello everyone. I am a new member, working on EEG source localization for hand motor tasks. I am trying to get how the time-frequency analysis is working in the toolbox and I understand most of it, however I am facing an issue with the frequencies. As the title mentions, the frequencies scanned from the algorithm are non-integers in the specified range. I am trying to get the power of the even frequencies in the range of [2 30]Hz and to do so I am using the following code:

cfg                  = [];
cfg.output      = 'pow';
cfg.channel    = {'eeg'};
cfg.method    = 'mtmconvol';                                % multitaper time-frequency transformation 
cfg.taper        = 'hanning';                                    % hanning window
cfg.foi             = 2:2:30;                                       % interested in the evenfrequencies from 2Hz to 30Hz
cfg.toi             = -2:100/eeg.fsample:5;               % time window "slides" from -2 to 5 sec in steps of 50ms
cfg.t_ftimwin   = ones(length(cfg.foi),1)*0.5;     % length of time window = 0.5 sec
TFRhann         = ft_freqanalysis(cfg, eeg);

As you can see from the code, I am calculating the time-frequency data of my EEG data (sampled at 2048Hz if it helps). I am using a single Hanning taper, the frequencies of interest are 2,4,6...30Hz and the time window length is set to a constant 0.5 seconds. The time window is set to make steps of 100/2048 ~= 0.0488 seconds. When I run the above code however, I get the output seen below:

processing trials
trial 1, frequency 5 (10.03 Hz), 1 tapers
....
trial 2, frequency 13 (25.99 Hz), 1 tapers

When the analysis ends, I use the ft_multiplotTFR() function to plot the results and I can see 0 power in the output of my sensors, which leads me to question what I'm doing... The code I am using to plot the output is posted below:

cfg                         = [];
cfg.baseline           = [-inf 0];
cfg.baselinetype    = 'absolute';
cfg.maskstyle        = 'saturation';
cfg.zlim                  = 'maxabs';
cfg.showlabels      = 'yes';
cfg.layout             = layout;
cfg.colorbar          = 'yes';
cfg.renderer         = 'painters';
figure
ft_multiplotTFR(cfg, TFRhann);

I have also attached the two images I get (full layout vs single electrode). Those do not seem correct to me. Can anyone suggest what might I be missing?

Thank you all for your time!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: all elec.png
Type: image/png
Size: 73766 bytes
Desc: all elec.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20191107/19ec0c0d/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: single elec.png
Type: image/png
Size: 18205 bytes
Desc: single elec.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20191107/19ec0c0d/attachment-0001.png>


More information about the fieldtrip mailing list