---
title: The convolution integral
heading: Flip, slide, multiply and integrate
eyebrow: C9 · Lesson 7 · The convolution integral
xp: 50
---

::: hook
Continuous-time LTI systems work the same way as discrete ones, with an integral in place of the sum. A circuit's impulse response h(t) is what it does after a very short, very tall kick; any input is a dense row of such kicks, and the output adds up the circuit's response to each. Doing the integral by hand comes down to one skill: sketching the flipped, shifted impulse response against the input and seeing, region by region, where they overlap. Once that's automatic, outputs like a pulse through an RC filter can be written down in a few lines.
:::

::: play
- The input x(τ) is a pulse lasting one second. The impulse response is $h(\tau) = e^{-\tau}u(\tau)$, an RC low-pass with RC = 1 s; the curve labeled h(t − τ) is it flipped and slid to t.
- The shaded area is the product x(τ)h(t − τ), and its area is the output y(t). Slide t: no overlap before 0, a growing overlap until t = 1, then a shrinking, decaying one.
- The dashed curve is the whole output, and the dot is y(t) now: a charge toward 1 for the pulse's second, then a decay.
:::
:::

```sim plot
view: graph
x: tau = -2..5 s
y: v = -0.1..1.2
slider: t = -1..4.5 = 0.6 step 0.05
plot: exp(-tau)*(exp((tau + 1 - abs(tau - 1))/2) - 1)*step(tau) | dashed | label: y
plot: step(tau) - step(tau - 1) | label: x(τ)
plot: exp(-(t - tau))*step(t - tau) | label: h(t − τ)
plot: (step(tau) - step(tau - 1))*exp(-(t - tau))*step(t - tau) | fill: -2..5 | color: ch3
point: t, exp(-t)*(exp((t + 1 - abs(t - 1))/2) - 1)*step(t) | label: y(t)
readout: y(t) = exp(-t)*(exp((t + 1 - abs(t - 1))/2) - 1)*step(t) | digits: 4
```

::: predict
## A rectangular pulse of height 1 and width 1 is convolved with itself. What is the result?

- [ ] The same pulse
- [ ] A pulse of width 2 and height 1
- [x] A triangle of width 2 and peak 1
- [ ] A triangle of width 1 and peak 2

::: reveal
A triangle. As one pulse slides past the other, the overlap grows linearly from 0 to 1 (full overlap at t = 1) and shrinks back to 0 at t = 2. The width is the sum of the widths, and the peak is the area of full overlap, 1.
:::
:::

::: nameit
## The integral

$$y(t) = \int_{-\infty}^{\infty} x(\tau)\,h(t - \tau)\,d\tau = (x * h)(t)$$

To evaluate it: sketch x(τ) and $h(t - \tau)$ (h flipped, with its origin moved to τ = t), then split t into regions by where the edges of the two signals meet. In each region, the integral's limits are where both are nonzero.

## Properties

The same as the discrete sum: commutative, associative, distributive; $x * \delta = x$ and $x * \delta(t - t_0) = x(t - t_0)$; durations add; areas multiply, $\int y = \int x \int h$. Also, differentiating either signal differentiates the result.

## Circuits

An RC low-pass has $h(t) = \frac{1}{\tau}e^{-t/\tau}u(t)$ with τ = RC. Its step response is $\int_0^t h = 1 - e^{-t/\tau}$, and a pulse of width T gives

$$y(t) = \begin{cases} 1 - e^{-t/\tau} & 0 \le t \le T \\ (1 - e^{-T/\tau})\,e^{-(t - T)/\tau} & t > T \end{cases}$$

the charge-then-discharge that every square wave through a filter shows.
:::

::: example
## Find $u(t) * e^{-2t}u(t)$.

::: solution
1. **Before t = 0.** For t < 0 there's no overlap, so the output is 0.
2. **After t = 0.** For t ≥ 0:
   $$\begin{aligned} y(t) &= \int_0^t e^{-2(t - \tau)}d\tau \\ &= e^{-2t}\cdot\frac{e^{2t} - 1}{2} \\ &= \frac{1 - e^{-2t}}{2} \end{aligned}$$
3. **Where it heads.** It rises to 1/2, the area of $e^{-2t}u(t)$. At t = 2 it's 0.491.

