4.7: Exercise- The Impulse Response Function

Applied Event-Related Potential Data Analysis 2e · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    Read aloud

    How

    Speed: 1×
    Light up
    Highlight

    Symbols: Mulberry Symbols, © 2018–2026 Steve Lee, CC BY-SA 4.0 (licence, the set), the site's own copies.

    From LibreTexts, under CC BY-NC 4.0, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    4.7: Exercise- The Impulse Response Function

    In the previous exercise, you saw that an ERP waveform consists of the sum of several underlying components, and you saw that filtering the underlying components and then summing them together is equivalent to filtering the whole waveform. In this exercise and the next, we will take this one step further, breaking the waveform into a set of impulses, one at each time point. We will see that filtering these impulses and then summing them together is equivalent to just filtering the whole waveform.

    These exercises might seem a little abstract, but they will give you a deep, intuitive understanding of how filters actually work and why they can distort the ERP waveform. Once you've developed this intuitive understanding, we will move on to the very practical issue of how to select the filters for your data that will minimize noise in your data without producing significant waveform distortion.

    There are many types of filters, and this chapter focuses on a common class called finite impulse response filters (even though this ends up being a slight oversimplification of the filters that are actually used in ERPLAB). To understand these filters, you need to think of an ERP waveform as a set of impulses, one at each time point in the waveform. This is illustrated in Figure 4.2. Panel A of this figure shows the same overall waveform that you saw in the previous exercise, which was created by summing together P1, N1, and P2 components.

    P1 + N1 + P2 Impulses
    Figure 4.2. (A) Artificial ERP waveform drawn in the usual way. This waveform was created by summing together artificial P1, N1, and P2 components. (B) Same waveform as in (A), but drawn as an impulse at each time point.

    These waveforms are drawn in the usual way, with lines connecting the voltages at the individual time points as if we have a continuous function. However, we actually have a set of discrete values. In this example, we have one voltage value every 10 ms (a sampling rate of 100 Hz). Panel B shows an equally valid way of plotting the same waveform, with a bar at each time point. 

    To understand how filters work, it is helpful to think of the bars in Panel B as being sequences of impulses. An impulse is a waveform that is zero everywhere except for a nonzero value at a single time point. Figure 4.3 shows an example of an impulse of amplitude 1 µV at time zero. The bars in Figure 4.2 can be considered a sequence of the kind of impulse shown in Figure 4.3, with one impulse at each time point and an impulse amplitude that matches the voltage at that time point.

    Impulse of amplitude 1 at time zero
    Figure 4.3. Example of an impulse at time zero with an amplitude of 1 µV. The voltage is 0 µV at all other time points.

    Why do we want to conceive of an ERP waveform as a sequence of impulses? The reason is that we can predict the effects of a filter on the whole waveform by looking at the effects of that filter on the individual impulse shown in Figure 4.3. In this exercise, we will therefore take a close look at the effects of filtering the impulse shown in Figure 4.3, which is stored in an ERPset file named impulse.erp.

    To see this impulse, reset everything with the Reset button, go to the ERP tab, and load impulse.erp. It should look like the waveform shown in Screenshot 4.10. This ERPset has two channels, with the same impulse in both channels (for reasons that will be explained soon).

    Screenshot 4.10
    Impulse at Time Zero

    You can see the impulse (a voltage of 1 µV) at time zero. It looks like a narrow triangle rather than a pure impulse because the waveform is sampled at 100 Hz (one sample every 10 ms), so there is a line going from 0 µV at -10 ms to 1 µV at 0 ms and back down to 0 µV at 10 ms.

    Now we're going to look at the effects of applying a filter to the impulse. We'll apply it just to the impulse in Channel 2 so that we can see both the unfiltered waveform (in Channel 1) and the filtered waveform (in Channel 2). First, go to the Bin & Channel Section panel, select just Channel 2, and click Apply. Now go to the Filtering panel and set it up as shown in Screenshot 4.11, which tells it to filter just the selected bin(s) and channel(s) and specifies a half-amplitude cutoff at 10 Hz and a slope of 12 dB/octave.

    Screenshot 4.11
    Filtering Panel

    Click Run and name the ERPset impulse0_filt10. Now go to the Bin & Channel Section panel, select All channels, and click Apply. You should now see the unfiltered impulse at the top of the plot area and the filtered impulse at the bottom, like Screenshot 4.12.

    Screenshot 4.12
    Impulse at Time Zero Filtered at 10 Hz

    Remember when you applied this same 10 Hz filter to the simulated ERP waveform in the previous exercise. And remember how it reduced the amplitude of the P1 wave and shifted the onset and offset times of the waveform? You can see those same effects in the filtered impulse: Its amplitude is greatly reduced, with a peak of approximately 0.24 µV, and its onset and offset times have been shifted. Informally speaking, the filter "smeared out" the impulse.

    You can also think of this example as showing that filters reduce the temporal resolution of the ERP waveform. Instead of a nice precise impulse at time zero, the voltage in the filtered waveform is spread out over a period of approximately ±50 ms. 

    The key to understanding the kinds of filters used by ERPLAB is to understand something called the impulse response function, which is simply the waveform that is produced when the filter is applied to an impulse of amplitude 1 at time zero. You created the impulse response function corresponding to our 10 Hz filter when you applied this filter to the impulse in the impulse0 ERPset. That is, the bottom part of Screenshot 4.12 shows the impulse response function of the 10 Hz filter.

    Here's why impulse response functions are so important: Filtering an ERP waveform is equivalent to convolving the ERP waveform with the impulse response function. The mathematical process of convolution will be explained in the next couple sections.

    You don’t actually need to filter an impulse to see the impulse response function in ERPLAB. To see the impulse response function for the 10 Hz filter, go to the Filtering panel, click the Advanced button, and change the Display button from Filter frequency response to Filter impulse response. As you can see from Screenshot 4.13, the impulse response function is now plotted. Only the right half of the function is shown, but the left half is just the mirror image. Like the impulse response function that you created by filtering the impulse (Screenshot 4.12), the peak amplitude of the impulse response function in the Advanced window is approximately 0.24 µV (Screenshot 4.13). You can also see that the amplitude nears zero starting around 70 ms.

    Screenshot 4.13
    Impulse Response Function from Advanced Window

    In the next section, we'll take a closer look at the idea that an ERP waveform is really just a sequence of impulses, and that understanding the effects of a filter on a single impulse can tell you how the filter will impact the whole waveform.

    A Slight Oversimplification

    In this chapter, I discuss how finite impulse response (FIR) filters work, because they are quite easy to understand. However, ERPLAB implements filtering using a specific type of infinite impulse response (IIR) filter called a Butterworth filter. As long as you use a shallow roll-off (e.g., 12 dB/octave), ERPLAB’s filters provide a reasonable approximation of a FIR filter. So, everything I say in this chapter is approximately correct for ERPLAB’s filters as long as you use a shallow roll-off.

    The key difference between FIR and IIR filters is that the output of an IIR filter feeds back into the filter’s input. This means that the filter is nonlinear, with a response that could theoretically extend infinitely in time. The main advantage is that IIR filters require fewer coefficients than FIR filters, making them run faster and potentially reducing edge effects (which will be described later).


    This page titled 4.7: Exercise- The Impulse Response Function was last modified on Thu, 01 Oct 2026 18:52:58 GMT and is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Steven J Luck directly on the LibreTexts platform.