<div dir="ltr"><div>Dear Nikolaos,</div><div><br></div><div>First of all, welcome to the FieldTrip community!</div><div><br></div><div>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:</div><div><a href="http://www.fieldtriptoolbox.org/faq/why_am_i_not_getting_exact_integer_frequencies/">http://www.fieldtriptoolbox.org/faq/why_am_i_not_getting_exact_integer_frequencies/</a></div><div><br></div><div>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.<br></div><div><br></div><div>Happy fieldtripping,<br></div><div>Stephen<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Op do 7 nov. 2019 om 20:15 schreef Nikolaos Vardalakis <<a href="mailto:N.Vardalakis@student.tudelft.nl">N.Vardalakis@student.tudelft.nl</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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:<br>
<br>
cfg                  = [];<br>
cfg.output      = 'pow';<br>
cfg.channel    = {'eeg'};<br>
cfg.method    = 'mtmconvol';                                % multitaper time-frequency transformation <br>
cfg.taper        = 'hanning';                                    % hanning window<br>
cfg.foi             = 2:2:30;                                       % interested in the evenfrequencies from 2Hz to 30Hz<br>
cfg.toi             = -2:100/eeg.fsample:5;               % time window "slides" from -2 to 5 sec in steps of 50ms<br>
cfg.t_ftimwin   = ones(length(cfg.foi),1)*0.5;     % length of time window = 0.5 sec<br>
TFRhann         = ft_freqanalysis(cfg, eeg);<br>
<br>
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:<br>
<br>
processing trials<br>
trial 1, frequency 5 (10.03 Hz), 1 tapers<br>
....<br>
trial 2, frequency 13 (25.99 Hz), 1 tapers<br>
<br>
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:<br>
<br>
cfg                         = [];<br>
cfg.baseline           = [-inf 0];<br>
cfg.baselinetype    = 'absolute';<br>
cfg.maskstyle        = 'saturation';<br>
cfg.zlim                  = 'maxabs';<br>
cfg.showlabels      = 'yes';<br>
cfg.layout             = layout;<br>
cfg.colorbar          = 'yes';<br>
cfg.renderer         = 'painters';<br>
figure<br>
ft_multiplotTFR(cfg, TFRhann);<br>
<br>
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?<br>
<br>
Thank you all for your time!_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>