mne_denoise.dss.QuasiPeriodicDenoiser#

class mne_denoise.dss.QuasiPeriodicDenoiser(peak_distance: int = 100, peak_height_percentile: float = 75.0, *, warp_length: int | None = None, smooth_template: bool = True)[source]#

Cycle-template denoiser for quasi-periodic source signals.

Peaks are detected on the absolute source using the configured percentile and minimum-distance rule. The resulting cycles are rescaled to a common duration, averaged into a template, optionally smoothed, and mapped back to each cycle with its original length and amplitude scaling. The reconstructed cycle structure is returned; fewer than three detected peaks leave the source unchanged.

Parameters:
peak_distanceint, default=100

Minimum peak distance in samples; values below 10 are set to 10.

peak_height_percentilefloat, default=75.0

Percentile used as the absolute-source peak threshold.

warp_lengthint or None, default=None

Common cycle length. None uses the median detected cycle length.

smooth_templatebool, default=True

Smooth the averaged template with a uniform filter.

denoise(source: ndarray) ndarray[source]#

Apply the cycle-template denoiser.

Parameters:
sourcendarray, shape (n_times,) or (n_times, n_epochs)

One source or sources arranged by columns.

Returns:
ndarray

Reconstructed source with the input shape.