mne_denoise.qa.underclean_proportion#

mne_denoise.qa.underclean_proportion(freqs: ndarray, psd_after: ndarray, target_freq: float, peak_bw: float = 2.0, surround_bw: float = 5.0, threshold_ratio: float = 2.0) float[source]#

Compute the fraction of channels with a residual target peak.

A channel is flagged when noise_surround_ratio exceeds threshold_ratio.

Parameters:
freqsndarray, shape (n_freqs,)

Frequency vector in Hz.

psd_afterndarray, shape (n_freqs,) or (n_channels, n_freqs)

PSD after cleaning.

target_freqfloat

Center frequency in Hz.

peak_bwfloat, default=2.0

Half-width of the target band in Hz.

surround_bwfloat, default=5.0

Half-width of the surrounding bands in Hz.

threshold_ratiofloat, default=2.0

Residual peak ratio threshold.

Returns:
float

Indicator for 1-D input or channel fraction in [0, 1] for 2-D input.

Missing peak power yields an unflagged ratio of zero.