ffrprep.analysis.response_consistency

ffrprep.analysis.response_consistency(epochs, tmin=None, tmax=None, picks='eeg')[source]

Compute trial-to-trial response consistency from an MNE Epochs object.

This function measures how similar individual brain response trials are to each other by computing pairwise Pearson correlations between epochs and averaging those correlations.

Parameters:
  • epochs (mne.Epochs) – Epoched EEG/FFR data containing individual trials.

  • tmin (float, optional) – Start time in seconds for the analysis window. If None, uses the start of the epoch.

  • tmax (float, optional) – End time in seconds for the analysis window. If None, uses the end of the epoch.

  • picks (str or list, optional) – Channels to include. Default is “eeg”.

Returns:

  • mean_r (float) – Mean pairwise correlation across trials.

  • r_vals (ndarray) – Array of all pairwise trial-to-trial correlation values.

  • Example usage

  • ————-

  • mean_r, r_vals = response_consistency( – epochs, tmin=0.05, tmax=0.20, picks=[“Cz”]

  • )