mne_denoise.ssa.local_ssa_clean_channel#

mne_denoise.ssa.local_ssa_clean_channel(x: ndarray, window_length: int | None = None, *, window_seconds: float | None = None, sfreq: float | None = None, n_clusters: int | str = 'auto', max_clusters: int = 10, max_window: int = 100, random_state: int | None = 0, return_info: bool = False) ndarray | tuple[ndarray, dict[str, Any]][source]#

Clean one channel with clustered local SSA reconstruction.

Parameters:
xarray-like, shape (n_times,)

Finite scalar time series.

window_lengthint | None, default=None

Delay-vector dimension in samples; None selects it automatically.

window_secondsfloat | None, default=None

Delay-vector duration in seconds, requiring sfreq and mutually exclusive with window_length.

sfreqfloat | None, default=None

Sampling frequency in Hz.

n_clustersint or “auto”, default=”auto”

Number of delay-vector clusters, or automatic reliable selection.

max_clustersint, default=10

Upper bound for automatic cluster selection.

max_windowint, default=100

Maximum automatic delay-vector dimension.

random_stateint | None, default=0

Seed passed to k-means.

return_infobool, default=False

If True, also return clustering and reconstruction diagnostics.

Returns:
x_cleanndarray, shape (n_times,)

Residual after subtracting the local-subspace reconstruction.

infodict

Diagnostics returned only when return_info=True.

Notes

Delay vectors are clustered, projected onto the cluster-specific MDL-selected subspaces, and reconstructed by anti-diagonal averaging. Genuine structure matching the selected subspaces can also be removed. [1].

References