mne_denoise.dss.denoisers.QuasiPeriodicDenoiser#
- class mne_denoise.dss.denoisers.QuasiPeriodicDenoiser(peak_distance: int = 100, peak_height_percentile: float = 75.0, *, warp_length: int | None = None, smooth_template: bool = True)[source]#
Quasi-periodic denoiser via cycle averaging.
For signals with repeating structure (ECG, respiration, periodic artifacts): 1. Detect peaks/cycles in the source 2. Segment into individual cycles 3. Time-warp cycles to common length 4. Average to create template 5. Replace each cycle with time-warped template
- Parameters:
peak_distance (int) – Minimum distance between peaks in samples. Default 100.
peak_height_percentile (float) – Percentile of signal for peak detection threshold. Default 75.
warp_length (int, optional) – Length to warp each cycle to. If None, use median cycle length.
smooth_template (bool) – If True, smooth the template. Default True.
Examples
>>> # For ECG-like signal at 250 Hz (peaks ~1 sec apart) >>> from mne_denoise.dss.denoisers import QuasiPeriodicDenoiser >>> denoiser = QuasiPeriodicDenoiser(peak_distance=200) >>> denoised = denoiser.denoise(ecg_source)
References
Särelä & Valpola (2005). Section 4.1.4 “DENOISING OF QUASIPERIODIC SIGNALS”
- __init__(peak_distance: int = 100, peak_height_percentile: float = 75.0, *, warp_length: int | None = None, smooth_template: bool = True) None[source]#
Methods
__init__([peak_distance, ...])denoise(source)Apply quasi-periodic denoising.