mne_denoise.sns.compute_sns#

mne_denoise.sns.compute_sns(X: ndarray, n_neighbors: int = 0, skip: int = 0, *, rcond: float = 1e-12, preserve_mean: bool = False, n_iter: int = 1, outlier_threshold: float | None = None, chunk_size: int | None = None, sample_weight: ndarray | None = None, callback=None, verbose: bool | str | int | None = None) tuple[ndarray, dict[str, Any]][source]#

Learn and apply Sensor Noise Suppression to channel-first data.

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

Continuous or epoched data.

n_neighborsint, default=0

Number of neighbors per channel; zero uses all available neighbors.

skipint, default=0

Number of most-correlated neighbors to omit.

rcondfloat, default=1e-12

Relative pseudoinverse cutoff.

preserve_meanbool, default=False

Add the fitted channel means after regeneration.

n_iterint, default=1

Number of SNS projections to compose.

outlier_thresholdfloat or None, default=None

Robust channel-wise z-score threshold for samples used during fitting.

chunk_sizeint or None, default=None

Samples per covariance/application chunk.

sample_weightndarray or None, shape (n_times,) or (n_epochs, n_times)

Non-negative fitting weights.

callbackcallable or None, default=None

Synchronous callback after each channel solve.

verbosebool, str, int, or None, default=None

Logging level.

Returns:
X_cleanndarray

Data with the same shape as X.

infodict

Fitted operators and diagnostics.

Notes

SNS reconstructs each channel from spatially redundant signals in other channels using the channel covariance. It targets noise specific to individual sensors rather than a source or artifact shared across the array. With centered data, the learned operator is applied in channel space [1].

References