mne_denoise.dss.denoisers.SpectrogramBias#

class mne_denoise.dss.denoisers.SpectrogramBias(mask: ndarray, nperseg: int = 256, noverlap: int | None = None)[source]#

Linear spectrogram bias (Section 4.1.3).

Applies a FIXED time-frequency mask to the data. This is a linear operation used to define the signal subspace in the initialization or linear DSS step.

Parameters:
  • mask (ndarray, shape (n_freqs, n_times)) – The fixed 2D mask to apply. Must be provided for linear biasing.

  • nperseg (int) – Segment length for STFT. Default 256.

  • noverlap (int, optional) – Overlap between segments. Default nperseg // 2.

Examples

>>> import numpy as np
>>> from mne_denoise.dss.denoisers import SpectrogramBias
>>> mask = np.ones((128, 1000))
>>> bias = SpectrogramBias(mask)
>>> data = np.random.randn(128, 1000)
>>> biased = bias.apply(data)

See also

SpectrogramDenoiser

Adaptive nonlinear version.

References

Särelä & Valpola (2005). Section 4.1.3 “SPECTROGRAM DENOISING”

__init__(mask: ndarray, nperseg: int = 256, noverlap: int | None = None) None[source]#

Methods

__init__(mask[, nperseg, noverlap])

apply(data)

Apply fixed spectrogram mask to all channels.