mne_denoise.dss.VarianceMaskDenoiser#

class mne_denoise.dss.VarianceMaskDenoiser(window_samples: int = 100, percentile: float = 75.0, *, soft: bool = True)[source]#

Local-variance mask for iterative DSS.

The local variance is computed from moving means of the source and its square. A percentile threshold produces either a sigmoid soft mask or a binary mask.

Parameters:
window_samplesint, default=100

Window length for local variance; values below 3 are set to 3.

percentilefloat, default=75.0

Local-variance percentile used as the mask threshold.

softbool, default=True

Use a sigmoid gain when true, otherwise use a binary threshold mask.

denoise(source: ndarray) ndarray[source]#

Apply variance-based masking to a source time series.

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

Source time series. Two-dimensional input is processed one epoch at a time.

Returns:
denoisedndarray, same shape as source

Source weighted by the local-variance mask.