[FieldTrip] TRF before defining trials
philip Joadavi
p.joadavi at gmail.com
Thu Nov 18 21:41:33 CET 2021
Dear all,
I have continuous EEG data and I would like to first compute the
time-frequency analysis to avoid any boundary effects etc, and then define
my trials.
so I want to do the following:
1- time frequency analysis
2- define trials
3- average over TRF trials
4- average over subjects
However, after defining the trials, my 3dimential data becomes 2
dimensional. I would like to know if there is any function in FieldTrip
that I can use to keep the trial dimension as it is?
I would also like to know how can I get the average over my TRF over trials
and subjects with the same dimension.
here is the code I'm using:
cfg = [];
cfg.trials = 'all';
cfg.channel = 'EEG';
cfg.output = 'pow';
cfg.method = 'mtmconvol';
cfg.taper = 'hanning';
cfg.pad = 'nextpow2';
cfg.keeptrials = 'yes';
cfg.foi = 10:.5:40;
cfg.toi = data.time{1};
cfg.t_ftimwin = 0.5*ones(size(cfg.foi));
df{t} = ft_freqanalysis(cfg,data);
--------
cfg = [];
cfg.fsample = fsample;
cfg.trialdef.prestim = preStim ; % sec
cfg.trialdef.poststim = postStim ; % sec
cfg.trialdef.events = data.trial{1}(e,:);
cfg.trialfun = 'eegTrialFun';
cfg.trialdef.eventvalue = eventValue;
cfg.keeptrials = 'yes';
cfg = ft_definetrial(cfg);
----------
cfg.trials = 'all';
d = ft_redefinetrial(cfg,df{t});
Thanks a lot!
Philip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20211118/521fff22/attachment.htm>
More information about the fieldtrip
mailing list