Skip to main content
Ctrl+K
This project is in early development, and has not yet reached a stable version Use for testing only.

gedai

  • GEDAI
  • Install
  • API References
  • GEDAI Tutorials
  • License
  • Development
  • GEDAI
  • Install
  • API References
  • GEDAI Tutorials
  • License
  • Development

Section Navigation

  • Basics: Understanding GEDAI Models
    • Understanding the GEDAI model
    • Understanding the multiband extension of GEDAI
    • Understanding the adaptive extension of multiband GEDAI
  • Practical Pipelines
    • Recommended Offline EEG Denoising Pipeline
  • Advanced Workflows
    • Using GEDAI for online (real-time) denoising
    • GEDAI forward
  • GEDAI Tutorials
  • Practical Pipelines
  • Recommended Offline EEG Denoising Pipeline

Note

Go to the end to download the full example code.

Recommended Offline EEG Denoising Pipeline🔗

This tutorial provides a practical, end-to-end offline denoising workflow using GEDAI on EEG data.

The pipeline is intentionally simple:

  1. Apply a broadband Gedai model to remove large artifacts.

  2. Apply AdaptiveMultibandGedai for frequency-specific refinement.

Use this tutorial as a template and adapt only the data-loading block and parameter values for your own dataset.

from mne.io import read_raw

from gedai import AdaptiveMultibandGedai, Gedai
from gedai.data import get_contaminated_eeg_set_path
from gedai.viz import plot_mne_style_overlay_interactive

n_jobs = -1
raw = read_raw(str(get_contaminated_eeg_set_path()), preload=True)

Preprocessing GEDAI will automatically apply an average reference before fitting or transforming the data. If your acquisition used a different reference, consider adding the missing reference channel beforehand to preserve the rank of your data. For example, if your data was recorded with a Cz reference, you can add a virtual Cz channel as follows: raw.add_reference_channels("Cz", copy=False).

High-pass filtering before GEDAI usually improves covariance estimation by reducing slow drifts and non-stationarities.

raw.filter(l_freq=0.5, h_freq=None, n_jobs=n_jobs)
General
Filename(s) SNR=0.35481 contamination=25 clean_EEG_dataset_2.set + EOG_EMG_NOISE_dataset_1.set
MNE object type RawEEGLAB
Measurement date Unknown
Participant Unknown
Experimenter Unknown
Acquisition
Duration 00:01:00 (HH:MM:SS)
Sampling frequency 200.00 Hz
Time points 12,000
Channels
EEG
Head & sensor digitization 30 points
Filters
Highpass 0.50 Hz
Lowpass 100.00 Hz


Broadband GEDAI🔗

broadband_gedai = Gedai()
broadband_gedai.fit_raw(raw, noise_multiplier=6.0, n_jobs=n_jobs)
broadband_denoised_raw = broadband_gedai.transform_raw(
    raw, n_jobs=n_jobs, verbose=False
)

Adaptive Multiband GEDAI🔗

adaptive_multiband_gedai = AdaptiveMultibandGedai(
    wavelet_type="haar", wavelet_level=5, cycles_per_wavelet=10
)
adaptive_multiband_gedai.fit_raw(
    broadband_denoised_raw, noise_multiplier=3.0, n_jobs=n_jobs
)
adaptive_multiband_denoised_raw = adaptive_multiband_gedai.transform_raw(
    broadband_denoised_raw, n_jobs=n_jobs, verbose=False
)

Since GEDAI algorithm automatically set the reference to average, you can reset the reference to the original channel after denoising to preserve the original reference scheme: adaptive_multiband_denoised_raw.set_eeg_reference(ref_channels="Cz", copy=False)

Visualize the results

plot_mne_style_overlay_interactive(raw, adaptive_multiband_denoised_raw, duration=15.0)
00 gedai offline pipeline
(<Figure size 1200x1750 with 1 Axes>, <Axes: xlabel='Time (s)', ylabel='Channels'>)

Total running time of the script: (3 minutes 29.926 seconds)

Estimated memory usage: 361 MB

Download Jupyter notebook: 00_gedai_offline_pipeline.ipynb

Download Python source code: 00_gedai_offline_pipeline.py

Download zipped: 00_gedai_offline_pipeline.zip

Gallery generated by Sphinx-Gallery

previous

Practical Pipelines

next

Advanced Workflows

On this page
  • Broadband GEDAI
  • Adaptive Multiband GEDAI

© Copyright 2026, Neurotuning.

Built with the PyData Sphinx Theme 0.19.0.