EEG preprocessing, step by step, and where the order matters

Preprocessing turns a raw recording into clean, labelled trials. There is a conventional order, a few places where it genuinely matters, and many where labs reasonably disagree.

Updated

There is no single correct EEG preprocessing pipeline. Different paradigms need different filters, and two well-run labs can order their steps differently and both be right. What is not optional is knowing what each step did and being able to say so. Most irreproducible EEG results come from a preprocessing choice nobody wrote down.

Below is the conventional order, with the reason for each step and the points where reordering changes the result.

The conventional order

#StepWhy
1Import and inspectConfirm sampling rate, channel names, montage and event markers before changing anything.
2Bandpass filterRemove slow drifts and high-frequency noise. Common ranges: 0.1–40 Hz for ERPs, 1–40 Hz before ICA, 8–30 Hz for motor imagery.
3Line-noise removalNotch at 50 or 60 Hz (and harmonics) if the bandpass does not already exclude it.
4Bad channel detectionDrop flat, railing or noisy electrodes before they contaminate re-referencing and ICA.
5Re-referenceAverage reference or another scheme suited to the montage and question.
6ICA artifact removalSeparate and remove blink, eye-movement, cardiac and muscle components.
7EpochingCut trials around events with a window suited to the response.
8Baseline correctionSubtract or normalise against a pre-stimulus window.
9Trial rejectionDrop trials still contaminated after cleaning.

Where the order genuinely matters

  • Bad channels before average reference

    A dead or noisy channel in the average spreads its noise into every other channel.

  • Bad channels before ICA

    A railing channel can consume components and degrade the decomposition.

  • High-pass before ICA

    Slow drifts hurt ICA. A common approach is to fit ICA on a 1 Hz high-passed copy and apply the solution to the less filtered data.

  • Normalisation and the split

    Anything fitted to the data, including scalers, CSP and feature selection, must be fitted inside the training folds, or the evaluation leaks.

How BCILattice runs it

Filtering is the one pre-analysis stage, and the Analysis Suite's Prepare section covers the rest: ICA Review, Channel Quality, Epoching (with baseline correction and automatic or fixed-threshold rejection), Normalization and Augmentation. The sidebar shows the conventional order, and the steps can be dragged into a different one. Some labs screen channels before ICA and others after, and the app remembers your order.

Every step reads a named stage and writes a new one, so nothing overwrites the recording and two settings can be compared side by side. A Methods button drafts a publication methods paragraph from what the recording has actually had done to it.

Questions

What are the steps of EEG preprocessing?

Typically: inspect the data, bandpass filter, remove line noise, detect and drop bad channels, re-reference, remove artifacts with ICA, epoch around events, apply baseline correction, and reject remaining bad trials.

Should I filter before or after ICA?

Before. ICA works better on data without slow drifts, so a high-pass of around 1 Hz is common before fitting ICA. The ICA solution can then be applied to data filtered less aggressively.

Which reference should I use for EEG?

The average reference is a common default for dense montages. Linked mastoids or a specific electrode are common in some ERP traditions. Choose by paradigm and montage, and report it.

How do I preprocess EEG without coding?

Use a graphical tool. BCILattice runs filtering, ICA review, channel quality, epoching, baseline correction and rejection as visual steps, previewed on one file and then applied in batch to the rest.

Read the reference

Related

Run a study end to end, on your own machine

The free plan covers two studies, the full analysis suite, and 118 of the 119 ML blocks.