This is a collaborative space. In order to contribute, send an email to maximilien.chaumon@icm-institute.org
On any page, type the letter L on your keyboard to add a "Label" to the page, which will make search easier.

A warning about filters

Filters are often used to remove unwanted artifacts from the MEEG signal.

They are used for:

  • smoothing time courses for display purposes (low pass filters)
  • Removing DC offsets, and/or stabilizing the signal before running an ICA (high pass filters)
  • Removing line noise (50 Hz)

Filtering is a complex topic that has a literature of itself. We refer the interested reader to comprehensive reviews (Widmann, et al. 2015) or book chapters (Cohen 2016). But since filtering is part of almost every preprocessing pipeline, an important warning is in order:

Be aware that filters smear signal in time.

[Below  is an excerpt from VanRullen 2011]

 

While [filtering] is mostly harmless for studies interested in the amplitude or even the latency of specific ERP peaks (in technical terms, because these filters have “zero phase-lag”), it can be extremely problematic when assessing the precise timing and dynamics of brain processes. Indeed, because of the width of the filters used, the EEG correlates of a given neuronal event will be smeared out in time for several tens or even hundreds of milliseconds before and after the event.

The image here shows the dangers of filtering. 50 trials of a “fake” EEG signal were simulated. Activity is null until the “onset” of a neural process, occurring at a random time between 150 and 180 ms (uniform distribution), after which activity is set to 1. Gaussian-distributed noise (mean 0 and SD of 0.05) is added to all signals. In the top panel, the original trials are stacked vertically and the EEG amplitude is color-coded. The middle panel represents the same trials after low-pass filtering with a 30-Hz cut-off (using the function eegfilt from the EEGLAB software, and its default parameters). The bottom panel illustrates the corresponding ERPs. The red ∗ symbols on the horizontal axis indicate the moments at which the filtered ERPs depart from zero. Even though, by design, the process under study never started before 150 ms, its EEG correlates are detected with latencies as early as 100 ms!


 

Filters shift signal at different frequencies by different amounts

Take 2Hz high pas butterworth filter. It will attenuate the amplitude of the signal below 2Hz (on the right: Amplification panel), but also shift phases depending on the frequency, up to a much larger frequency (on the right: Phase panel). Hence a signal at 3 Hz will be phase shifted by 100 ms, a signal at 5 Hz by 34 ms and a signal at 20 Hz by 2 ms.

Thus a composite signal made of coupled theta (4Hz) - gamma (40Hz) oscillations will seem out of phase due to differential phase shift at different frequencies in the signal, as illustrated below.

Yael et al. 2018: very clear paper on the topic.

From Yael et al. 2018.

Take home message: DO NOT FILTER when interested in onset latencies of brain processes unless you know exactly what you're doing (Rousselet 2012).

Yael, D., Vecht, J. J., & Bar-Gad, I. (2018). Filter-Based Phase Shifts Distort Neuronal Timing Information. Eneuro, 5(2), ENEURO.0261-17.2018. https://doi.org/10.1523/ENEURO.0261-17.2018 

Cohen, M. X. (2014). Analyzing neural time series data: theory and practice. MIT Press. TOC Chapter 10 and following ones.

Rousselet, G. A. (2012). Does Filtering Preclude Us from Studying ERP Time-Courses? Frontiers in Psychology, 3.PDF
VanRullen, R. (2011). Four Common Conceptual Fallacies in Mapping the Time Course of Recognition. Frontiers in Psychology, 2. PDF
Widmann, A., Schröger, E., & Maess, B. (2015). Digital filter design for electrophysiological data – a practical approach. Journal of Neuroscience Methods, 250(Supplement C), 34–46. PDF