pyriemann.utils.covariance.coherence(X, window=128, overlap=0.75, fmin=None, fmax=None, fs=None, coh='ordinary')

Compute squared coherence.

Xndarray, shape (n_channels, n_times)

Multi-channel time-series.

windowint, default=128

The length of the FFT window used for spectral estimation.

overlapfloat, default=0.75

The percentage of overlap between window.

fminfloat | None, default=None

The minimal frequency to be returned.

fmaxfloat | None, default=None

The maximal frequency to be returned.

fsfloat | None, default=None

The sampling frequency of the signal.

coh{‘ordinary’, ‘instantaneous’, ‘lagged’, ‘imaginary’}, default=’ordinary’

The coherence type, see pyriemann.estimation.Coherences.

Cndarray, shape (n_channels, n_channels, n_freqs)

Squared coherence matrices, for each frequency bin.

freqsndarray, shape (n_freqs,)

The frequencies associated to coherence.