Week 10 — Discrete-Time Signal Processing: z-Transform, DFT/FFT, Digital Filters (Capstone)
Overview
The final week closes the loop. Having crossed into discrete time in Week 9, we now build the full discrete-time signal-processing toolkit — the z-transform (the discrete cousin of the Laplace transform), discrete-time LTI systems and difference equations, digital filters (FIR and IIR), and the DFT/FFT that make spectral analysis computable. Then the capstone ties all ten weeks together: capture a real analog signal through your conditioning/anti-alias front end, process it digitally on the Jetson, and compare the digital filter’s behavior directly against the analog filter you built in Week 6. Seeing an analog RC low-pass and its digital twin produce the same frequency response — one in hardware, one in code — is the moment the whole course becomes one coherent picture.
The conceptual throughline is that everything is the same idea in a new domain. Convolution still governs LTI systems (now a sum, not an integral). The frequency response is still the transform of the impulse response (now the DTFT/z-transform). Poles and zeros still determine behavior (now in the z-plane, with the unit circle playing the role of the imaginary axis). The FFT is just a fast algorithm for the DFT, which is the sampled, computable DTFT. If Weeks 1–9 were about building physical intuition, this week is about wielding it in software — which is where modern signal processing actually lives.
This week rests on Week 8 (Fourier/LTI), Week 9 (sampling), and the whole analog arc, and it points forward to Course 1’s embedded filtering/estimation and Course 5’s transforms and FFT theory.
Readings
- O-DSP Ch. 2: Discrete-time signals and systems, LTI systems, difference equations, and discrete convolution. Extract: the discrete impulse response and convolution sum.
- O-DSP Ch. 3: The z-transform, region of convergence, poles and zeros, and inverse transforms. Extract: the z-plane, and why the unit circle is where the DTFT lives.
- O-DSP Ch. 5: Transform analysis of LTI systems — the system function \(H(z)\), frequency response from pole/zero locations, and stability (poles inside the unit circle). Extract: reading behavior off a pole-zero plot.
- O-DSP Ch. 6–7 (skim): Filter structures and FIR/IIR filter design (windowing for FIR, bilinear transform for IIR). Extract: the two filter families and how an analog prototype becomes a digital filter.
- O-DSP Ch. 8–9: The DFT and the FFT — definition, properties, circular convolution, and the radix-2 FFT algorithm. Extract: the DFT as sampled DTFT, leakage/windowing, and why the FFT is \(O(N\log N)\).
Key Concepts
Discrete-time LTI systems and convolution
A discrete LTI system is characterized by its impulse response \(h[n]\); the output is the convolution sum
\[ y[n]=\sum_{k=-\infty}^{\infty} x[k]\,h[n-k]. \]
Most practical systems are described by a linear constant-coefficient difference equation
\[ \sum_{k=0}^{N} a_k\,y[n-k] = \sum_{m=0}^{M} b_m\,x[n-m], \]
which is directly implementable in code as a recurrence — this is a digital filter.
The z-transform and the system function
\[ X(z)=\sum_{n=-\infty}^{\infty} x[n]\,z^{-n},\qquad H(z)=\frac{\sum_m b_m z^{-m}}{\sum_k a_k z^{-k}}. \]
The z-transform is to discrete-time what Laplace is to continuous-time: \(z^{-1}\) is the unit-delay operator. The frequency response is \(H(z)\) evaluated on the unit circle, \(z=e^{j\omega}\) — the DTFT. Poles and zeros in the z-plane determine the response: a pole near the unit circle at angle \(\omega_0\) creates a peak there (resonance), a zero on the circle creates a null. Stability requires all poles strictly inside the unit circle — the discrete analog of “poles in the left half-plane” from the analog s-plane. The s-plane↔︎z-plane correspondence (\(z=e^{sT}\)) is exactly the sampling relationship of Week 9.
FIR vs IIR digital filters
- FIR (finite impulse response): \(h[n]\) has finite length; \(y[n]=\sum_m b_m x[n-m]\), no feedback. Always stable, can have exactly linear phase (constant group delay — no phase distortion), but needs many taps for sharp cutoff. Designed by windowing an ideal impulse response (the rectangle↔︎sinc pair from Week 8 reappears: truncating the sinc → passband ripple/leakage, mitigated by tapered windows).
- IIR (infinite impulse response): has feedback (poles); efficient (few coefficients for sharp cutoff) but can be unstable and has nonlinear phase. Designed by mapping an analog prototype (Butterworth/Chebyshev from Week 6) to digital via the bilinear transform. An IIR low-pass is the digital twin of your Week-6 analog RC/RLC filter.
The DFT and spectral leakage
The DFT computes \(N\) samples of the DTFT of an \(N\)-point sequence:
\[ X[k]=\sum_{n=0}^{N-1} x[n]\,e^{-j2\pi kn/N},\qquad k=0,\dots,N-1. \]
It is the computable spectrum — but it assumes the \(N\)-point window repeats periodically, so a frequency that doesn’t fall exactly on a bin “leaks” into neighbors (spectral leakage), and the finite window convolves the true spectrum with a sinc (Week 8 again). Windowing (Hann, Hamming, Blackman, flat-top) trades main-lobe width (frequency resolution) for side-lobe level (leakage) — the same time–frequency tradeoff seen all course. Frequency resolution is \(f_s/N\); the zero-padding trick interpolates the display but doesn’t add real resolution.
The FFT
The FFT is an \(O(N\log N)\) algorithm for the DFT (vs \(O(N^2)\) direct), exploiting the divide-and-conquer symmetry of the twiddle factors (radix-2 Cooley–Tukey). It is what makes real-time spectral analysis and fast convolution feasible — including the scope’s FFT display you used in Week 8. Fast convolution (multiply spectra, inverse-FFT) is the convolution theorem (Week 8) turned into a practical algorithm.
Group delay and phase
A filter’s group delay \(\tau_g(\omega)=-d\angle H/d\omega\) measures how much each frequency is delayed. Linear-phase FIR filters have constant group delay (waveform shape preserved); IIR and analog filters do not (phase distortion). This is the practical face of Week 6’s time–frequency / phase tradeoff and matters whenever waveform shape (not just spectrum) is important.
Theory Exercises
- Compute the z-transform of \(x[n]=a^n u[n]\); state its ROC and pole location, and the stability condition \(|a|<1\).
- For a first-order IIR filter \(y[n]=\alpha y[n-1]+(1-\alpha)x[n]\), find \(H(z)\), the pole, the frequency response \(H(e^{j\omega})\), and the cutoff; relate \(\alpha\) to an analog RC time constant via \(z=e^{sT}\).
- Design a low-pass FIR by windowing the ideal sinc; show how truncation length and window choice affect transition width and stopband ripple.
- Map a Week-6 analog RC low-pass to a digital IIR filter via the bilinear transform; compare the digital cutoff to the analog one and explain frequency warping.
- Compute a 4- or 8-point DFT by hand for a simple sequence; verify against the FFT butterfly.
- Explain spectral leakage: why a non-bin-centered sinusoid spreads, and how a Hann window reduces side lobes at the cost of resolution. Derive frequency resolution \(= f_s/N\).
- Sketch the radix-2 FFT decimation-in-time flow for \(N=8\) and count operations vs the direct DFT.
Lab / Bench Work — Capstone
The analog-vs-digital twin (capstone centerpiece):
- Capture: Generate a known test signal (e.g. sum of two sines, or a chirp). Pass it through your Week-7 op-amp anti-alias front end and sample it on the Jetson (Week-9 acquisition pipeline) into a buffer.
- Spectral analysis: Compute and plot its spectrum with the FFT (windowed). Identify the tones and confirm their frequencies and amplitudes against the source.
- Digital filtering: Implement both an FIR (windowed-sinc) and an IIR (bilinear-transformed Week-6 prototype) digital low-pass in Python/NumPy/SciPy on the Jetson. Filter the captured signal; plot input vs output spectra and time series.
- The reconciliation: Take the same signal through your physical Week-6 analog low-pass, capture the analog-filtered output, and compare its measured frequency response and output waveform to the digital filter’s. Overlay the analog Bode plot, the IIR digital response, and the FIR response on one plot.
- Group delay: Compare the phase/group-delay behavior of the linear-phase FIR vs the IIR vs the analog filter on a transient input; observe the FIR’s shape preservation.
Write-up: A staff-level note reconciling analog and digital across the full chain — what matched, what didn’t (ZOH roll-off, frequency warping, leakage, finite ENOB), and why. This note is the course’s portfolio artifact.
Stretch goals: real-time streaming filter on the Jetson; a simple spectrogram (STFT) of a swept input; fixed-point vs floating-point comparison.
Measurement Methodology
- Windowing discipline: always state the window and the resulting resolution (\(f_s/N\)); use flat-top for amplitude accuracy, Hann for general analysis. Show the leakage difference between a bin-centered and a non-bin-centered tone.
- Verify \(f_s\) and calibration on the Jetson: confirm the achieved sample rate and the ADC code→volt mapping before trusting any spectrum; embedded scheduling jitter is real.
- Compare like with like: when overlaying analog and digital responses, account for the ZOH sinc roll-off (Week 9), the bilinear frequency warping, and the FIR/IIR phase difference — these are expected discrepancies, not errors.
- Numerical sanity: validate the hand-computed small DFT against NumPy’s FFT; validate the digital filter’s measured response against
scipy.signal.freqz. - Reconcile the three frequency responses (analog Bode, IIR
freqz, FIRfreqz) and explain every systematic gap physically.
Expected baselines: FFT recovering the input tones within the bin resolution; digital and analog low-pass responses agreeing in the passband and near the cutoff (with the expected warping/ZOH differences quantified). Linear-phase FIR visibly preserving transient shape where the IIR and analog filters introduce phase distortion.
Connections
This week is the discrete-time mirror of Weeks 4–6 and 8: convolution, impulse response, frequency response, and poles/zeros all recur in the z-domain. The bilinear transform makes the Week-6 analog filter and this week’s IIR filter literally the same design in two domains — the capstone’s central demonstration. Sampling (Week 9) is the bridge that justifies \(z=e^{sT}\). The FFT realizes the convolution theorem (Week 8) as a fast algorithm and is the engine behind the scope’s FFT you have used since Week 8. Looking outward: this is the foundation for Course 1’s embedded digital filtering and state estimation, and the applied complement to Course 5’s transforms/FFT theory. The full chain — fields → circuits → devices → analog filters → sampling → digital filters — is now one continuous story, demonstrated end-to-end on your own bench and the Jetson.
Further Reading
- Oppenheim & Schafer, Discrete-Time Signal Processing — Ch. 2–3, 5 (systems, z-transform), 6–7 (filter design), 8–9 (DFT/FFT); the definitive DSP text.
- Oppenheim, Willsky & Nawab, Signals and Systems, Ch. 5 — the discrete-time Fourier transform.
- Smith, The Scientist and Engineer’s Guide to Digital Signal Processing (free online) — intuitive FIR/IIR and FFT treatment.
- SciPy
signaldocumentation —firwin,butter,bilinear,freqz,lfilterfor the capstone implementation.