Skip to main content

Coherence

Namespace: CONNECTIVITYLIB  ·  Library: Connectivity Library

Python equivalent

mne_connectivity.spectral_connectivity_epochs (method='coh') in MNE-Python.

#include <connectivity/coherence.h>

class CONNECTIVITYLIB::Coherence

Computes magnitude-squared coherence between every pair of channels.

The actual cross-spectral and auto-spectral accumulation is shared with Coherency; this class only wraps the absolute-value branch and exposes a single calculate entry point that returns a Network whose edge weights are the band-averaged |coherency|^2 values in [0, 1].

Magnitude-squared coherence estimator (symmetric, sensitive to zero-lag coupling).

src/examples/ex_connectivity_metrics/main.cpp
Network coherence = Coherence::calculate(settings);
coherence.setFrequencyRange(8.0f, 12.0f);
const double coh01 = edgeWeight(coherence, 0, 1);
const double coh02 = edgeWeight(coherence, 0, 2);

Inheritance​


Public Methods​

Coherence()​

Constructs a Coherence object.


Static Methods​

calculate(connectivitySettings)​

Calculates the coherence between the rows of the data matrix.

Parameters:

Returns:

  • Network — The connectivity information in form of a network structure.

Example​

Used in examples​

ex_connectivity_metrics​

Connectivity metrics on synthetic data with a known coupling.

src/examples/ex_connectivity_metrics/main.cpp, line 176
Network coherence = Coherence::calculate(settings);
coherence.setFrequencyRange(8.0f, 12.0f);
const double coh01 = edgeWeight(coherence, 0, 1);
const double coh02 = edgeWeight(coherence, 0, 2);
ok &= expect(coh01 > coh02 + 0.3, QString("COH 0-1 %1 > 0-2 %2 + 0.3").arg(coh01).arg(coh02));

Authors of this file​