Skip to content

mne-denoise

Tests codecov PyPI version Python versions License Code style: ruff Documentation Downloads

mne-denoise provides artifact-suppression and signal-denoising methods for EEG and MEG, with NumPy and MNE-Python integration.

The package contains several complementary methods for spatial, spectral, statistical, and source-informed denoising. Many methods accept MNE Raw, Epochs, and Evoked objects directly, and sklearn-style estimators are provided where that interface fits the method.

See the user guide and API reference for method selection and exact contracts. Experimental APIs are identified in the documentation.

Installation

Python 3.12 or newer is required.

Base package — pip install mne-denoise

MNE-Python integration — pip install "mne-denoise[mne]"

Visualization (Matplotlib + Seaborn) — pip install "mne-denoise[viz]"

Progress bars (tqdm) — pip install "mne-denoise[progress]"

Quick start

The example assumes that raw is an MNE Raw object loaded with preload=True; install the mne extra to use it.

from mne_denoise.spectrum_interpolation import SpectrumInterpolation

# `raw` is an mne.io.Raw object loaded with preload=True.
# Set line_freq to the mains frequency in your recording.
cleaner = SpectrumInterpolation(line_freq=60.0, n_harmonics=3)
clean_raw = cleaner.fit_transform(raw)

Documentation

Citing

When using mne-denoise in scientific work, cite both the software and the primary publication(s) for the method(s) used in your analysis. See the citation guidance.

Contributing

Contributions are welcome. See CONTRIBUTING.md for the human contribution guide.

License

BSD 3-Clause License. See LICENSE for details.

About

Artifact removal and signal denoising for EEG and MEG.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

31 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages