mne_denoise.qa.overclean_proportion#

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

Fraction of channels where the spectral floor is over-suppressed.

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) – Centre frequency (Hz) of the line-noise peak.

  • bandwidth (float) – Half-bandwidth (Hz) used for peak identification.

  • threshold_db (float) – Attenuation threshold in dB.

Returns:

proportion – Value in [0, 1].

Return type:

float

Notes

A channel is flagged as over-cleaned when attenuation in the surrounding floor region exceeds threshold_db.

Examples

>>> import numpy as np
>>> from mne_denoise.qa import overclean_proportion
>>> freqs = np.arange(0, 100, 0.5)
>>> psd = np.ones((4, len(freqs)))
>>> overclean_proportion(freqs, psd, psd, 50.0)
0.0