mne_denoise.qa.peak_attenuation_db#

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

Compute peak attenuation around a target frequency.

The metric is 10 * log10(max(psd_before) / max(psd_after)) within the selected band; positive values indicate attenuation.

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.

target_freqfloat

Center frequency in Hz.

bandwidthfloat, default=2.0

Half-width of the search band in Hz.

Returns:
float or ndarray

Scalar for 1-D PSD input, otherwise one value per channel. Empty bands return NaN; after-power is floored at 1e-30.