mne_denoise.qa.suppression_ratio#

mne_denoise.qa.suppression_ratio(freqs: ndarray, psd_before: ndarray, psd_after: ndarray, target_freq: float, bandwidth: float = 2.0) float[source]#

Suppression ratio (dB) of mean band power around a target frequency.

Parameters:
  • freqs (array of shape (n_freqs,)) – Frequency vector.

  • psd_before (ndarray) – PSDs before and after cleaning.

  • psd_after (ndarray) – PSDs before and after cleaning.

  • target_freq (float) – Center frequency (Hz).

  • bandwidth (float) – Half-bandwidth (Hz).

Returns:

ratio_db – Suppression ratio in dB.

Return type:

float

Notes

For 2D PSD input, channels are averaged first. The ratio is computed from mean power in the selected band:

10 * log10(mean_before / mean_after)

Examples

>>> import numpy as np
>>> from mne_denoise.qa import suppression_ratio
>>> freqs = np.arange(0, 100, 0.5)
>>> before = np.ones_like(freqs)
>>> after = before * 0.1
>>> suppression_ratio(freqs, before, after, 50.0)
10.0