bemobil_mne.preproc.compute_zapline#
- bemobil_mne.preproc.compute_zapline(raw, noise_freqs, method='adaptive', n_remove=1, threshold=3.0, adaptive_params=None)[source]#
Remove spectral line noise from EEG using ZapLine (DSS-based).
Operates on EEG channels only; all other channel types are left untouched (except for the
"adaptive"and"zapline"methods, which operate on the full raw object viamne_denoise.zapline.ZapLine).- Parameters:
- raw
mne.io.Raw Continuous EEG recording.
- noise_freqs
float| array_like |"europe"|"usa"|None One or more frequencies (Hz) to remove (e.g.
50or[50, 100]). Accepts the string shortcuts"europe"(50/100/150 Hz) and"usa"(60/120/180 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. Automatically detects noise harmonics. Loops over each entry in noise_freqs (or runs once withline_freq=Nonewhen noise_freqs isNone). Requiresmne_denoise."zapline"Standard (non-adaptive) ZapLine via
mne_denoise.zapline.ZapLinewithadaptive=False. Loops over each entry in noise_freqs. Requiresmne_denoise."dss_line"Single-pass DSS via
meegkit.dss.dss_line(). Loops over each entry in noise_freqs. Requiresmeegkit."dss_line_iter"Iterative DSS via
meegkit.dss.dss_line_iter(). Loops over each entry in noise_freqs. Requiresmeegkit.
- n_remove
int Number of DSS components to remove at each frequency. Only used by
"dss_line"and"dss_line_iter". Default1.- threshold
float Detection threshold for the mne-denoise methods (
"adaptive"and"zapline"). Passed as the threshold argument tomne_denoise.zapline.ZapLine. Default3.0.- adaptive_params
dict|None Extra keyword arguments forwarded to
mne_denoise.zapline.ZapLinewhenmethod="adaptive". Useful for controllingprocess_harmonics,n_iterations, etc.Noneuses defaults.
- raw
- Returns:
- raw_clean
mne.io.Raw Copy of raw with line noise attenuated.
- raw_clean