mne_denoise.dss.SpectrogramBias#

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

Fixed STFT-mask bias for DSS.

Parameters:
maskndarray, shape (n_freqs, n_times)

Time-frequency mask. It is resized with nearest-neighbour interpolation when its shape differs from the computed STFT.

npersegint, default=256

STFT segment length.

noverlapint or None, default=None

Number of overlapping samples. None uses nperseg // 2.

Notes

Two-dimensional channel-first input is processed channel by channel. For three-dimensional input, each (n_channels, n_times) epoch is processed separately.

apply(data: ndarray) ndarray[source]#

Apply a fixed spectrogram mask to all channels.

Parameters:
datandarray, shape (n_channels, n_times) or (n_channels, n_times, n_epochs)

Channel-first data. Three-dimensional input is processed one epoch at a time.

Returns:
biasedndarray, same shape as data

Data reconstructed after applying the time-frequency mask.