pyriemann.geometry.covariance.coherence¶
- pyriemann.geometry.covariance.coherence(X, window=128, overlap=0.75, fmin=None, fmax=None, fs=None, coh='ordinary')[source]¶
Compute squared coherence.
- Parameters:
- Xndarray, shape (…, n_channels, n_times)
Multi-channel time-series, real-valued.
- windowint, default=128
Length of the FFT window used for spectral estimation.
- overlapfloat, default=0.75
Percentage of overlap between windows.
- fminfloat | None, default=None
Minimal frequency to be returned.
- fmaxfloat | None, default=None
Maximal frequency to be returned.
- fsfloat | None, default=None
Sampling frequency of the time-series.
- coh{“ordinary”, “instantaneous”, “lagged”, “imaginary”}, default=”ordinary”
Coherence type:
“ordinary” for the ordinary coherence, defined in Eq.(22) of [1]; this normalization of cross-spectral matrices captures both in-phase and out-of-phase correlations. However it is inflated by the artificial in-phase (zero-lag) correlation engendered by volume conduction.
“instantaneous” for the instantaneous coherence, Eq.(26) of [1], capturing only in-phase correlation.
“lagged” for the lagged-coherence, Eq.(28) of [1], capturing only out-of-phase correlation (not defined for DC and Nyquist bins).
“imaginary” for the imaginary coherence [2], Eq.(0.16) of [3], capturing out-of-phase correlation but still affected by in-phase correlation.
- Returns:
- Cndarray, shape (…, n_channels, n_channels, n_freqs)
Squared coherence matrices, for each frequency bin.
- freqsndarray, shape (n_freqs,)
Frequencies associated to coherence.
Notes
Added in version 0.2.4.
Changed in version 0.3: Add support for lagged and imaginary coherences.
References
[1] (1,2,3)Instantaneous and lagged measurements of linear and nonlinear dependence between groups of multivariate time series: frequency decomposition R. Pascual-Marqui. Technical report, 2007.
[2]Identifying true brain interaction from EEG data using the imaginary part of coherency G. Nolte, O. Bai, L. Wheaton, Z. Mari, S. Vorbach, M. Hallett. Clinical Neurophysioly, Volume 115, Issue 10, October 2004, Pages 2292-2307
[3]Non-Parametric Synchronization Measures used in EEG and MEG M. Congedo. Technical Report, 2018.