-
Notifications
You must be signed in to change notification settings - Fork 6
Tutorials
After importing your EEG data, go to Edit -> Channel locations to import channel labels/locations.
Make sure that:
- EEG channel labels (e.g. "Fp1", "Fz", etc without any trailing characters)
or
- EEG channel locations (e.g. XYZ coordinates)
are present in the EEG.chanlocs structure.
In this tutorial, we use the example dataset located in the example data folder: ./example data/empirical_NOISE_EOG_EMG.set, which is already prepared with channel location information. The figure below illustrates the EEG signals from this example dataset.
Figure 1. Example data
Launch the GEDAI plugin by selecting it from the menu, then click OK to proceed.
Figure 2. GEDAI graphical user interface
- Denoising strength: Variable determining deartifacting strength.
- "auto" [Default]
- "auto+": Stronger threshold, might remove more noise at the expense of signal
- "auto-": Milder threshold, might retain more signal at the expense of noise.
- Leadfield matrix: Matrix used as a reference for deartifacting.
- "precomputed" [Default]: Use a BEM leadfield for standard electrode locations precomputed through OPENMEEG (343 electrodes) based on 10-5 system.
- "interpolated": uses the precomputed leadfield and interpolates it to non-standard electrode locations.
- Customizing your own covariance matrix: you can input a "custom" covariance matrix (with dimensions channel x channel) via a MATLAB variable; this option is only available when calling the GEDAI function from the command line (see Using the command line).
-
Epoch size [Default:12]: Number of wave cycles for each wavelet band.
-
Low-cut frequency [Default:0.5]: High-passing the data when GEDAI denoising is recommended (e.g. set the low-cut frequency = 0.5 Hz).
-
Reject bad epochs [Default: false]: If you prefer to reject very "bad" epochs during denoising (i.e. prevent GEDAI from cleaning them), they can be removed using their ENOVA (Explained Noise Variance), which is bounded between 0 and 1. The ENOVA is the variance explained of the noise removed by GEDAI, expressed as a proportion of the variance of the original EEG data. The default ENOVA threshold (e.g. 0.9 [Default]) removes epochs with more than 90% noise variance, while a more aggressive ENOVA threshold (e.g. 0.3) would remove all epochs > 30% noise.
-
Parallel processing [Default: true]: Whether to use parallel ('multicore') processing depends on your computer's performance.
-
Artifact visualization [Default: true]: Whether to pop up the plot after preprocessing.
After preprocessing is completed, the EEG signal is displayed automatically if the Artifact visualization is selected. Blue traces represent the cleaned data, whereas red traces correspond to the original signals.
Figure 3. Default output plot in mode superposition
As indicated in the Keyboard shortcuts, the noisy part removed by gedai can be visualized by pressing [d]; to display the original or the cleaned new data, press [o] or [n] respectively; Press [b] to return to the default superposition view, which allows direct comparison between the original and cleaned signals.

Figure 4. Output plots in mode difference/cleaned/original
The SENSAI Score and ENOVA Score are printed in the Command Window. Both scores serve as quantitative measures of denoised data quality. A detailed explanation of these results can be found in our paper.
Figure 5. SENSAI Score and ENOVA Score outputs
The cleaned dataset can be created and saved in EEGLAB data structure via the pop-up window.
Figure 6. pop_newset( ) window
It is simple to use GEDAI from the command line by directly calling the GEDAI() function.
- Example 1: Using all default values (and no bad epoch rejection)
[EEG] = GEDAI(EEG);
- Example 2: Defining some parameters
[EEG] = GEDAI(EEG, 'auto', 12, 0.5, 'precomputed', true, false, 0.9);
- Example 3: Using a "custom" [channel x channel] reference matrix
[EEG] = GEDAI(EEG, 'auto', 12, 0.5, your_refCOV);
More information can be found in the ./GEDAI.m