[FieldTrip] ft_connectivityanalysis for PPC gives the same value for each channel combination

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Mon Jan 6 20:22:07 CET 2025


Hi Sebastian,

I don’t fully understand why you aim to do a time-resolved spectral decomposition in this case.

PPC needs ‘observations’ across which to compute the consistency of the phase difference. If you cut the data with ft_redefinetrial, each of the smaller segments will have its own time axis, which are non-overlapping per design. The spectral decomposition maps the phase/amplitude estimates of the signals onto ‘unique’ time points, and the PPC computation machinery by consequence has only a single observation to play with. Thus: unexpected results.



Best wishes,
Jan-Mathijs



> On 6 Jan 2025, at 15:42, Sebastian Sauppe via fieldtrip <fieldtrip at science.ru.nl> wrote:
>
> Dear FieldTrip community,
>
> I am trying to calculate pairwise phase consistency in an EEG dataset but I am encountering an error. I hope that you may be able to help me see what is going wrong. When calculating PPC values with ft_connectivityanalysis, I get the exact same value for each channel combination and frequency.
>
> Here is what I am trying to do:
>
> My EEG data consists of long trials (2-3 minutes, participants listening to audio books) and for each trial, I want to get PPC values so that I can analyse them later in R (mixed models). Thus, I thought I would loop through all long trials and calculate the PPC individually.
>
> First, I extract each trial and then split it into pseudo-trials of 3 seconds length each:
>
> % extract one trial
>            cfg = [];
>            cfg.trials = t;
>            EEG_FT_redef = ft_selectdata(cfg, EEG_FT);
> % split into 3s pseudo-trials
>            cfg = [];
>            cfg.length = 3;
>            cfg.overlap = 0;
>            EEG_FT_redef = ft_redefinetrial(cfg, EEG_FT_redef);
>
> Then, I calculate the PPC values like this:
>
> % Time-frequency analysis
>            cfg = [];
>            cfg.method = 'mtmconvol';
>            cfg.output = 'fourier';
>            cfg.foi = 2:0.5:5;
>            cfg.toi = 0:0.05:3;
>            cfg.t_ftimwin = 1 ./ cfg.foi;
>            cfg.taper = 'hanning';
>            cfg.keeptrials = 'yes';
>            freq_data = ft_freqanalysis(cfg, EEG_FT_redef);
>
>     % Connectivity analysis (PPC)
>            cfg = [];
>            cfg.method = 'ppc';
>             conn_data = ft_connectivityanalysis(cfg, freq_data);
>
> My idea was that by splitting the long trials into pseudo-trials, the latter can be averaged in the connectivity analysis to get the PPC and that by this I would have PPC values for each long audiobook trial.
>
> The problem is now that all the values that are returned are exactly the same (e.g., -0.0270). If I do not execute the first steps (ft_selectdata and ft_redefinetrial), then the values are different, looking realistic.
>
> What am I doing wrong here?
>
> I already confirmed that ft_redefinetrial yields separate trials (e.g., making 38 trials of 3 seconds out of 1 long trial):
>
> EEG_FT_redef =
>
>  struct with fields:
>
>          elec: [1×1 struct]
>       fsample: 1000
>         label: {1×65 cell}
>           cfg: [1×1 struct]
>         trial: {1×38 cell}
>          time: {1×38 cell}
>     trialinfo: [38×16 table]
>    sampleinfo: [38×2 double]
>
> I would be very grateful for any hint!
>
> Kind regards,
> Sebastian
>
>
> _______________________________________________
> fieldtrip mailing list
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C3b7e04b0688c44919f9c08dd2e87692f%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638717881288983469%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=0%2BosFsqab6e4PAp%2BJjMn6ZhVJ5JU9Dz7OGhU2VUbdNs%3D&reserved=0
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C3b7e04b0688c44919f9c08dd2e87692f%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638717881289009257%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=kwigixoIOI6Ph%2Fv9axQaD6VBe0wwJGrhOlCa02DDvUA%3D&reserved=0




More information about the fieldtrip mailing list