mne_denoise.dss.variants.time_shift_dss#
- mne_denoise.dss.variants.time_shift_dss(shifts: int | ndarray = 10, *, method: str = 'autocorrelation', n_components: int | None = None, **dss_kws) DSS[source]#
Create a DSS configured for temporal predictability.
Returns a pre-configured DSS object that extracts components with high autocorrelation (temporally smooth or predictable signals).
- Parameters:
shifts (int or array-like) – If int, use lags from 1 to shifts. If array, use specified lag values in samples. Default 10.
method (str) – Method for constructing bias: - ‘autocorrelation’: Average of shifted versions (default) - ‘prediction’: Weighted average (closer lags weighted more)
n_components (int, optional) – Number of DSS components to keep. If None, keep all.
**dss_kws – Additional keyword arguments passed to DSS.
- Returns:
dss – A DSS object configured with a TimeShiftBias.
- Return type:
Examples
>>> # Extract temporally predictable components >>> dss = time_shift_dss(shifts=20) >>> dss.fit(data) >>> slow_sources = dss.transform(data)
>>> # Use specific lags >>> dss = time_shift_dss(shifts=np.array([1, 2, 5, 10, 20])) >>> dss.fit(data)