Abstract
Filters are widely used for the modulation, typically attenuation, of amplitudes of different frequencies within neurophysiological signals. Filters, however, also induce changes in the phases of different frequencies whose amplitude is unmodulated. These phase shifts cause time lags in the filtered signals, leading to a disruption of the timing information between different frequencies within the same signal and between different signals. The emerging time lags can be either constant in the case of linear phase (LP) filters or vary as a function of the frequency in the more common case of non-LP (NLP) filters. Since filters are used ubiquitously online in the early stages of data acquisition, the vast majority of neurophysiological signals thus suffer from distortion of the timing information even prior to their sampling. This distortion is often exacerbated by further multiple offline filtering stages of the sampled signal. The distortion of timing information may cause misinterpretation of the results and lead to erroneous conclusions. Here we present a variety of typical examples of filter-induced phase distortions and discuss the evaluation and restoration of the timing information underlying the original signal.
Significance Statement
Filters are a common tool used in the processing of neuronal signals. In addition to their effect on the amplitude of different frequencies, filters also have a significant impact on their phases, which results in the distortion of the underlying timing information. This distortion, which arises by the online filters used in most neurophysiological systems and is exacerbated by further offline filtering, may cause severe misinterpretation of the results and lead to false conclusions. This manuscript presents different cases in which the timing information is disrupted and discusses the evaluation and correction of the underlying phase shifts.
Introduction
Filters are one of the most commonly used signal processing tools in neuroscience. Different types of filters are used in multiple applications ranging from online to offline, from analog to digital and from hardware to software in their implementation. These filters are applied to neurophysiological signals on different temporal and spatial scales as well as supplementary signals such as sensory stimuli or motor activity. The typical perceived role of these filters is to attenuate certain frequencies or frequency bands from the original signal. As a result, most neuroscientists focus on the magnitude of the modulation of the different frequencies; e.g., a certain high pass filter may reduce the magnitude of oscillations below 1 Hz within the original signal by 20 dB. Filters, however, do not only change the magnitude of the oscillations but also their phase, resulting in a temporal displacement. Some filters, termed linear phase (LP) filters, cause a fixed change in the temporal shift of all the frequencies. However, most filters, termed non-LP (NLP) filters, cause a differential time shift as a function of frequency (Oppenheim and Schafer, 1975; Oppenheim et al., 1999). A full description of the filter effect on the signal should thus comprise of the changes to both the magnitude and the phase of oscillations at different frequencies. The output signal of the filter follows a transformation in which some oscillations are reduced, other oscillations are not reduced but rather shifted in time, and still others are unchanged (or minimally altered) in either magnitude or phase (Fig. 1). Changes in oscillation phases lead to complex changes in the timing of oscillatory events, the distortion of the temporal relationship between oscillations at different frequencies and in different signals and alterations in the multi-frequency composition of the signal. These unexpected changes can lead to misinterpretation of the results and potentially introduce erroneous conclusions regarding the neuronal processes underlying the observed dataset. This manuscript presents common examples of these temporal distortions, generalizes the phenomena underlying each example, and finally suggests ways to address and correct these distortions.
Filter induced magnitude and phase changes in the signal. The changes induced by a 2-Hz high-pass four-pole Butterworth filter. A, Differential effect on four sinusoidal signals (black –raw signal and blue-filtered signal). B, The amplification and phase change in the signals following the filtering. C, The amplitude (top), phase (middle), and temporal (bottom) responses of the filter over all frequencies.
Filter-Induced Displacement of Phase and Time
The raw neurophysiological signal contains, in many cases, high energy in the low frequencies which may lead to saturations during subsequent sampling. This issue is addressed in most systems by online, hardware based, high-pass filters which attenuate these very low frequencies. The cutoff value of this filter varies dramatically and typically depends on the oscillations of interest to the researcher: a study of 0.5-Hz oscillations, for example in epilepsy (Vanhatalo et al., 2004), might use a 0.1-Hz high-pass filter whereas a study of 5-Hz oscillation, for example in Parkinson’s disease, might use a 1-Hz high-pass filter (Ben-Pazi et al., 2001). Once the data are acquired, scientists tend to overlook this initial filter and consider its output, often termed the wide-band pass filtered signal, as the equivalent of the raw analog electrophysiological signal, except for the attenuated frequencies. However, different components within this signal are actually shifted in time relative to the raw signal. In the best case, the time shift is constant for all frequencies (LP filter) which leads to a change in the perceived timing of the neurophysiological data relative to its original timing. However, in the more common case (NLP filter), the time shift varies for different frequencies, with those closest to the cutoff frequency typically being offset by the largest temporal change. For high-pass filters, the phases of frequencies near the cutoff frequency lead the phase of the raw signal whereas frequencies further away from the cutoff frequency have smaller shifts (Fig. 1). This results in a situation in which the relative phase (or time) shift between two oscillations at different frequencies is distorted, disrupting the internal composition of the signal. This may introduce an erroneous interpretation of the phase relation and assumptions as to which activity chronologically leads, and potentially causes or functionally leads the other activity.
A significant disruption of the internal order and temporal relationship within the same signal occurs when the signal is comprised of different frequencies, specifically when some of the prominent frequencies are close to the cutoff frequency of the filter resulting in a significant phase shift, while the others are distant resulting in a minor phase change. A typical example of this scenario is an extracellularly recorded signal containing both high frequency spikes and low frequency local field potentials (LFPs; Moran and Bar-Gad, 2010). Extracellular action potentials (spikes) consist of frequencies around 1 kHz, whereas the LFP signal contains low (starting from sub-Hz) frequencies. The low frequencies in the LFP signal are shifted in the filtered signal, appearing tens of milliseconds before their “real” time in the raw signal and relative to spikes whose timing is (almost) unaltered (Fig. 2A).
Filter-induced phase shifts of low frequencies. A, Differential effect of filtering on the phase of the LFP (5 Hz) and action potentials (1000 Hz; cutoff frequency: 2 Hz). B, Filter induced phase shifts leading to changes the timing and wave form of the filtered signal in relation to an external event (cutoff frequency: 2 Hz). Black-raw signal and blue–filtered signal.
A similar disruption of the temporal relationship between two signals can occur in studies examining the interaction between an external event and the neuronal activity. The neuronal signal is aligned to an external event and averaged around it, thus enabling researchers to explore questions dealing with the magnitude and timing of responses of the targeted neuronal systems to external events, such as sensory stimuli. However, while the timing of the external event is fixed, the timing of the recorded signal is altered because of the phase shift, resulting in a disrupted temporal relationship between the two (Fig. 2B). The response times of neuronal activity or the exact timing of different components [i.e., the N400 visible within the event related potential (ERP)] within the signal may shift (Kutas and Federmeier, 2011).
The temporal disruption of different oscillations within the same signal may also occur in cases in which the oscillatory frequencies are close to each other. One typical example can take place after the extraction via filtering of narrow oscillation bands such as the θ (4–10 Hz) and β (10–30 Hz) bands (Buzsáki and Draguhn, 2004). In these cases, the temporal distortion may be exacerbated by the secondary filters applied to the wide-band filtered signal. The different filters used for each band serve to separate the frequencies of interest from the wide-band signal but cause a frequency-dependent phase distortion that disrupts both the internal timing within each narrow band signal as well as the relationship between the different narrow band signals (Fig. 3A). Analyses aimed at uncovering the interaction between two oscillations bands such as cross-frequency measures suffer from increased effects of phase distortions. A common example for this situation is the commonly studied coupling between θ and γ band oscillations (Tort et al., 2008). The secondary filtration of the signal using different filters, for extraction of the two bands, may lead to a further distortion of the phase-locking and temporal relationship between the two frequency bands (Fig. 3B).
Differential phase shifts of different frequencies. Phase changes induced by a high-pass four-pole Butterworth filter in different examples (black, raw signal; blue, filtered signal). A, Time shifts induced by narrow band filters in the θ (top) and β (bottom) bands, overlaid on the original oscillations constituting the signal. B, Effects of secondary filtration on coupling of θ and γ band oscillations. Traces (i) of coupled θ (4 Hz) and γ (40 Hz) band oscillations, before (top) and after (bottom) filtration (3–20 Hz and 30–80 Hz two-poles Butterworth filters, respectively). Spectrograms (ii) of the γ band frequency phase locked to the θ wave, before (top) and after (bottom) filtration. C, The effects of different filters on identical signals originating from different sources (i): LFP (top) and EMG (bottom; cutoff frequencies: 1 Hz, filtered LFP signal, blue; 7 Hz, filtered EMG signal, green); (ii) dashed black vertical lines mark the initiation of the oscillatory event, identified by threshold (mean ± SD of noise) crossing (right, raw; middle and left, 1- and 7-Hz high-pass-filtered signal, respectively).
The effects of filter-based phase shifts are compounded when multiple signals from different sources are compared. A common practice in neuroscience is to compare oscillations in the neurophysiological signal with those arising from another source such as changes in the sensory input or motor output (Levy et al., 2000). Typically, the different signals are filtered using different online filters, a process which is frequently augmented by secondary offline filters. These different filters, although not affecting the magnitude of the analyzed frequencies, leads to varying changes in their phase (Fig. 3C). As a result, misidentification of the preceding signal and the relationship between them may occur, leading to erroneous conclusions to questions such as whether the LFP oscillations in the basal ganglia precede the hand tremor, thus potentially driving them, or whether they follow the tremor, thus representing its somatosensory reflection.
The distortion of timing information varies across filters, depending on their specific properties. Among the properties affecting the phase response of the filter are the filter type, order, and passband frequencies. As different types of filters (e.g., Butterworth, Chebyshev, and Elliptic) differ in their amplitude responses, they also vary in their effect on phases, even for equivalent bandpass frequencies (Fig. 4A). Using the same filter type with the same bandpass frequencies, but with different filter orders leads to different phase responses where time shifts typically increase with the filter order (Fig. 4B). Changes in the cutoff frequency of the filter also lead to a change in its phase response where the time shifts increase with proximity to the cutoff frequency (Fig. 4C).
Effects of filter design on time shifts. The effects of (A) the filter type (Butterworth, Chebyshev and elliptic filters), (B) the filter order (one to four poles), (C) and the cutoff frequency (1–5 Hz) on filter induced time shifts.
The filter design affects the directionality of the induced phase shift such that high-pass filters produce a positive phase shift resulting in the lead of the output in relation to the input, whereas low-pass filters produce negative phase shifts resulting in delayed output, and bandpass filters induce a combination of both positive and negative phase shifts (Hartmann, 1998; Jacob, 2004; Eggleston, 2011; Fig. 5A). The directionality of the phase shift is derived from the electrical properties of the filter in a case of hardware-based filtering, or by the mathematical definitions of it, in a case of a software-based filtering, and is independent with the causality of the filter. These properties, and others, aggregate to exacerbate the distortions when signals are compared across different studies and/or labs, in particular since most neurophysiological manuscripts do not explicitly describe the full set of filter properties used both offline and online, rendering their comparison problematic.
Effects of different filter designs and phase correction of an extracellularly recorded electrophysiological signal. A, The effects of high (blue, cutoff frequency: 4 Hz), low (green, cutoff frequency: 20 Hz), and band (cyan, pass-band: 4–20 Hz) pass four-poles Butterworth filters on an extracellular signal recorded from a rat striatum (black). B, Phase correction (red) by refiltering of the reversed filtered (i) high-pass and (ii) low-pass signals using similar filter designs.
Correcting for Phase Shifts
The extent of the filter-based phase shifts and the temporal lags derived from them can be evaluated by the filter’s phase response. LP filters cause a constant time delay in all frequencies while maintaining the temporal structure of the signal. The more common NLP filters lead to differential time shifts across frequencies causing both a change in the timing of individual components within the signal and a distortion of their temporal composition. Zero-phase (ZP) filters, in which the phase shifts of all frequencies are zero, preserve the temporal properties of the signal. ZP filters, however, are not applicable in online applications. Given the exact properties of the filters applied online, the original timing of the signal can be restored, mimicking the function of a ZP filter. In an offline correction process, a filter, similar in its properties to the online filter, is applied on the reversed signal, leading to a shift of the phases back to zero, restoring the timing of the distorted signal (Longini et al., 1975; Yael and Bar-gad, 2017; Fig. 5B). Due to the impact of the filter design on its phase response, this process can only be achieved when the specific properties of the filter are known. Thus, while the correction for the distortions generated by filters implemented by the researcher, typically in software, is straightforward, the correction process for ready-made filters received from external sources, in both hardware and software, is typically harder, as these filters are encapsulated and their specification are in many cases obscure. Additionally, it should be recalled that residual phase distortions, such as those resulting from the properties of the electrodes and downstream parts of the electronic circuits also contribute to the deviation of the recorded signal from the real one (Magistretti et al., 1998; Nelson et al., 2008; Nelson and Pouget, 2010; Tanner et al., 2015). These factors in many cases are not explicitly known by the experimenter and are thus typically harder to compensate for.
Conclusion
Filter-induced phase shifts can potentially impact the majority of electrophysiological signals, starting as early as in the initial stages of data acquisition. Multiple research fields in neuroscience deal with oscillatory signals, including epilepsy (Worrell et al., 2004), Parkinson’s disease (Silberstein et al., 2003), sleep (Steriade et al., 1993), memory (Klimesch, 1999), learning (Caplan et al., 2003), motor activity (Sanes and Donoghue, 1993), etc. These studies, as well as those focusing on the exact timing of components of neuronal activity (Miwakeichi et al., 2004) or cross-frequency coupling of neuronal oscillations (Tort et al., 2008) may suffer from the induced temporal distortion of their studied signals.
While multiple studies deal with the issue of filter induced changes of waveforms and amplitudes within electrophysiological signals (Bénar et al., 2010; Acunzo et al., 2012; Widmann and Schröger, 2012; Tanner et al., 2016), this manuscript discusses the impact of filters on timing information within filtered signals. The filtering process changes the phases of oscillations within the signal, leading to time delays that are either constant across frequencies in the case of LP filters, or vary as a function of frequency in the typical case of NLP filters. In the case of NLP filters, frequencies closer to the cutoff frequency of the filter are shifted to a larger extent than remote frequencies, resulting in a disruption of the internal order within the signal. In the case of LP filters, the internal composition of the signal is preserved, but its relative timing is shifted. In contrast to the effect of filters on the amplitudes of the signal, their considerable effect on the phase is usually overlooked. These effects are crucial to studies on the temporal properties of signals involving causality, the function of neuronal networks, time series, and multiple other time-based and wave form-based analyses. These effects generate a signal which is commonly considered to be the equivalent of the raw signal, but in fact comprises distorted phases. This problem is compounded when the signal is separated into its constituent frequencies by a secondary filtering or when two separate signals undergoing different filtering processes are compared. Since ZP filtering is not applicable online, these phase shifts are present in all recorded electrophysiological signals. Given the specific properties of the filters applied to the signal, this crucial effect can however be offline reversed and the distortion corrected. Currently, this is a major caveat of scientific reports as the full details of the filters used in all the stages of the data processing are typically missing or obscure. A full description of the filter’s properties within manuscripts will allow an independent evaluation of the extant of time shifts and will enable the comparison between studies performed using different filters.
Acknowledgments
Acknowledgements: We thank A. Moran for fruitful discussions.
Footnotes
The authors declare no competing financial interests.
This work was supported in part by the Israel Science Foundation (ISF) Grant 743/13 and the Legacy Heritage Bio-Medical Program of the ISF Grant 138/15.
This is an open-access article distributed under the terms of the Creative Commons Attribution 4.0 International license, which permits unrestricted use, distribution and reproduction in any medium provided that the original work is properly attributed.