Why does filtering work? What enables us to enhance the bass in our audio players?

There is one operation that stands behind it all: **convolution**.

In order to fully master filtering, be it **finite impulse response (FIR)** or **infinite impulse response (IIR)** filtering, one needs to understand the definition, derivation and the properties of the convolution operation very well. That will be the topic of this and a few following articles.

We are going to dig **deep** into the convolution and we will get to know it so well, that it won’t surprise us any more and we’ll be able to recognize it from afar.

This article outlines the mathematical definition of the convolution and gives you some intuition behind it. In the next article we will introduce some basic properties along with their proofs (told you it’s going to go deep).

Are you ready?

### The Convolution Series

**Definition of convolution and intuition behind it**- Mathematical properties of convolution
- Convolution property of Fourier, Laplace, and z-transforms
- Identity element of the convolution
- Star notation of the convolution
- Circular vs. linear convolution
- Fast convolution
- Convolution vs. correlation
- Convolution in MATLAB, NumPy, and SciPy
- Deconvolution: Inverse convolution
- Convolution in probability: Sum of independent random variables

## Definition

In its simplest form, the convolution between two discrete-time signals **infinite sum**

Whoa, what’s happened here? Under the sum we have the two signals, but the second one is not only **shifted in time by $n$** but also

**time-reversed**!

#### Important assumptions

In order to make this discussion feasible, we must enforce *finite energy*. A signal

i. e.,

Additionally, we also assume that all considered signals

## Intuition

In order to get an intuition behind the convolution, we should look at it from different perspectives.

### Filtering perspective

Let’s consider a generic filter with input

*Figure 1. A generic filter.*

A filter is a linear time-invariant (LTI) system. From signal processing we know that any LTI system is completely specified by its impulse response

Now, let’s consider again Equation 1 with

Consider

### Delaying-and-summing perspective

We can also look at that operation from a different perspective. What if we fix

The above equation basically says, that once

This may all get a little bit confusing at this moment, so let’s look at an example, shall we?

#### Example

Let’s consider the following signal

*Figure 2. Input signal $x[n]$.*

and filter’s impulse response

*Figure 3. Filter’s impulse response $h[n]$.*

The result of their convolution is the following signal

*Figure 4. Filter’s output $y[n]$ after feeding $x[n]$ at the input.*

Not very meaningful, is it? The only thing that we can observe is that output’s length is the sum of input’s and filter’s lengths minus one.

Let’s try some color coding. We can depict each of

*Figure 5. Color-coded $x[n]$.*

We can now examine the impact of particular samples on the filter’s output. What would happen if only blue

*Figure 6. Filter’s response to $x[0]$.*

We can see that the entire impulse response of the filter got scaled by

Now, let’s imagine, that only second sample, namely orange

*Figure 7. Filter’s response to $x[1]$.*

Notice that at

The same thing happens for green *Figure 8. Filter’s response to $x[2]$.*

*Figure 9. Filter’s response to*$x[3]$ .

Viewing all these “partial” responses on a plot shows the impact of each individual input sample over time
*Figure 10. Overlayed filter’s responses to individual samples of $x[n]$.*

Summing them all up (as if summing over *Figure 11. Summation of signals in Figures 6-9.*
what corresponds to the

## Continuous convolution

Convolution is defined for continuous-time signals as well (notice the conventional use of round brackets for non-discrete functions)

Although it may not be as intuitive in interpretation as the discrete convolution, nevertheless, we could try to imagine the continuous case as an infinitely densely sampled discrete signal (so that the sum over discrete samples changes to an integral over continuous functions). But keep in mind that it is only an intuitive view not a mathematically strict interpretation.

## Summary

In this article, we introduced the mathematical operation of convolution, gave the justification for its form, and provided a little bit of intuition on how can we view the convolution from different angles. In the next articles we are going to study convolution more closely.

Up next: mathematical properties of convolution!.

## Bibliography

[1] Convolution on Wikipedia. Retrieved: 09.03.2021.

[2] Alan V Oppenheim, Ronald W. Schafer *Discrete-Time Signal Processing*, 3rd Edition, Pearson 2010.

[3] Alan V. Oppenheim, Alan S. Willsky, with S. Hamid *Signals and Systems*, 2nd Edition, Pearson 1997.

Comments powered by Talkyard.