[FieldTrip] Single-trial time-frequency connectivity

Julian Keil julian.keil at gmail.com
Mon Dec 7 17:10:01 CET 2020


Dear Daniel,

as far as I know, coherence is only defined across trials (i.e. how similar is the phase across trials), so it does not make sense to only use one trial.
What was your goal in looking at the single trial level?

Best,

Julian


> Am 07.12.2020 um 16:37 schrieb <daniel.strahnen at uni-ulm.de> <daniel.strahnen at uni-ulm.de>:
> 
> 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
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip <https://mailman.science.ru.nl/mailman/listinfo/fieldtrip>
> https://doi.org/10.1371/journal.pcbi.1002202 <https://doi.org/10.1371/journal.pcbi.1002202>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20201207/72c3cc2c/attachment.htm>


More information about the fieldtrip mailing list