# Impulse Response

## Contents

# 3.3. Impulse Response#

The convolution operation is closely related to the idea of an **impulse response**.
In this section, we’ll work through what this all means, and how convolution can be related to acoustic wave propagation.

## 3.3.1. What is an impulse?#

Before we go further, we’ll need to define an **impulse**.
An impulse is an idealized signal consisting of a single 1, followed by (in theory at least) infinitely many zeros:

Impulses are theoretical constructs, and cannot exist in nature. The closest familiar sounds to an impulse would be things like a balloon popping, or tapping two hard objects together, but these sounds will only approximate an ideal impulse.

We can construct impulses inside a computer (or with a pencil and paper), and doing so can help us understand the behavior of many signal processing operations.

## 3.3.2. Impulse response of a filter#

In general, a *filter* is any process that consumes one signal as input and produces a new signal as output.
One might express this notationally as

for input signal \(x\) and filter operation \(g\).

The **impulse response** of a filter \(g\) is the signal \(y\) produced by applying \(g\) to an impulse:

This is a broad and abstract definition, but in casual conversation, when people refer to filters they most often mean *linear filters*.
We’ll go one step further in this section, and assume that the filtering operation is a convolution between the input \(x\) and some fixed sequence \(h\).
One may then ask *what is the impulse response of a convolutional filter*?

Here, we’ll go back to the definition of convolution:

Plugging in our definition of an ideal impulse \(x=x_\mid\), we see that \(x[n-k] = 1\) if \(n=k\) (so that \(n-k=0\)) and \(x[n-k] = 0\) otherwise. This means that we can simplify the calculation significantly:

That is, the impulse response of a convolutional filter is the sequence \(h\) itself.

Put another way, the impulse response alone is enough to completely characterize a convolutional filter: no other information is necessary.

## 3.3.3. Finite impulse response (FIR)#

You may have heard the term **finite impulse response (FIR)** and wondered what it meant.
In plain terms, an FIR filter is any filter whose impulse response goes to 0 and stays there after some finite number of samples.
In general, this critical number of samples is a property of the filter in question, and will vary from one filter to the next.

In the case of convolutional filters, \(g(x) = h*x\) (for some finite sequence \(h\) of length \(K\)), the impulse response must go to 0 after \(K\) samples. This is because any output sample after that point will depend only on the trailing zeros in the impulse.

In short, **convolutional filters have a finite impulse response.**

In later chapters, we’ll see examples of other kinds of filters which use feedback to achieve an *infinite impulse response (IIR)*.
But for now, there’s still much more to explore with convolutional filters.

## 3.3.4. Room impulse response#

Beyond digital filters, you can also think about impulse responses of physical environments.
Imagine placing a sound source and a microphone in a room, and for now, let’s assume that the room’s walls have perfectly (acoustically) reflective surfaces.
Any sound emanating from the source will then have multiple paths to the microphone: the direct (shortest) path, as well as longer paths that reflect from each wall (or multiple walls).
If the sound source produces an ideal impulse, we can observe the impulse arriving at the microphone at different *delay* times (corresponding to the different paths of arrival).
Because each path has different length, the intensity of the sound will diminish for the longer paths corresponding to higher delay times.

This process is illustrated below, for an example where we have two perpendicular walls (and no floor or ceiling, just to keep things simple).