mne_denoise.sound.SOUND#

class mne_denoise.sound.SOUND(*, lambda_: float = 0.1, n_iter: int = 5, tol: float | None = None, forward=None, reference: str = 'best', sigma_source: str = 'evoked', n_dipoles: int = 5000, random_state=None, verbose: bool | str | int | None = None)[source]#

SOUND estimator for source-informed noise suppression.

SOUND estimates channel noise levels and fits a forward-model-based linear operator. For compatible EEG MNE input with a montage, a spherical lead field is built when no forward solution is supplied. MEG or mixed-channel MNE input and NumPy input require an explicit forward solution.

Parameters:
lambda_float, default=0.1

Non-negative regularization scale.

n_iterint, default=5

Maximum number of iterations.

tolfloat or None, default=None

Convergence tolerance; None runs n_iter iterations.

forwardmne.Forward or None, default=None

Optional explicit forward solution. For compatible EEG MNE input with a montage, None uses a spherical fallback; MEG or mixed-channel MNE input and NumPy input require an explicit forward.

reference{“best”, “average”}, default=”best”

Reference handling. “best” selects a low-noise single-channel reference and reconstructs an average-referenced output; “average” uses all channels and assumes average-referenced input.

sigma_source{“evoked”, “trials”}, default=”evoked”

For epoched data, estimate noise from the trial average or concatenated trials.

n_dipolesint, default=5000

Number of dipoles for the spherical lead field.

random_stateint, numpy.random.Generator, or None, default=None

Random state for channel-update order.

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

Logging level.

Attributes:
leadfield_ndarray

Lead field used during fitting.

operator_ndarray

Fitted channel-space cleaning operator.

sigmas_ndarray

Estimated channel noise amplitudes.

best_channel_int or None

Selected reference channel, or None for reference=”average”.

convergence_ndarray

Relative noise-level change by iteration.

See also

mne_denoise.sns.SNS

Spatial-redundancy sensor-noise suppression without a lead field.

compute_sound

All-channel SOUND functional interface.

compute_sound_ref_best

Best-reference SOUND functional interface.

Notes

NumPy input is (n_channels, n_times) or (n_epochs, n_channels, n_times). MNE Raw, Epochs, and Evoked inputs are supported and returned without mutation [1][2].

References

Examples

A preloaded MNE Raw object with a compatible EEG montage can use the spherical fallback lead field:

from mne_denoise.sound import SOUND

model = SOUND(reference="best")
clean = model.fit_transform(raw)
fit(X, y=None, *, callback=None, verbose: bool | str | int | None = None)[source]#

Fit the SOUND cleaning operator.

Parameters:
Xndarray, Raw, Epochs, or Evoked

Data used to estimate channel noise and the operator.

yNone, default=None

Ignored for scikit-learn compatibility.

callbackcallable or None, default=None

Synchronous iteration callback.

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

Logging level.

Returns:
SOUND

The fitted estimator.

fit_transform(X, y=None, *, callback=None, verbose: bool | str | int | None = None)[source]#

Fit SOUND and transform the input.

Parameters:
Xndarray, Raw, Epochs, or Evoked

Data to fit and transform.

yNone, default=None

Ignored for scikit-learn compatibility.

callbackcallable or None, default=None

Synchronous fitting callback.

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

Logging level.

Returns:
same type as X

Cleaned data.

transform(X, *, verbose: bool | str | int | None = None)[source]#

Apply the fitted SOUND operator.

Parameters:
Xndarray, Raw, Epochs, or Evoked

Data with the fitted channel layout.

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

Logging level.

Returns:
same type as X

Cleaned data; MNE inputs are copied and NumPy inputs are not mutated.