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

Sebastian Sauppe sauppe.s at gmail.com
Mon Jan 6 15:42:34 CET 2025


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




More information about the fieldtrip mailing list