mne_denoise.ssa.ssa_clean_channel#

mne_denoise.ssa.ssa_clean_channel(x: ndarray, sfreq: float, window_length: int | None = None, drop_freq_max: float = 3.0, drop_band: tuple[float, float] | None = None, n_check: int | None = None, max_window: int = 100, *, window_seconds: float | None = None, return_info: bool = False) ndarray | tuple[ndarray, dict[str, Any]][source]#

Clean one channel by grouping Basic SSA components by frequency.

Parameters:
  • x (array-like, shape (n_times,)) – Finite scalar time series.

  • sfreq (float) – Sampling frequency in Hz.

  • window_length (int | None, default=None) – Embedding dimension in samples. If None, it is selected automatically.

  • drop_freq_max (float, default=3.0) – Reject components whose dominant frequency is at or below this value in Hz. Ignored as a selection bound when drop_band is supplied.

  • drop_band (tuple of float | None, default=None) – Inclusive (low, high) dominant-frequency rejection band in Hz.

  • n_check (int | None, default=None) – Restrict selection to this many leading numerical-rank components. None examines every numerical-rank component.

  • max_window (int, default=100) – Maximum embedding dimension used by automatic window selection.

  • window_seconds (float | None, default=None) – Embedding duration in seconds, mutually exclusive with window_length.

  • return_info (bool, default=False) – If True, also return decomposition and grouping diagnostics.

Returns:

  • x_clean (ndarray, shape (n_times,)) – Cleaned time series.

  • info (dict) – Returned only when return_info=True. Contains reconstructed components, singular values, dominant frequencies, rejected component indices and frequencies, the reconstructed artifact, and the resolved embedding information.

Raises:
  • TypeError – If a scalar parameter has an invalid type.

  • ValueError – If the time series, frequency bounds, or embedding is invalid.

See also

compute_basic_ssa

Apply the same rule independently across channels.

ssa_decompose

Return the complete additive decomposition.

Notes

Dominant frequency is the maximum-magnitude bin of an n_times-point real FFT. DC is included and ties select the lower-frequency bin. This grouping rule and its thresholds are mne-denoise choices rather than defining steps of Basic SSA. A broadband component can therefore be classified by a narrow peak, and decisions near a threshold depend on the FFT resolution sfreq / n_times.