**Answer:** the output is $(1 - e^{-2t})/2$ for t ≥ 0 and 0 before, rising to 1/2 (0.491 at t = 2).
:::
:::

::: example
## Find the self-convolution of the pulse that is 1 from 0 to 1, at t = 0.5, 1 and 1.5.

::: solution
1. **Overlap length.** The overlap of [0, 1] with [t − 1, t] has length t for 0 ≤ t ≤ 1 and 2 − t for 1 ≤ t ≤ 2.
2. **Evaluate.**
   $$\begin{aligned} y(0.5) &= 0.5 \\ y(1) &= 1 \\ y(1.5) &= 0.5 \end{aligned}$$

**Answer:** y(0.5) = 0.5, y(1) = 1 and y(1.5) = 0.5: the self-convolution is the triangle.
:::
:::

::: example
## Find $e^{-t}u(t) * e^{-2t}u(t)$ and where it peaks.

::: solution
1. **Convolve.** For t ≥ 0:
   $$\begin{aligned} y(t) &= \int_0^t e^{-\tau}e^{-2(t - \tau)}d\tau \\ &= e^{-2t}(e^t - 1) \\ &= e^{-t} - e^{-2t} \end{aligned}$$
   At t = 1 it's 0.2325.
2. **Find the peak.** Its derivative is zero where $e^{-t} = 1/2$:
   $$-e^{-t} + 2e^{-2t} = 0$$
   which is t = ln 2 = 0.693.
3. **Peak value.**
   $$\begin{aligned} y(\ln 2) &= 1/2 - 1/4 \\ &= 0.25 \end{aligned}$$
4. **The shape.** Two first-order lags in a row give a rise and fall, never a jump.

**Answer:** $e^{-t} - e^{-2t}$ for t ≥ 0, which peaks at 0.25 at t = ln 2 = 0.693.
:::
:::

::: check
given: T1 = 1 | 3 | 0.5; T2 = 2 | 5
answer: T1 + T2
unit: s
tolerance: 0.5%

## A signal lasting {T1} s is convolved with an impulse response lasting {T2} s. How long does the output last?

::: right
Right. Durations add: {answer} s.
:::

::: misses
- [T1*T2] The durations add.
- [any] Not yet. The overlap begins when the leading edges meet and ends when the trailing edges part.
:::
:::

::: check
kind: parts
given: A = 1 | 2; a = 0.5 | 2; B = 3 | 0.5; b = 4 | 5

## A pulse of height {A} and width {a} s is convolved with a pulse of height {B} and width {b} s.

::: part
answer: A*B*a
tolerance: 0.5%

### What is the output's largest value?

::: misses
- [A*B*b] At full overlap the narrower pulse sits inside the wider one: the overlap is {a} s long.
- [A*B] Multiply by the length of the overlap.
- [any] Not yet. Height × height × the narrower width.
:::
:::

::: part
answer: A*a*B*b
tolerance: 0.5%

### What is the output's total area?

::: misses
- [any] Areas multiply.
:::
:::
:::

::: check
given: tau = 0.5 | 2 | 10; t = 1 | 3
answer: 1 - exp(-t/tau)
tolerance: 0.5%

## An RC low-pass with τ = {tau} s has $h(t) = \frac{1}{\tau}e^{-t/\tau}u(t)$. What is its response to u(t) at t = {t} s?

::: right
Right. The integral of h up to t: {answer}.
:::

::: misses
- [exp(-t/tau)] That's what remains to go. The step response rises: $1 - e^{-t/\tau}$.
- [exp(-t/tau)/tau] That's h itself; the step response is its running integral.
- [any] Not yet. $\int_0^t h$.
:::
:::

::: check
kind: parts
given: tau = 1 | 2; T = 1 | 3; d = 0.5 | 2

## A pulse of height 1 and width {T} s goes into an RC low-pass with τ = {tau} s.

::: part
answer: 1 - exp(-T/tau)
tolerance: 0.5%

### What is the output when the pulse ends, at t = {T} s?

::: misses
- [any] The step response at t = T.
:::
:::

::: part
answer: (1 - exp(-T/tau))*exp(-d/tau)
tolerance: 0.5%

### What is it {d} s later?

::: misses
- [1 - exp(-(T + d)/tau)] After the pulse ends, the output decays from where it got to; it doesn't keep charging.
- [any] Not yet. The value at T times $e^{-d/\tau}$.
:::
:::
:::

