EEG Magnitude Squared Coherence

Calculate magnitude-squared coherence at one frequency as |Pxy|²/(Pxx × Pyy) from caller-estimated auto and cross spectra. The spectra must use the same units and estimator; no FFT or averaging is performed.

Description

Magnitude-squared coherence relates a cross spectrum to two auto spectra at a frequency.

Magnitude-squared coherence relates a cross spectrum to two auto spectra at a frequency. Compatible upstream spectral estimation defines what this normalized measure represents.1, 2

Calculate magnitude-squared coherence at one frequency as |Pxy|²/(Pxx × Pyy) from caller-estimated auto and cross spectra. The spectra must use the same units and estimator; no FFT or averaging is performed.

When to use EEG Magnitude Squared Coherence

Use this tool to calculate magnitude-squared coherence at one frequency as |Pxy|²/(Pxx × Pyy) from caller-estimated auto and cross spectra. The spectra must use the same units and estimator; no FFT or averaging is performed.

Prepare the task-specific rates, comparable response-time means, identified spike train, processed ERP or estimated spectra requested. Confirm units, preprocessing, sample pairing and caller-fitted model coefficients.

How to use EEG Magnitude Squared Coherence and understand its results

  1. Prepare the task-specific rates, comparable response-time means, identified spike train, processed ERP or estimated spectra requested. Confirm units, preprocessing, sample pairing and caller-fitted model coefficients.
  2. Enter autoSpectrumX, autoSpectrumY, crossSpectrumReal, crossSpectrumImaginary using the field table and calculation rules, then run the tool.
  3. Read coherence. The explanation below defines the units, signs, ordering and any flags or placeholder values.
  4. If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
Input fieldMeaningValue type; see rules belowRequirement
autoSpectrumXPositive auto spectrum of the first signal.number; strictly above: 0Required
autoSpectrumYPositive auto spectrum of the second signal.number; strictly above: 0Required
crossSpectrumRealReal part of the cross spectrum.numberRequired
crossSpectrumImaginaryImaginary part of the cross spectrum.numberRequired

Enter positive auto spectra and finite signed real/imaginary cross components in consistent units from the same estimator. Normalize using ordered square roots and hypot to limit intermediate overflow. Reject normalized magnitude above 1+32×Number.EPSILON; cap accepted tiny overshoot to one.

coherence=(crossReal²+crossImaginary²)/(autoX×autoY)

Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.

Output fieldMeaningValue type
coherenceMagnitude-squared coherence.number; minimum: 0; maximum: 1
json
{
  "input": {
    "autoSpectrumX": 4,
    "autoSpectrumY": 9,
    "crossSpectrumReal": 3,
    "crossSpectrumImaginary": 0
  },
  "output": {
    "coherence": 0.25
  }
}

Limitations and assumptions

No raw signal, FFT, averaging, significance test or causal interpretation is supplied. Inconsistent spectra are input errors rather than coherence above one.

Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.

Alternative or Complementary methods

Use Phase Locking Value: Calculate PLV as the magnitude of the mean unit phasor for supplied paired phase differences in radians. No phase extraction, filtering, or bias correction is performed. For a complementary task, use EEG Alpha Band Power: Integrate supplied uniform PSD bins by sum(PSD × binWidth), selecting centers in [8, 12) Hz under the MNE band convention. The upper endpoint is excluded and unprovided frequencies contribute no power; no FFT or clinical interpretation is performed.

Further background: Magnitude-squared coherence.

References

  1. EEG Magnitude Squared Coherence — tool.io

  2. Magnitude-squared coherence — SciPy

Similar or alternative tools

  • Phase Locking Value

    Calculate PLV as the magnitude of the mean unit phasor for supplied paired phase differences in radians. No phase extraction, filtering, or bias correction is performed.

  • EEG Alpha Band Power

    Integrate supplied uniform PSD bins by sum(PSD × binWidth), selecting centers in [8, 12) Hz under the MNE band convention. The upper endpoint is excluded and unprovided frequencies contribute no power; no FFT or clinical interpretation is performed.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies