[FieldTrip] Single-trial time-frequency connectivity
daniel.strahnen at uni-ulm.de
daniel.strahnen at uni-ulm.de
Mon Dec 7 16:37:20 CET 2020
Dear FieldTrip-Community,
Is it possible to calculate time-frequency coherence on a single trial?
When using the configuration below it works perfectly when including all
trials, but if I specify cfg_conn.trials = 1 then I receive an error.
I went through the code and found that data.cumtapcnt does not have the
usual dimensions (ntrials x nfreq) but now is changed to (nfreq x 1).
Since I don't want to mess up the FieldTrip-code I wanted to ask if there is
a solution to this problem?
cfg = [];
cfg.output = 'fourier';
cfg.channel = channels;
cfg.method = 'wavelet';
cfg.foi = 1:1:48;
cfg.t_ftimwin = 20./cfg.foi;
cfg.toi = 1:0.01:12;
cfg.width = 3;
cfg.keeptrials = 'yes';
freq_data = ft_freqanalysis(cfg, data);
cfg_conn = [];
cfg_conn.method = 'coh';
cfg_conn.trials = 1;
coh_str = ft_connectivityanalysis(cfg_conn, freq_data);
Error:
Index in position 1 exceeds array bounds (must not
exceed 1).
Error in ft_checkdata>fixcsd (line 966)
tmpdat =
transpose(data.fourierspctrm(indx,:,m,k));
Error in ft_checkdata (line 693)
data = fixcsd(data, cmbrepresentation,
channelcmb);
Error in univariate2bivariate (line 63)
data = ft_checkdata(data,
'cmbrepresentation', 'full');
Error in ft_connectivityanalysis (line 398)
[data, powindx, hasrpt] =
univariate2bivariate(data,
'fourierspctrm', 'crsspctrm', dtype,
'cmb', cfg.channelcmb, 'keeprpt',
normrpt);
Thank you and best regards
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20201207/bd10df5d/attachment.htm>
More information about the fieldtrip
mailing list