CMP-272 · Lesson 4 of 12 · 25 min
Continuous-time convolution and the impulse response
The microphone in the accessible pedestrian signal produces a continuous voltage, and before the ADC samples it, the voltage passes through an analog low-pass filter. Amara needs to know how that filter changes the short ticks of the locator tone and the bursts of traffic noise: whether the ticks keep their sharp start, how much the noise is reduced and how long the filter takes to settle. The tool is the continuous-time version of lesson 3: the convolution integral. Everything carries over from discrete time, with sums becoming integrals and the unit impulse δ(t) taking the place of δ[n].
From sums to integrals
Approximate any input x(t) by a staircase of narrow rectangular pulses of width Δ. The pulse at time kΔ has height x(kΔ) and area x(kΔ)Δ. When Δ is much shorter than anything the system can respond to, each pulse acts like an impulse of that area, and the system responds to it with x(kΔ)Δ·h(t − kΔ), where h(t) is the impulse response. Adding the responses to all the pulses and letting Δ shrink to zero turns the sum into an integral:
The variable τ runs over the past, present and future of the input, and t is the time at which the output is wanted. As in discrete time, the order can be swapped: y(t) = ∫h(τ)x(t − τ)dτ. In this form the output is a weighted average of the input's history, with h(τ) saying how much the input τ seconds ago still matters now.
The graphical method
Convolution integrals of piecewise signals are easiest to set up graphically. Draw x(τ) against τ. Draw h(−τ), the impulse response flipped about τ = 0, and slide it to h(t − τ), which places its leading edge at τ = t. As t increases the flipped response slides right across x. For each range of t over which the overlap changes shape, write down the limits of the overlap and integrate the product. The ranges are separated by the values of t at which an edge of one signal crosses an edge of the other.
Worked problem
Two rectangular pulses
A test signal x(t) is a 1 V pulse from t = 0 to t = 2 ms. It drives a system whose impulse response h(t) is 1 (ms⁻¹) from 0 to 1 ms, which averages its input over the last millisecond. Find y(t), with t in milliseconds.
Show solution
- For t < 0 the flipped pulse h(t − τ) lies entirely left of x, so there is no overlap and y = 0.
- For 0 ≤ t < 1 the overlap runs from τ = 0 to τ = t.
- \[y(t) = \int_{0}^{t} (1)(1)\,d\tau = t\]
- For 1 ≤ t < 2 the whole of h lies inside x; the overlap has length 1.
- \[y(t) = \int_{t-1}^{t} d\tau = 1\]
- For 2 ≤ t < 3 the overlap runs from τ = t − 1 to τ = 2, and for t ≥ 3 there is none.
- \[y(t) = \int_{t-1}^{2} d\tau = 3 - t\]
Answer: y(t) rises linearly from 0 to 1 V over the first millisecond, stays at 1 V until 2 ms and falls to zero at 3 ms: a trapezoid of total width 2 + 1 = 3 ms. Convolving two equal-width pulses would give a triangle.
Two rules from the example hold generally. If x is non-zero over an interval of length Tₓ and h over an interval of length T_h, the output is non-zero over length Tₓ + T_h, and it starts at the sum of the two starting times. Convolution therefore always spreads a signal out in time. Every real filter blurs the sharp start of a locator-tone tick a little; the question is whether the blur is short compared with the features that matter.
The RC low-pass filter
The anti-aliasing filter on the microphone channel is, to a first approximation, a simple RC low-pass circuit: a series resistor R feeding a capacitor C, with the output taken across the capacitor. Its impulse response is a decaying exponential,
where τ_c = RC is the time constant. Lesson 5 derives this from the circuit's differential equation; for now, notice what it says. A brief impulse of current charges the capacitor at once, and the charge then leaks away through R with time constant RC. The area under h(t) is exactly 1, so a steady DC input passes through with unity gain, as it should for a low-pass filter. Amara's filter has R = 1.6 kΩ and C = 100 nF, so RC = 0.16 ms.
Worked problem
An RC filter and a decaying tick
The locator tone envelope reaching the filter is x(t) = e^(−t/T₁)u(t) with T₁ = 2 ms, and the filter has impulse response h(t) = (1/T₂)e^(−t/T₂)u(t) with T₂ = 0.16 ms. Find the output.
Show solution
- Both signals are zero for negative time, so the integral runs from 0 to t, for t ≥ 0.
- \[y(t) = \int_{0}^{t} e^{-\tau/T_1}\,\frac{1}{T_2}e^{-(t-\tau)/T_2}\,d\tau = \frac{1}{T_2}e^{-t/T_2}\int_{0}^{t} e^{\tau(1/T_2 - 1/T_1)}\,d\tau\]
- Evaluate the integral of the exponential and simplify.
- \[y(t) = \frac{T_1}{T_1 - T_2}\Big(e^{-t/T_1} - e^{-t/T_2}\Big)u(t)\]
- Substitute T₁ = 2 ms and T₂ = 0.16 ms: T₁/(T₁ − T₂) = 2/1.84 ≈ 1.087.
Answer: y(t) ≈ 1.087(e^(−t/2 ms) − e^(−t/0.16 ms))u(t). Instead of jumping to 1 at t = 0, the output rises with the fast time constant, peaks at about 0.80 near t = 0.44 ms and then follows the slow decay of the tick. The filter softens the attack of the tick by about half a millisecond, which listeners do not notice.
Properties and system meaning
Continuous-time convolution has the same algebra as discrete-time convolution. It is commutative, associative and distributive, and δ(t) is its identity: x(t) * δ(t) = x(t). Convolving with a shifted impulse delays the signal, x(t) * δ(t − t₀) = x(t − t₀), so a pure delay of t₀ has impulse response δ(t − t₀). Cascaded systems combine by convolving their impulse responses, and parallel systems by adding them.
System properties can again be read from h(t). The system is causal if h(t) = 0 for t < 0, which the RC filter satisfies thanks to the u(t). It is BIBO stable if h is absolutely integrable, ∫|h(t)|dt < ∞; the RC filter's integral is 1. An ideal integrator has h(t) = u(t), whose integral diverges, so it is unstable, matching lesson 2. The system is memoryless only if h(t) = Kδ(t).
Step response and impulse response
The step response s(t) is the response to u(t). Because the step is the integral of the impulse, the step response is the integral of the impulse response, and the impulse response is the derivative of the step response:
This relationship matters on the bench, because a clean step is far easier to generate than an impulse. Amara drives the filter with a square wave from a function generator, slow enough that each edge looks like a step, captures the output on an oscilloscope and differentiates it to estimate h(t). For the RC filter, s(t) = (1 − e^(−t/RC))u(t), and the 10 % to 90 % rise time is about 2.2RC, or 0.35 ms for her filter.
Approximating impulses in practice
Since h(t) is defined as the response to an impulse, it is natural to ask how short a real pulse must be to count as one. The answer comes from convolution itself. If a pulse of width w and area A drives a system whose impulse response changes little over w, the output is very nearly A·h(t). For the RC filter, a pulse much shorter than RC = 0.16 ms, say 10 µs, gives a response indistinguishable from the impulse response scaled by the pulse's area. A pulse of 1 ms does not: its response is the step response that rises and then the step response that falls. In acoustics the same idea appears as the hand clap or the balloon pop used to measure the echo pattern of a room; it works because the clap is short compared with the echoes.
import math
def conv_ct(x, h, dt):
"""Trapezoid-rule approximation of y(t) = integral x(tau) h(t - tau) dtau, step dt."""
y = [0.0] * len(x)
for n in range(1, len(x)):
total = sum(x[k] * h[n - k] for k in range(n + 1))
y[n] = (total - 0.5 * (x[0] * h[n] + x[n] * h[0])) * dt
return y
dt = 0.01e-3 # 10 microseconds
t = [n * dt for n in range(800)] # 0 to 8 ms
T1, T2 = 2e-3, 0.16e-3
x = [math.exp(-tt / T1) for tt in t]
h = [math.exp(-tt / T2) / T2 for tt in t]
y = conv_ct(x, h, dt)
exact = [T1 / (T1 - T2) * (math.exp(-tt / T1) - math.exp(-tt / T2)) for tt in t]
k = max(range(len(y)), key=lambda n: y[n])
print(f"numerical peak {y[k]:.3f} at t = {t[k]*1e3:.2f} ms")
print(f"largest error vs exact = {max(abs(a - b) for a, b in zip(y, exact)):.1e}")
s = [0.0] # step response = running integral of h
for n in range(1, len(h)):
s.append(s[-1] + 0.5 * (h[n - 1] + h[n]) * dt)
t10 = next(tt for tt, v in zip(t, s) if v >= 0.1)
t90 = next(tt for tt, v in zip(t, s) if v >= 0.9)
print(f"step response rise time 10-90 % = {(t90 - t10)*1e3:.3f} ms (2.2 RC = {2.2*T2*1e3:.3f} ms)")numerical peak 0.803 at t = 0.44 ms largest error vs exact = 2.2e-04 step response rise time 10-90 % = 0.350 ms (2.2 RC = 0.352 ms)
The numerical peak and its time match the closed form, and the largest error is tiny because the time step of 10 µs is much shorter than the filter's 0.16 ms time constant. The routine uses the trapezoid rule, which counts the two end points of each integral at half weight. A plain rectangle sum, which counts the end point at full weight, overestimates the output near t = 0 by several percent, because h(t) is tallest exactly where it starts; that kind of error is worth recognizing, since it makes a simulated filter look faster than the real one. Halving the step size reduces the trapezoid error by about a factor of four and the rectangle error by about a factor of two. The step response confirms the rise-time rule of thumb. Numerical convolution like this is how circuit simulators and audio software compute the response to arbitrary inputs, and lesson 10 shows how to make it fast.
Common mistakes
MistakeIntegrating over t instead of τ.
InsteadThe integration variable is τ; t is a fixed parameter for each output value, and the result is a function of t.
MistakeUsing the wrong limits when signals start at t = 0.
InsteadFor causal x and h, the integral runs from 0 to t, and the output is zero for t < 0.
MistakeMissing a range in the graphical method.
InsteadList every value of t at which an edge of the flipped h crosses an edge of x; each gap between those values is a separate case.
MistakeForgetting the 1/RC factor in the RC impulse response.
Insteadh(t) = (1/RC)e^(−t/RC)u(t) has unit area; without the factor the DC gain would be RC instead of 1.
MistakeMeasuring h(t) with a pulse that is too long.
InsteadThe pulse must be much shorter than the fastest time constant, or measure the step response and differentiate.
Summary and key terms
- For a continuous-time LTI system, y(t) = ∫x(τ)h(t − τ)dτ: the input is a continuum of weighted impulses.
- Flip h, slide it to t, multiply by x and integrate; set up one integral for each range in which the overlap keeps its shape.
- The output width is the sum of the input and impulse-response widths, so convolution spreads signals in time.
- An RC low-pass filter has h(t) = (1/RC)e^(−t/RC)u(t), with unit area and a 10–90 % rise time of about 2.2RC.
- Causality means h(t) = 0 for t < 0, and BIBO stability means ∫|h| is finite.
- The step response is the integral of the impulse response, so h(t) can be measured by differentiating a measured step response.
- Convolution integral
- y(t) = ∫x(τ)h(t − τ)dτ, the output of a continuous-time LTI system.
- Time constant
- The time for an exponential decay to fall to 1/e of its starting value; RC for an RC circuit.
- Rise time
- The time for a step response to go from 10 % to 90 % of its final value.
- Absolutely integrable
- Having a finite integral of the absolute value, the stability test for h(t).
- Graphical convolution
- Setting up the convolution integral by sketching x(τ) and the flipped, shifted h(t − τ).
- Low-pass filter
- A system that passes slow changes and low frequencies and attenuates fast changes and high frequencies.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Convolve u(t) with u(t).
Show answer
t·u(t), the unit ramp.
Convolve two pulses of height 1 and width 1, both starting at t = 0.
Show answer
A triangle from 0 to 2 with peak 1 at t = 1.
What is x(t) * δ(t + 3)?
Show answer
x(t + 3), an advance of 3.
Is h(t) = e^(2t)u(t) stable?
Show answer
No; its integral grows without bound.
An RC filter has R = 10 kΩ and C = 10 nF. Find its 10–90 % rise time.
Show answer
RC = 0.1 ms, so about 0.22 ms.
A measured step response is s(t) = (1 − e^(−1000t))u(t). Find h(t).
Show answer
h(t) = 1000e^(−1000t)u(t).
Amara wants the filter to soften the tick's attack by no more than 0.1 ms. Roughly what is the largest RC she can use?
Show answer
The rise time is about 2.2RC, so RC should be no more than about 45 µs; her 0.16 ms filter softens the attack more than that, which she accepts because listeners cannot hear the difference.
Two RC filters with the same time constant are cascaded with a buffer between them. Is the overall impulse response still an exponential?
Show answer
No. It is h * h = (t/(RC)²)e^(−t/RC)u(t), which starts at zero, rises and then decays.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.