ERP pipeline · PSYCH 390 step 5 / 11

Filtering

What is a filter and why is it needed?

Figure 1

Effect of High-Pass and Low-Pass Filtering on Noise and on the ERP

raw signal after the filter true ERP hidden in the recording distortion added by the filter

What is mixed into the recording

The filter

Presets
passband noise left after filter ERP distortion MATLAB

Simulated data. Adapted from Luck (2014), Figure 7.1.

What You Are Looking At

Panel A is eight seconds from one EEG channel. A small event-related potential is buried in it four times, two seconds apart, and it is drawn in gold so you can see where it hides. Everything else in the gray trace is noise: a slow wander from sweat and skin potentials, a 60 Hz hum picked up from the room's wiring, high-frequency crackle from jaw and neck muscles, and the brain's own ongoing rhythms. The teal trace is the same recording after the filter.

Panel B shows the same recording as a spectrum: how much of the signal lives at each frequency. Slow drift piles up at the far left, the line noise is the spike at 60 Hz, and muscle noise spreads across the right. The ERP itself occupies roughly 0.1 to 30 Hz. A filter is a rule for how much of each frequency to keep, and the shaded region is the band this filter lets through.

Panel C sets the noise aside and shows only what the filter does to the ERP itself. The gold curve is the true waveform, teal is that same waveform after passing through the filter, and whatever coral shows between them is damage the filter did.

Try This

  1. Slide both cutoffs fully left so they read off. The filter does no damage, but the teal recording in Panel A is swamped by drift and hum, and the noise left after filter readout shows how much would have to be averaged away.
  2. Apply the lab default, 0.1 Hz high-pass and 30 Hz low-pass. Drift and hum vanish from Panel A, and Panel C shows the ERP passing through almost untouched.
  3. Push the high-pass up to 1 or 2 Hz. The slow positive wave late in the trial shrinks, and a negative bump appears before it that was never in the data. Tanner et al. (2015) showed that the high-pass settings used in some language studies produce exactly this spurious N400 in front of a P600.
  4. Push the low-pass down to 5 Hz. The sharp early peaks smear and shrink, and where two of them blend together the apparent peak moves. A zero-phase filter does not itself shift latency; a causal one would. Sharper filtering in frequency always costs precision in time.
  5. Raise the muscle and line sliders until the raw trace is unreadable, then watch how much the 30 Hz low-pass recovers.

Why It Matters for the Pipeline

Averaging removes noise that is random from trial to trial, but it needs many trials to beat slow drift, which changes little within an epoch and so barely cancels, and hum that happens to line up with the stimulus rate. Filters remove those by frequency instead, so a 0.1 Hz high-pass and a 30 Hz low-pass are the first cleaning step in the pipeline. In EEGLAB the two calls are EEG = pop_eegfiltnew(EEG, 0.1, []); and EEG = pop_eegfiltnew(EEG, [], 30);, and spectopo draws a spectrum like the one in Panel B (Delorme & Makeig, 2004).

A filter works by replacing each time point with a weighted average of its neighbors, so it necessarily spreads every feature out in time. A high-pass filter goes further. It subtracts the slow version of the waveform, and that pushes an inverted copy of each component forward and backward in time. That is the source of the artificial negative bump. Luck's rule is to keep the high-pass at or below 0.1 Hz, to apply it only to long stretches of continuous EEG, and to use a low-pass no stronger than plotting or peak measurement needs (Luck, 2014, Chapter 7). The lab applies both to the continuous data; because filtering and averaging are linear this gives the same result as filtering after averaging, and mean amplitude in a 200 ms window needs no low-pass at all. The page uses a smooth filter with a similar slope; pop_eegfiltnew defines its cutoff at half amplitude. Recording clean data comes first, because no filter substitutes for that.

References

Delorme, A., & Makeig, S. (2004). EEGLAB: An open source toolbox for analysis of single-trial EEG dynamics including independent component analysis. Journal of Neuroscience Methods, 134(1), 9–21. https://doi.org/10.1016/j.jneumeth.2003.10.009

Luck, S. J. (2014). An introduction to the event-related potential technique (2nd ed.). MIT Press.

Tanner, D., Morgan-Short, K., & Luck, S. J. (2015). How inappropriate high-pass filters can produce artifactual effects and incorrect conclusions in ERP studies of language and cognition. Psychophysiology, 52(8), 997–1009. https://doi.org/10.1111/psyp.12437