cogpy.spectral.bivariate
Bivariate spectral measures: cross-spectrum, coherence, PLV.
Status
STATUS: ACTIVE Reason: Multitaper cross-spectral measures for iEEG connectivity analysis. Superseded by: n/a Safe to remove: no
Design
All functions operate on pre-computed tapered FFTs (mtfft) rather than raw signals. The caller computes mtfft once via multitaper_fft() and passes it to whichever measures are needed — avoiding redundant FFT computation when multiple measures are derived from the same data.
- Tapered FFT convention (from multitaper_fft):
mtfft : (…, taper, freq) complex128
Connectivity functions take two mtfft arrays (x and y) with matching shapes except possibly in leading batch dims. All measures average across the taper axis (-2) to produce estimates with K degrees of freedom, where K = number of tapers.
- Output shapes:
cross_spectrum : (…, freq) complex coherence : (…, freq) real [0, 1] plv : (…, freq) real [0, 1] mtm_fstat : (…,) real (scalar per channel)
Functions
|
Multitaper magnitude squared coherence (MSC). |
|
Lag at peak cross-correlation between signals x and y. |
|
Peak cross-correlation between signals x and y. |
|
Multitaper cross-spectral density estimate. |
|
Multitaper F-statistic test for a sinusoidal component at f0. |
|
Phase-Amplitude Coupling (PAC) via Modulation Index (Tort et al. 2010). |
|
Phase Locking Value (PLV) via multitaper estimates. |
|
Spectral Granger causality between signals x and y. |