[FieldTrip] TFR with different trial lengths

Raphaël Thézé raphael.theze at gmail.com
Wed Jun 26 11:52:00 CEST 2019


Hello Ioanna,

Because the ouput is in a 4D matrix it has to put zeros because you cannot
"not have" something that fills all dimensions. Hence the zeros.

If having the zeros is inconvenient for you because you are doing single
trial analysis, you may try to do a loop in which you call ft_freqanalysis
with cfg.trials corresponding to one different trial each time. That will
give a cell array of structure outputs that you can later merge into one
structure with trials in different cells. But depending on what kind of
stats or analysis you want to do later, the typical fieldtrip functions
might not like this arrangement.

Also depending on the kind of experiment you are working on, if the entire
duration of your trial is not need and you need to do grand averaging, you
might want to consider truncating your trials at the lenght of the shortest
trial.

Cheers,
Raphaël


Le mer. 26 juin 2019 à 11:28, Ioanna Zioga <i.zioga at qmul.ac.uk> a écrit :

> Hello Fieldtrip community!
>
>
> I want to do TFR analysis on datasets with trials with different lengths
> (as I'm analysing the time period from the onset of a stimulus until
> participant's response, which differs from trial to trial).
>
>
> These are the parameters:
>
> cfgft                   = [];
> cfgft.method    = 'tfr';
> cfgft.output      = 'pow';
> cfgft.foi              = exp(linspace(log(2),log(45),50));
> *cfgft.toi              = [];*
> cfgft.width         = 6;
> cfgft.keeptrials  = 'yes';
>
> The result I get from the freqanalysis (powspctrm) is a *trial x chan x
> freq x time *matrix, in which the *time *is the time of the trial with
> the largest duration. The datapoints of the trials with smaller durations
> are filled with zeros.
>
>
> I would prefer to get the powspctrm without the zeros at the end, but
> maybe I can just exclude them later on from the analysis?
>
> Do you know if Fieldtrip works fine with trials of different durations?
> And if there is any other more efficient way to analyse trials with
> different durations?
>
>
> Any help would be extremely appreciated, thanks so much in advance!
>
>
> Best wishes,
>
> Ioanna
>
>
> _______________________________________________
> 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/20190626/2b8a31d4/attachment-0002.html>
-------------- next part --------------
_______________________________________________
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