[FieldTrip] Number of epochs in the ft_freqanalysis output

Pelt, S. van (Stan) stan.vanpelt at donders.ru.nl
Mon Dec 14 14:30:32 CET 2015


Hi Federica,

If you want to have an estimate for each trial separately, you should specify cfg.keeptrials=’yes’ when calling ft_freqanalysis. See also http://www.fieldtriptoolbox.org/faq/in_what_way_can_frequency_domain_data_be_represented_in_fieldtrip?

Best,
Stan

From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Federica Mauro
Sent: maandag 14 december 2015 13:41
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Number of epochs in the ft_freqanalysis output

Dear Stan and Elana, thank you very much for your answers and help.

Just another question: if I understood correctly, there's no way to compute fft for single trials, since TFRhann.powspctrm is by definition an average along trials. Is that true?

Thanks again.

Bests,
Federica

2015-12-14 13:21 GMT+01:00 Pelt, S. van (Stan) <stan.vanpelt at donders.ru.nl<mailto:stan.vanpelt at donders.ru.nl>>:
Dear Elana,

The 50ms timesteps result in the 41 timebins. Per timebin, the average power spectrum (TFRhann.powspctrm) is computed over all trials that have data in that specific time bin. In your case, the power in the earlier time bins (e.g. 0.0s-0.05s) will be based on more data points (trials) than that of the later ones (e.g. 1.95-2.0s), because of your variable trial length.

If you specify cfg.keeptrials=’yes’, you can see that the individual trial’s TFRs will have different amount of data points.

Hope that helps.

Best,
Stan

--
Stan van Pelt, PhD
Donders Institute for Brain, Cognition and Behaviour
Radboud University
Montessorilaan 3, B.01.34
6525 HR Nijmegen, the Netherlands
tel: +31 24 3616288<tel:%2B31%2024%203616288>


From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [mailto:fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>] On Behalf Of Harris, Elana
Sent: maandag 14 december 2015 13:12
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Number of epochs in the ft_freqanalysis output


cfg.toi          = -0:0.05:2;                  % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms)



I just noticed this line has an error should be -0.5:0.5:2



Sorry, I am new to fieldtrip myself and can't be more helpful yet.



Cheers,



Elana

________________________________
From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>] on behalf of Federica Mauro [federica.ma at gmail.com<mailto:federica.ma at gmail.com>]
Sent: Monday, December 14, 2015 6:30 AM
To: FieldTrip discussion list
Subject: [FieldTrip] Number of epochs in the ft_freqanalysis output
Dear all,

I'm having a problem in using the ft_freqanalysis function, so I'm writing to ask your help.
I'm trying to get power data for each 2-seconds epochs of my eeg files.
My eeg files are not of the same length (they don't have the same number of epochs), however the output of the function (namely TFRhann.powspctrm) always gives me power data for the same number of epochs, namely 41, unregarding of the effective number of epochs.

Here is the code I'm using:

cfg              = [];
cfg.output       = 'pow';
% cfg.channel
cfg.method       = 'mtmconvol';
cfg.taper        = 'hanning';
cfg.foi          = 4:1:40;                         % analysis 2 to 30 Hz in steps of 2 Hz
cfg.t_ftimwin    = ones(length(cfg.foi),1).*0.5;   % length of time window = 0.5 sec
cfg.toi          = -0:0.05:2;                  % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms)
TFRhann = ft_freqanalysis(cfg, eeg);

Do you have any suggestion about it?
Thank you very much for your attention.

Worm regards,
Federica



_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151214/ccafd223/attachment-0002.html>


More information about the fieldtrip mailing list