x(t)1 kΩ1 µF–1import numpy as np2t = np.arange(800) * 0.013x = np.where(t < 2, 1.0, 0.0)4h = np.exp(-t)5y = np.convolve(x, h) * 0.01δ
-2024600.51τ (ms)x (V) · h (1/ms)INPUT AXIS τδ(τ), area 1-2024600.51t (ms)y (V)OUTPUT y(t)
Coloured parts: what the current step is about; everything else rests in whiteBlocks: input source, RC filter (1 kΩ, 1 µF), output voltmeter and a Python code cardPlots: the input axis τ (pulse, slices, flipped h, shaded product) and the output y(t)The kick token, the copies of h, the thinning slices and the sliding window all moveAn RC filter (RC = 1 ms) has impulse response h(t) = (1/RC)·e^(−t/RC). Fed a 1 V pulse 2 ms long, its output is y = x ∗ h: 0.632 V at 1 ms, 0.865 V at 2 ms. np.convolve returns the full convolution, 1599 values for two arrays of 800. Only the first 800 line up with t; the rest describe later times, after the input array runs out. The small gap from the exact value (0.639 against 0.632 at 1 ms) shrinks as the step gets smaller.

A system and its kick

  1. This RC filter is a system: a signal x(t) goes in, a new signal y(t) comes out. Feed it a 1 V pulse 2 ms long and the output rises slowly, then falls slowly. Can we predict y(t) for any input?

Any input is a row of kicks

Flip, multiply, add up

Convolution in code

The working

# step 1/11 · system

system: x(t) in  ->  y(t) out

R = 1 kΩ, C = 1 µF, RC = 1 kΩ × 1 µF = 1 ms
input  x(t) = 1 V for 0 ≤ t < 2 ms, else 0
output y(t) = the capacitor voltage

this filter is linear and time-invariant (LTI)
(see "System properties: linear,
time-invariant, causal and stable")
the RC circuit itself: Circuits,
"The RC circuit: natural and step response"

R = 1 kΩ and C = 1 µF are chosen example values (RC = 1 ms); the input is a 1 V pulse 2 ms long. Every number and curve in the figure is computed from the formulas in this lesson's model, and the tests check them against a separate numerical integration. h(t) has units of 1/time (here per ms) because a kick has units of volt × time: a kick of area 1 V·ms makes an output of h(t) volts. In y = ∫ x·h dτ the units are V × (1/ms) × ms = V.