Skip to content

Frequently Asked Questions (FAQ)

Tomas Ros edited this page May 28, 2026 · 43 revisions

GEDAI Denoising: Frequently Asked Questions (FAQ)

Welcome to the GEDAI Denoising FAQ. This page addresses common questions regarding pipeline integration, parameter tuning, data formatting, and downstream analysis based on the GEDAI preprint and community discussions.

Table of Contents


1. Preprocessing Pipeline & Integration

Q: Where does GEDAI fit into a standard EEG preprocessing pipeline?

A: For best results, GEDAI should be applied to continuous, lightly preprocessed data. A recommended pipeline for resting-state or ERP analysis looks like this:

  1. Load channel labels or locations.
  2. Remove non-brain channels (EOG, ECG, etc.).
  3. Downsample.
  4. Band-pass filter (and apply dedicated line noise removal if needed).
  5. Apply GEDAI.
  6. Extract epochs.

Q: GEDAI does not do a good job at denoising my EEG data. What could be going wrong?

A: If the denoising does not sufficiently remove artifacts, try the more aggressive auto+ option and see if you get a higher SENSAI score (comparing the SENSAI score within the same recording is justified). If the denoising removes genuine brain signals (e.g. oscillations), try with the milder auto- setting.

If GEDAI removes generally all of the EEG data, this could indicate a problem with the channel locations/labels (you can check them using Plot -> Channel locations -> By name).

Finally, if GEDAI fails repeatedly independent of threshold setting, it might indicate a rarer case of EEG cap or head model 'misalignment', where the EEG electrodes have not been placed near the standard 10-5 system locations represented by their labels/locations and/or the head model is misspecified (i.e. check your leadfield matrix).

Q: Should I remove or interpolate bad channels before running GEDAI?

A: Removing bad channels is not strictly necessary beforehand because GEDAI performs its own intrinsic component based noisy channel correction based on a theoretical Boundary Element Method (BEM) leadfield, which performs comparably to classic spherical interpolation. You can run automated bad channel rejection before GEDAI if you wish (GEVD is quite robust to rank reduction), but it is often easier to skip it if there are less than 20% bad channels. Otherwise, run channel rejection, followed by GEDAI, then apply channel interpolation.

Q: How does GEDAI handle line noise? Should I use tools like ZapLine?

A: While GEDAI can handle line noise, its upper wavelet frequencies are quite wide-band and might "wash out" narrow-band noise, occasionally leaving residual line noise. Using a dedicated line-noise removal tool like ZapLine (or notch-filtering) before running GEDAI is highly recommended, as both methods complement each other (and both are based on generalized eigenvalue decomposition).

Q: Do I need to re-reference my data before or after GEDAI?

