pybemobil.preproc.remove_line#
- pybemobil.preproc.remove_line(raw, noise_freqs, method='adaptive', method_kwargs=None)[source]#
Remove spectral line noise from EEG using ZapLine (DSS-based).
Operates on EEG channels only; all other channel types are left untouched, for every method.
- Parameters:
- raw
mne.io.Raw Continuous EEG recording.
- noise_freqs
float|"europe"|"usa"|None Fundamental line-noise frequency in Hz (e.g.
50). Every method removes the fundamental together with all its harmonics below Nyquist, so harmonics must not be passed. Accepts the string shortcuts"europe"(50 Hz) and"usa"(60 Hz). Formethod="adaptive"you may passNoneto let ZapLine-plus auto-detect line-noise frequencies.- method
str Algorithm to use. One of:
"adaptive"(default)ZapLine-plus via
mne_denoise.zapline.ZapLinewithadaptive=True. Auto-detects the noise frequency when noise_freqs isNone. Requiresmne_denoise."zapline"Standard (non-adaptive) ZapLine via
mne_denoise.zapline.ZapLinewithadaptive=False. Requiresmne_denoise."dss_line"Single-pass DSS via
meegkit.dss.dss_line(). Requiresmeegkit."dss_line_iter"Iterative DSS via
meegkit.dss.dss_line_iter(). Requiresmeegkit.
- method_kwargs
dict|None Extra keyword arguments forwarded to the backend of the chosen method:
mne_denoise.zapline.ZapLinefor"adaptive"and"zapline"(e.g.threshold,adaptive_params),meegkit.dss.dss_line()(e.g.nremove,nfft) ormeegkit.dss.dss_line_iter()(e.g.n_iter_max). They override this function’s defaults. The sampling and line frequencies are set from raw and noise_freqs and cannot be passed here.Noneuses defaults.
- raw
- Returns:
- raw_clean
mne.io.Raw Copy of raw with line noise attenuated.
- raw_clean