mne_denoise.qa.below_noise_distortion_db#
- mne_denoise.qa.below_noise_distortion_db(freqs: ndarray, psd_before: ndarray, psd_after: ndarray, exclude_freq: float | None = None, exclude_bw: float = 5.0, fmin: float = 1.0, fmax: float = 45.0, n_harmonics: int = 0) ndarray[source]#
Compute mean absolute log-power distortion outside excluded bands.
The metric is the mean of abs(10 * log10(psd_after / psd_before)) over the selected frequency mask; lower values indicate less broadband change.
- Parameters:
- freqsndarray, shape (n_freqs,)
Frequency vector in Hz.
- psd_before, psd_afterndarray, shape (n_freqs,) or (n_channels, n_freqs)
PSDs before and after cleaning.
- exclude_freqfloat or None, default=None
Fundamental frequency whose harmonics are excluded.
- exclude_bwfloat, default=5.0
Half-width of each excluded band in Hz.
- fmin, fmaxfloat, default=1.0, 45.0
Inclusive frequency range in Hz.
- n_harmonicsint, default=0
Additional harmonics to exclude.
- Returns:
- float or ndarray
Scalar for 1-D input, otherwise one value per channel. An empty mask returns zero; before-power is floored at 1e-30.