Filter Effects and Filter Artifacts in the Analysis of Electrophysiological Data
Total Page:16
File Type:pdf, Size:1020Kb
GENERAL COMMENTARY published: 09 July 2012 doi: 10.3389/fpsyg.2012.00233 Filter effects and filter artifacts in the analysis of electrophysiological data Andreas Widmann* and Erich Schröger Institute of Psychology, University of Leipzig, Leipzig, Germany *Correspondence: [email protected] Edited by: Guillaume A. Rousselet, University of Glasgow, UK Reviewed by: Rufin VanRullen, Centre de Recherche Cerveau et Cognition, France Lucas C. Parra, City College of New York, USA A commentary on unity gain at DC (the step response never FILTER EFFECTS VS. FILTER ARTIFACTS returns to one). These artifacts are due to a We also recommend to distinguish between Four conceptual fallacies in mapping the known misconception in FIR filter design in filter effects, that is, the obligatory effects time course of recognition EEGLAB1. The artifacts are further ampli- any filter with equivalent properties – cutoff by VanRullen, R. (2011). Front. Psychol. fied by filtering twice, forward and back- frequency, roll-off, ripple, and attenuation 2:365. doi: 10.3389/fpsyg.2011.00365 ward, to achieve zero-phase. – would have on the data (e.g., smoothing With more appropriate filters the under- of transients as demonstrated by the filter’s Does filtering preclude us from studying estimation of signal onset latency due to step response), and filter artifacts, that is, ERP time-courses? the smoothing effect of low-pass filtering effects which can be minimized by selection by Rousselet, G. A. (2012). Front. Psychol. could be narrowed down to about 4–12 ms of filter type and parameters (e.g., ringing). 3:131. doi: 10.3389/fpsyg.2012.00131 in the simulated dataset (see Figure 1 and Appendix for a simulation), that is, about an CAUSAL FILTERING In a recent review, VanRullen (2011) con- order of magnitude smaller than assumed. In a commentary on VanRullen, Rousselet cludes that electrophysiological data should (2012) suggested to use “causal” filtering to not be filtered at all when one is interested SIGNAL-TO NOISE RATIO solve the problem of signal onset latency in the temporal dynamics or onset latencies The signal-to-noise ratio chosen by underestimation due to smoothing. This is of the electrophysiological responses. This VanRullen for the simulated dataset is a valid recommendation, which has already conclusion was based on the observation implausibly high (+26 dB at single trial been given (e.g., Luck, 2005). However, it that response onset latency was “smeared level, +43 dB averaged) as signal-to-noise should have been made explicit that the sug- out in time for several tens or even hun- ratios smaller than one are common in real gested type of “causal” filtering comes at the dreds of milliseconds” (p. 6) in a simulated electrophysiological data. This assumption cost of a distortion of phase information also dataset. biases the conclusion on the detectability with FIR filters (cf., Figure A1 in Appendix). It is correct that any band limitation in of the signal without filtering and overesti- The causality in filtering is not directly the frequency domain necessarily affects mates the impact of filter ringing artifacts. related to the symmetry of filter coefficients the signal in the time domain resulting At more realistic signal-to-noise ratios as implied in Figure 1 in Rousselet’s (2012) in reduced precision and artifacts (cf. no significant impact of the filter arti- comment. That is, the FIR filter labeled “non- e.g., Luck, 2005). Nevertheless, here, we facts is observed (but only effects of tran- causal” can also be applied in a causal way by will discuss that the problem is overesti- sient smoothing by low-pass filtering; see not compensating the filter’s delay (by not mated by about an order of magnitude by Figure 1 and Appendix). The precision that filtering the signal backward and not “left- the assumptions and analysis parameters can be achieved in the measurement of the shifting” the signal by the group delay). In used in VanRullen’s simulated dataset and response onset latency is limited by signal- order to reduce this filter delay in causal fil- advertise the cautious usage of carefully to-noise ratio. Thus, the trade-off between tering, asymmetric “causal” FIR filters, more designed filters to be able to also detect filter effects versus the signal-to-noise ratio often referred to as minimum-phase filters, small signals. gain by filtering must be considered. can be used. However, as FIR filter coef- FILTER SELECTION The filter selected in VanRullen’s simulation 1The EEGLAB “Basic FIR filter” function is based on the firls (least square fitting of FIR coefficients) MATLAB function (in the current version 11.0.2.1b as of writing this commentary). Filter length is defined independently was a bad choice as it results in artifacts not of transition-band width. This can result in various adverse effects from sub-optimal stop-band attenuation, related to filtering per se. The FIR filter gen- over filter artifacts, to leakage in the transition-band (the infamous “band-pass filter bug”). The problem is incre- erated by EEGLAB (Delorme et al., 2011) ased by the property of the firls function that transition-bands are defined as “do not care” regions. In a warning with default settings exhibits excessive filter message it is announced in the current EEGLAB version that firls based filters are no longer recommended and fir1 should be used instead and will be the default setting in a future version. In its current implementation this ringing (cf., Figure A1 in Appendix), and change will not solve the problem as filter length and transition-band width are still defined independently. The excessive pass-band ripple including non- filter actually generated by the fir1 function will deviate from the requested and reported transition-band width. www.frontiersin.org July 2012 | Volume 3 | Article 233 | 1 Widmann and Schröger Filter effects and filter artifacts +26 dB SNR +6 dB SNR -14 dB SNR 50 50 50 40 40 40 d 30 30 30 Trial 20 20 20 Unltere 10 10 10 0 0.05 0.1 0.15 0.2 0 0.05 0.1 0.15 0.2 0 0.05 0.1 0.15 0.2 50 50 50 40 40 40 30 30 30 Trial 20 20 20 10 10 10 Gaussian ltered 0 0.05 0.1 0.15 0.2 0 0.05 0.1 0.15 0.2 0 0.05 0.1 0.15 0.2 0.1 0.1 0.1 Unltered EEGLAB rls Windowed sinc Discrete gaussian 0.05 0.05 0.05 Minimum−phase Amplitude Averaged (+17 dB SNR) 0 0 0 0 0.05 0.1 0.15 0.2 0 0.05 0.1 0.15 0.2 0 0.05 0.1 0.15 0.2 Unltered EEGLAB rls Windowed sinc Discrete gaussian Minimum−phase 0 0.05 0.1 0.15 0.2 0 0.05 0.1 0.15 0.2 0 0.05 0.1 0.15 0.2 Time Time Time FIGURE 1 | Impact of filter type and signal-to-noise ratio (SNR) on the filter (causal; see Figure A1 in Appendix for a detailed description of the time course of the averaged signal and the detected signal onset filters). Single trial signal-to-noise ratio was reduced in 20 dB-steps from latency in the simulated dataset (sampling frequency 500 Hz; step +26 dB (original dataset; left column) to −14 dB (right column). The Gaussian signal; signal onset 150–180 ms) as defined byVan Rullen (2011). The filtered single trials (second row) and the averaged trials (third row) are simulated dataset was filtered with the EEGLAB firls based filter, a displayed. Signal onset latency was measured by a running one-sided t-test windowed sinc FIR filter (Widmann, 2006), a discrete Gaussian kernel filter (bottom row; gray bars) and jack-knifing with a relative 20%-criterion (black (Lindeberg, 1990), and a minimum-phase converted version of the Gaussian lines; Kiesel et al., 2008). ficients necessarily must be symmetric (or In the first paragraph of the appendix However, in most situations filtering will antisymmetric) for the filter to have linear- Rousselet (2012) suggests that the causal nevertheless be necessary to appropriately phase characteristic (Rabiner and Gold, 1975; filtered signal could be left-shifted by the analyze electrophysiological data. In these Ifeachor and Jervis, 2002), this reduction of group delay to achieve zero-phase. We do not situations it is essential to know and under- filter delay comes at the cost of a non-linear agree with this recommendation: First, this stand the effects of filtering on the data and phase response and the introduction of a sys- would re-introduce non-causality. Second, cautiously adjust filter settings (cutoff fre- tematic delay in the signal (which can not eas- this statement is wrong as only linear-phase quencies, roll-off, attenuation, and ripple) ily be compensated due to non-linear phase). (anti-/symmetric FIR) filters can be made to the signal of interest and the particular The recommendation for minimum-phase zero-phase by left-shifting the signal. application, e.g., by evaluating the effects of causal FIR filtering, thus, should be strictly different filters on the data. Especially the limited to the detection of onset latencies and CONCLUSION high-pass filtering of slow ERP components applications where causality is required for In the analysis of electrophysiological data or blinks, as commonly observed in the lit- theoretical considerations. In its application signal-to-noise ratio has to be improved by erature, might seriously affect ERP time it should be considered that the systematic all adequate means. Priority should be given course and amplitudes (see, Luck, 2005, for delay and the non-linear phase response to the collection of higher numbers of trials a detailed discussion).