[FieldTrip] Question about frequency analysis

Christodoylos Karittevlis christodoylos_k at hotmail.com
Thu Apr 29 09:24:38 CEST 2021


Dear Fieldtrip Community,

I am using the function ft_freqanalysis to calculate power spectrum and cross spectrum and after that I calculate the Magnitude Squared Coherence.
The trials are defined to start from -0.200s up to +0.500s .
When I use the function ft_freqanalysis on the whole trial it works fine , Coherence gives values from 0 to 1.
But when I try to use it only for the prestimulus period (e.g -0.2s – 0s ) or only to the poststimulus period (e.g 0 : 0.5s) , I think it does not work correctly because the Magnitude Squared Coherence is equal to 1 for all the pairs of channels .

Do you know if I can calculate the power spectrum and cross spectrum only for prestimulus period or only to the poststimulus period ?

This is the script that I am using :

cfg            = [];
cfg.output     = 'powandcsd';
cfg.method     = 'mtmfft';
cfg.foilim     = [5 100];
cfg.pad        ='nextpow2';
cfg.tapsmofrq  = 5;
cfg.keeptrials = 'yes';
cfg.trials     = [1] ;
freq          = ft_freqanalysis(cfg, data );

data have the structured as the output of ft_preprocessing.
When I want to select only the prestimulus or post stimulus period I am using :
cfg = [];
cfg.latency = [-0.2 0] ;
data_pre = ft_selectdata(cfg,data) ;

% select only the post stimulus period 0:0.2
cfg = [] ;
cfg.latency = [0 0.5];
data_post = ft_selectdata(cfg,data) ;

Thank you in advance!

Kind regards,
Chris

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210429/4d81246b/attachment.htm>


More information about the fieldtrip mailing list