H(s)Ωc ?area 0.000s → z2/T = 16000b0–b1–b2–a1–a2–1import numpy as np2from scipy.signal import bilinear3fs, fc = 8000, 10004W = 2*fs*np.tan(np.pi*fc/fs)5den = [1, np.sqrt(2)*W, W**2]6b, a = bilinear([W**2], den, fs)Ωc
-20-1001020-10010σ (krad/s)Ω (krad/s)s-PLANEleft half · dot s = jΩ× −4686 ± j4686analog poles-2-1012-101real partimag. partz-PLANE2|z| = 1 · insideω = 2·atan(ΩT/2)× 0.4714 ± j0.3333 · o −10246810012345analog f (kHz)digital f (kHz)WARPINGbilinearno warpingfs/2 = 4 kHz10 kHz → 3365 Hzfs/2 = 4 kHz1054.8 Hz → 1000 Hz0123400.250.50.751f (kHz)|H|GAINdigital H(z)analog Ha(s)analog, Ωc = 6627 rad/s0.7071 (−3.01 dB) at 1 kHzbilinear = butter
Coloured parts: what the current step is about; everything else rests in whiteBlocks: analog prototype H(s), trapezoid integrator, bilinear map s → z, coefficient cells, Python code cardPlots: s-plane, z-plane, the frequency warping curve and the gain of both filtersThe token carries the cutoff and coefficients; the dots trace s = jΩ and its image on the unit circleA 2nd-order Butterworth lowpass, cutoff 1000 Hz at fs = 8000 Hz, designed by the bilinear transform s = (2/T)(z − 1)/(z + 1) with a prewarped cutoff Ωc = 6627.4 rad/s. The moving dots trace real points of the map: the s-plane dot climbs the jΩ axis and its image is z = (1 + sT/2)/(1 − sT/2).

The plan

  1. We want a digital lowpass filter: keep tones below 1000 Hz, cut those above, for audio sampled at 8000 Hz. Plan: borrow a proven analog design, a 2nd-order Butterworth, and translate it from s into z.

From trapezoids to a map

What the map does

Design the filter

Check it

The working

# step 1/11 · goal

wanted   lowpass, cutoff fc = 1000 Hz (−3 dB)
sampled  fs = 8000 Hz, T = 1/fs = 125 µs

analog designs are solved and tabled:
  Butterworth order 2 (previous lesson)
  Ha(s) = Ωc² / (s² + √2·Ωc·s + Ωc²)

IIR = infinite impulse response:
  the output feeds back, like the analog
  filter's capacitors remember

The order (cutoff 1000 Hz, fs = 8000 Hz, Butterworth order 2) is a chosen example. Every number in the figure is computed from this model and was checked against SciPy 1.18.1 (scipy.signal.bilinear and scipy.signal.butter). Euler versus Tustin for controllers uses this same derivation (Control: "Discretising a controller: Euler versus Tustin"); z = e^(sT) for sampling is in "From the s-plane to the z-plane"; Bode plots are in Circuits, "Transfer functions and Bode plots".