::: check
given: Ax = 2 | 0.5 | 3; Ah = 1 | 4
answer: Ax*Ah
tolerance: 0.5%

## A signal of area {Ax} goes into a system whose impulse response has area {Ah}. What is the output's area?

::: right
Right. Areas multiply: {answer}.
:::

::: misses
- [Ax + Ah] Areas multiply under convolution.
- [any] Not yet. $\int y = \int x \cdot \int h$.
:::
:::

::: check
given: a = 0.5 | 2 | 4; t = 0.5 | 1 | 2
answer: (1 - exp(-a*t))/a
tolerance: 0.5%

## What is $u(t) * e^{-\given{a}t}u(t)$ at t = {t}?

::: right
Right. $(1 - e^{-at})/a$ = {answer}.
:::

::: misses
- [1 - exp(-a*t)] The area of $e^{-at}u(t)$ is 1/a, so the result levels off at 1/{a}.
- [any] Not yet. $\int_0^t e^{-a(t - \tau)}d\tau$.
:::
:::

::: check
kind: choice

## x(τ) is nonzero from 0 to 2 and h(t − τ) is nonzero from t − 3 to t. For which t is the overlap from τ = 0 to τ = t?

- [x] 0 ≤ t ≤ 2
- [ ] 2 ≤ t ≤ 3
- [ ] 3 ≤ t ≤ 5
- [ ] t ≥ 5

::: misses
- [2] Once t passes 2, the overlap's upper end is fixed at x's edge, 2.
- [3] There the flipped response's left edge, t − 3, sets the lower limit.
- [4] Past t = 5 the two don't overlap at all.
:::
:::

::: check
kind: parts
given: W = 1 | 2 | 5; f = 0.25 | 0.5 | 0.8

## A pulse of height 1 and width {W} is convolved with itself.

::: part
answer: W
tolerance: 0.5%

### What is the peak of the result?

::: misses
- [any] The overlap at t = {W}, the whole width.
:::
:::

::: part
answer: W - f*W
tolerance: 0.5%

### What is it at t = {W} + {f}·{W}?

::: misses
- [any] On the falling side the overlap is 2W − t.
:::
:::
:::

::: check
kind: parts
given: a = 0.5 | 2 | 5; t = 0.2 | 1 | 3

## Find $u(t) * e^{-at}u(t)$ with a = {a}.

::: part
answer: (1 - exp(-a*t))/a
tolerance: 0.5%

### What is it at t = {t}?

::: misses
- [1 - exp(-a*t)] Divide by a: the final value is the area of $e^{-at}$, 1/a.
- [any] $(1 - e^{-at})/a$.
:::
:::

::: part
answer: 1/a
tolerance: 0.5%

### Where does it settle?

::: misses
- [any] The area under $e^{-at}u(t)$.
:::
:::
:::

::: explain
## Why does convolution need h flipped, h(t − τ), instead of just shifted?

::: model
The output at time t adds up the responses to inputs that arrived at every earlier time τ. An input at time τ has been in the system for t − τ seconds by time t, so its contribution is weighted by h at age t − τ. Recent inputs (τ close to t) are weighted by the start of the impulse response and old inputs by its tail. Plotted against τ, that weighting is h run backward from τ = t: the flip is just bookkeeping for "how long ago did this input arrive".
:::
:::

::: practice

::: check
given: T1 = 2 | 4; T2 = 1 | 6
answer: T1 + T2
unit: s
tolerance: 0.5%

## How long is the convolution of signals lasting {T1} s and {T2} s?

::: misses
- [any] Durations add.
:::
:::

::: check
given: tau = 1 | 5; t = 2 | 4
answer: 1 - exp(-t/tau)
tolerance: 0.5%

## Step response of an RC low-pass (τ = {tau} s) at t = {t} s?

::: misses
- [any] $1 - e^{-t/\tau}$.
:::
:::

::: check
given: A = 1 | 3; a = 1 | 2; B = 2 | 5; b = 3 | 4
answer: A*B*a
tolerance: 0.5%

## Peak of a height-{A}, width-{a} pulse convolved with a height-{B}, width-{b} pulse?

::: misses
- [any] Heights times the narrower width.
:::
:::
:::
