meegkit.sns#

Sensor noise suppression.

Functions

sns(X[, n_neighbors, skip, weights])

Sensor Noise Suppression.

sns0(c[, n_neighbors, skip, wc])

Sensor Noise Suppression from data covariance.

sns1(X[, n_neighbors, skip])

Sensor Noise Suppression 1.

meegkit.sns.sns(X, n_neighbors=0, skip=0, weights=array([], dtype=float64))#

Sensor Noise Suppression.

This algorithm will replace the data from each channel by its regression on the subspace formed by the other channels. The underlying assumptions are that (a) sensor noise is uncorrelated across sensors, and (b) genuine signal is correlated, sensor noise is removed and genuine signal is preserved.

Parameters:
  • X (array, shape=(n_times, n_chans, n_trials)) – EEG data.

  • n_neighbors (int) – Number of neighbors (based on correlation) to include in the projection.

  • skip (int) – Number of closest neighbors to skip (default=0).

  • weights (array of floats) – Weights (default=all ones).

Returns:

  • y (array, shape=(n_times, n_chans, n_trials)) – Denoised data.

  • r (array, shape=(n_chans, n_chans)) – Denoising matrix.

meegkit.sns.sns0(c, n_neighbors=0, skip=0, wc=array([], dtype=float64))#

Sensor Noise Suppression from data covariance.

Parameters:
  • c (array, shape=(n_chans, n_chans)) – Full covariance of data to denoise.

  • n_neighbors (int) – Number of neighbors (based on correlation) to include in the projection.

  • skip (int) – Number of closest neighbors to skip (default=0).

  • wc (array) – Weighted covariance.

Returns:

r – Denoising matrix.

Return type:

arraym

meegkit.sns.sns1(X, n_neighbors=None, skip=0)#

Sensor Noise Suppression 1.

This version of SNS first regresses out major shared components.