bemobil_mne.preproc.detect_bad_by_line_noise#

bemobil_mne.preproc.detect_bad_by_line_noise(raw, noise_freqs, z_thresh=4.0)[source]#

Detect channels with abnormally high line noise power.

For each channel, computes the ratio of power in a narrow band around each noise frequency to broadband power (1-100 Hz), then z-scores across channels. Channels whose z-score exceeds z_thresh at any noise frequency are returned as bad.

Parameters:
rawmne.io.Raw

Recording (should already have average reference applied).

noise_freqsarray_like

Line noise frequencies (Hz) to check.

z_threshfloat

Z-score threshold for flagging a channel as bad.

Returns:
bad_by_noiselist of str

Channel names with elevated line noise.