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

Stephen Whitmarsh stephen.whitmarsh at gmail.com
Thu Nov 7 21:54:21 CET 2019


Dear Nikolaos,

First of all, welcome to the FieldTrip community!

Concerning your non-integer frequencies, know that your frequency
resolution is 1/timewindow, so you might have just have a difference of a
sample; it is explained here:
http://www.fieldtriptoolbox.org/faq/why_am_i_not_getting_exact_integer_frequencies/

I don't know what you mean with having 0 power, but your plots seems not to
have a baseline (which should be 0 on average), and seem to have some 1/f
as a result. Something might have gone wrong there. Instead of using -inf
in the baseline, perhaps try something like -2 seconds first.

Happy fieldtripping,
Stephen

Op do 7 nov. 2019 om 20:15 schreef Nikolaos Vardalakis <
N.Vardalakis at student.tudelft.nl>:

> 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!_______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20191107/514a3553/attachment.html>


More information about the fieldtrip mailing list