A: GEDAI automatically re-references your input data to an Average Reference (using Makoto's non-rank-deficient scheme). This is required because GEDAI's precomputed leadfield matrix is average-referenced. You technically do not need to re-reference before GEDAI, but you can obviously do so after cleaning.

Q: Does GEDAI require a minimum number of EEG channels or a specific electrode montage?

A: There is no specific montage required. It has been tested with data ranging from low channel counts (10 channels) to high-density EEG (256 channels). However, for complex non-stationary noise, the fewer channels you have, the worse GEDAI will perform (because there are fewer GED components available to be removed within a single denoising epoch). 6 channels is really the minimum, and with this number, the denoising will be less than optimal.

Q: What if I have an asymmetric montage or missing electrodes?

A: GEDAI maps your actual electrode layout to its theoretical leadfield. Unless you have a severe asymmetry (e.g., an entirely missing hemisphere), GEDAI should still function relatively well. Denoising accuracy is generally more impacted by critically low spatial coverage than by spatial asymmetry.


2. Data Structure, Epoching & Memory Management

Q: What does the Sliding window option do?

A: By default, GEDAI optimizes a single, fixed artifacting threshold across the entire recording. While convenient, this assumes the EEG remains stationary. The Sliding window option dynamically adapts the denoising thereshold to account for slow physiological and environmental changes over time (such as sleep stage transitions, changes in cognitive or clinical states). Instead of running a single global optimization, GEDAI partitions the recording into overlapping temporal windows of your specified size (e.g., 20-60 seconds).

Q: Where can I access the denoising metrics and other internal GEDAI parameters after processing?

A: All denoising metrics, thresholds, and signal-quality scores are automatically saved directly into your dataset within the EEG.etc.GEDAI field. This structure serves as a comprehensive "flight recorder" for the entire denoising process.

Inside EEG.etc.GEDAI, you will find the Explained Noise Variance (ENOVA) and SENSAI scores broken down per epoch, channel, and frequency band, allowing you to easily identify which specific data segments were the most heavily contaminated. It also logs the exact sliding thresholds dynamically calculated by the algorithm over time.

Additionally, this structure contains your data rejection statistics. Most notably, the samples_to_keep field provides a binary mask array indicating exactly which time-points were retained and which were discarded. This may be useful if you need to perfectly synchronize other continuous data streams (like ECG or eye-tracking) with your newly pruned EEG data.

Finally, the visualization_metrics field stores the detailed Subspace Similarity and Silhouette scores used to generate the SENSAI 2D scatter plots.

Q: GEDAI runs out of memory on my computer with long datasets. What should I do?

A: Memory overhead multiplies significantly when parallel processing is enabled. If you are working with longer recordings (e.g., >15 minutes), turn off Parallel processing (set to false or untick the GUI box) and/or enable Sliding window processing (e.g. 20 seconds). Although slower, processing with sliding windows in a single run without parallelization should prevent out-of-memory errors, even on datasets several hours long.


3. Filtering, Wavelets & Sampling Rates

Q: What sampling rate is ideal for GEDAI?

A: High original sampling rates (e.g., 1000 Hz) require more wavelet levels to accurately reach low frequencies. For optimal memory consumption and speed, it is recommended to downsample your data to 200–250 Hz. This ensures that a standard 8-level wavelet decomposition provides enough band-range for the low-frequency bands (below 5 Hz) and allows for accurate drift removal. Because wavelet decomposition is dyadic (dividing the Nyquist frequency in half consecutively), the exact Hz bounds will shift slightly depending on your sampling rate.

Q: If I band-pass filter my data beforehand, how should I configure the lowcut_frequency?

A: If your data's high-pass frequency is already higher than GEDAI's default lowcut_frequency [Default: 0.5 Hz], simply leave the parameter at 0.5 Hz. GEDAI uses a built-in 0.1 Hz high-pass to zero-center the data for covariance estimation. The lowcut_frequency acts to ensure a reliable data covariance matrix (lower frequencies require much longer data windows). If the upper bound of a wavelet band falls below your lowcut_frequency, GEDAI forces that band to exactly zero.

Q: Why isn't there a "high-cut frequency" parameter?

A: Because GEDAI uses a dyadic wavelet decomposition, high-frequency bands are very wide and cannot cleanly resolve a specific prior cut-off (like 40 Hz). For simplicity, GEDAI processes all higher frequencies. If you want to restrict high frequencies, simply low-pass filter your data prior to running GEDAI.


4. Core Parameters & Thresholding

Q: What does the "Epoch size" parameter in GEDAI mean?

A: The Epoch size [Default: 12] in the GEDAI parameters refers strictly to the denoising window (the number of wavelet cycles for each wavelet band) used by the algorithm. It has nothing to do with your experimental EEG epochs.

Q: What minimum recording duration do you recommend for GEDAI when using the default setting of 12 wavelet cycles?

A: As a general rule, the EEG recording should be >30 seconds. However, the minimum recording length depends on the number of wavelet_cycles AND the low_cut_frequency (i.e., wavelet_cycles * 1 / low_cut_frequency). Since the epoch duration (in seconds) is dependent on wavelet frequency, the minimum recording length is essentially constrained by the epoch duration of the lowest wavelet band (i.e., the one with the lowest frequency and longest period).

The GEDAI output provides you with the epoch size (in seconds) for all the wavelet bands. If the largest epoch size (pertaining to the lowest wavelet frequency) exceeds the recording length, then the low_frequency will be raised automatically and all the wavelet coefficients below that frequency will be simply zeroed rather than GEDAI "denoised."

Q: If I have a very short recording (e.g., 12 seconds), what parameter adjustments are needed? Is it scientifically acceptable to reduce the number of wavelet cycles?

A: Yes, it is scientifically acceptable; this is a tunable parameter. To reduce the longest epoch size for a short recording, your best option is to reduce the number of wavelet_cycles (e.g., to 6 or even 2–4 cycles). For a wavelet lower frequency of 1 Hz, 4 cycles would be equivalent to 4 seconds. A lower number of cycles also allows GEDAI to capture "sharper" artifacts in time.

Q: Is there a minimum number of epochs or windows required for reliable SENSAI threshold estimation?

A: The mathematical minimum is 1 epoch, but it is best to use > 4 epochs for reliable estimation.

Q: How should I set the Denoising Strength?

A: It is best to use the adaptive, SENSAI-based options:

  • auto [Default]: Balanced threshold.
  • auto+: Stronger threshold (removes more noise, may sacrifice some signal).
  • auto-: Milder threshold (retains more signal, may leave some noise).

Note: If you want finer control, newer versions of GEDAI (v1.5) allow decimal inputs for threshold strength (0 to 10) available through the command-line. (for reference: auto- = 4, auto = 7, auto+ = 8.5).

Q: Should I use the "Reject bad epochs" (ENOVA) feature?

A: This is optional [Default: false]. It prevents GEDAI from trying to clean potentially "irrecoverable" bad data segments (for example, if most electrodes lost contact with the scalp during movement). It uses the Explained Noise Variance (ENOVA) metric. A threshold of 0.9 completely rejects segments defined by >90% noise variance removed by GEDAI, while an aggressive 0.3 removes segments with >30% noise.

Q: What if I would like to run GEDAI with a "custom" reference covariance matrix (e.g. derived from empirical data or another leadfield)?

A: You can do this using the command line with a custom [channel x channel] reference matrix predefined in a MATLAB workspace variable (e.g., your_custom_refCOV):

[EEG] = GEDAI(EEG, 'auto', 12, 0.5, your_custom_refCOV);


5. Post-Processing & Downstream Analysis

Q: Is it safe to perform 1/f, connectivity, cross-frequency coupling, or microstate analysis on GEDAI-cleaned data?

A: Yes. While GEDAI relies on a theoretical leadfield of independent sources, GEDAI acts strictly as a spatial filter. It identifies artifacts based on spatial signatures (channel covariance) and removes them. Temporal dynamics—such as 1/f characteristics and correlated brain signals—are allowed to vary freely and are preserved. Thus, you can consider GEDAI being more like 'spatial' ICA (which does not enforce temporal independence, commonly used in fMRI) rather than "temporal" ICA (which enforces temporal but not spatial independence).

Q: Is it necessary or valid to run ICA after GEDAI?

A: ICA is technically not required. However, running it after GEDAI (e.g., alongside IClabel) is a valid sanity check to remove any potentially residual ocular or muscular artifacts. Because GEDAI reduces rank locally epoch-by-epoch, you might wonder about ICA's reliability—but in practice, there is typically more than enough rank left in the data to validly identify main artifact components.

Q: How can I measure how much the data was changed by GEDAI?

A:

  • mean ENOVA: An absolute metric. It represents the variance of the removed noise expressed as a proportion of the original EEG data's variance. It effectively tells you the percent "noise" removed (i.e. how noisy the original recording was).
  • SENSAI score: A relative metric of EEG quality after denoising indicating the "goodness of fit" between the denoised data and the theoretical leadfield matrix (higher is better), though this can vary between recordings and montages.

Q: Can I visualize the individual GED artifact components?

A: Since GEDAI denoises individual epochs (which can be of sub-second duration), visualizing individual components would cause information overload, as GED generates thousands of them (e.g., a 60-channel, 100-second recording with a 1-second epoching window would yield 6,000 components). Instead, it is better to analyze the discarded noise data (the second output of GEDAI) by looking at its power spectrum or running ICA (e.g.IClabel) on the discarded data to see what independent components it contains.

Q: How do I interpret the "SENSAI visualization: Subspace Similarity vs Epoch Power" output figure?

image

A: This figure visually summarizes how effectively GEDAI separated genuine brain activity (signal) from artifacts (noise) by comparing the spatial patterns of your data to a theoretical brain model.

Here is a breakdown of how to read the plots and metrics:

  • The Axes:

    • Y-axis (SSI - Subspace Similarity Index): This measures how closely the spatial topography of an epoch matches the theoretical brain model (the BEM leadfield). A value closer to 1.0 (marked by the dashed yellow line) indicates the activity is highly likely to be originating from the brain.
    • X-axis (Epoch Power in dB): This represents the amplitude or strength of the signal in that specific time window. Artifacts often (but not always) have higher power than resting brain activity.
  • Left Panel (Before Denoising): This displays your raw EEG epochs prior to cleaning. The color gradient corresponds to the SSI score (yellow/green is more brain-like, blue/purple is less brain-like). You will typically see a wide spread of data here, where epochs with high power and low SSI are clear indicators of prominent, non-brain artifacts (like blinks or gross muscle movement).

  • Right Panel (After Denoising): This illustrates the core separation achieved by the algorithm, dividing the data into two distinct clusters (along with density distribution curves on the top and right borders):

    • Green dots (Signal): These are the components GEDAI identified as genuine brain activity and kept. Notice how they cluster tightly near the 1.0 line, indicating high spatial similarity to the brain leadfield.
    • Red dots (Noise): These are the artifact components GEDAI removed. They generally exhibit lower similarity to the brain leadfield and are often scattered across a wider range of power levels.
  • Sub-optimal Denoising Outcomes:

    • Noise-in-the-Signal: The Red (Noise) cluster contains some Green (Signal) dots (i.e. under-cleaning, "noise" components were missclassified as "signal")
    • Signal-in-the-Noise: The Green (Signal) cluster contains some Red (Noise) dots (i.e. over-cleaning, "signal" components were missclassified as "noise")
  • Key Metrics:

    • SSI Silhouette Score: This is a clustering metric that evaluates how cleanly separated the "Signal" (green) and "Noise" (red) groups are along the SSI axis. A score close to 1.0 (e.g., 0.97) represents excellent, distinct separation, meaning the algorithm confidently isolated artifacts from brain signals.
    • Mean SSSI (Signal Subspace Similarity Index): The average similarity score of the retained brain data (you want this to be high).
    • Mean NSSI (Noise Subspace Similarity Index): The average similarity score of the rejected artifact data (you generally expect this to be much lower than the SSSI).

Clone this wiki locally