Course

DSP from Scratch

How a computer listens, measures and filters. The course starts with one question, what is a digital signal, and builds one idea at a time until you can design a filter and read a spectrum.

  • 6 lessons out now
  • 116 planned
  • 9 parts

Part 1

Foundations

Samples, sine waves, aliasing, the impulse response, convolution and the frequency response.

6 lessons6 out

Part 2

The tools and the rules a system follows

Complex numbers as arrows, then the rules a system follows: linearity, time invariance, causality and stability.

12 lessons

See the 12 lessons planned
  1. 7Tools: a complex number is an arrow
  2. 8Tools: multiplying arrows: lengths multiply, angles add; polar form, conjugate
  3. 9Tools: Euler's formula, e^(jθ) as a spinning arrow; a cosine is two arrows
  4. 10Digital frequency: cycles and radians per sample, why ω stops at π
  5. 11Linearity: the scale-and-add test
  6. 12Time invariance: the delay test
  7. 13Causality: no peeking at the future
  8. 14Stability: bounded in, bounded out (sum of |h|)
  9. 15Difference equations: a filter as a recipe
  10. 16Block diagrams: adders, multipliers and the delay box z⁻¹
  11. 17FIR and IIR: filters without and with feedback
  12. 18Solve with me: system properties

Part 3

The frequency domain

How much of each frequency a signal holds, ideal and real filters, linear phase and group delay.

15 lessons

See the 15 lessons planned
  1. 19The DTFT: measuring how much of each frequency (analysis equation)
  2. 20Building the signal back: the inverse DTFT (synthesis equation)
  3. 21Why a digital spectrum repeats every 2π
  4. 22Frequency response, properly: e^(jωn) in, H(ω)e^(jωn) out
  5. 23Tools: decibels, and reading magnitude and phase plots
  6. 24The moving-average filter of any length, in frequency
  7. 25Ideal filters: low-pass, high-pass, band-pass, band-stop
  8. 26Why the ideal filter can't be built (infinite, non-causal)
  9. 27Real filters: passband ripple, stopband, transition band
  10. 28FIR or IIR? The trade-off, on a noisy signal
  11. 29Linear phase: every frequency delayed by the same amount
  12. 30Proving it: symmetric taps (the Type I derivation)
  13. 31Group delay
  14. 32What non-linear phase does to a signal, and forward-backward filtering
  15. 33Solve with me: frequency response

Part 4

The z-transform

Poles, zeros and the region of convergence: reading a whole system from one map.

19 lessons

See the 19 lessons planned
  1. 34Why engineers draw poles and zeros (a recipe you can't read by eye)
  2. 35Tools: the geometric series and when it adds up
  3. 36The z-transform, and why a delay is written z⁻¹
  4. 37When the sum converges: the region of convergence
  5. 38The z-plane, the unit circle and the DTFT
  6. 39Building the table of z-transform pairs
  7. 40Causal, anti-causal and two-sided signals
  8. 41Same X(z), different signals: the ROC decides
  9. 42Properties that save work (shift, convolution → multiplication)
  10. 43Rational transforms: poles, zeros and the pole-zero plot
  11. 44Tools: partial fractions
  12. 45Getting x(n) back: the inverse z-transform
  13. 46A double pole: the step convolved with itself
  14. 47The system function: difference equations become algebra
  15. 48Where a pole sits decides what the response does (real poles)
  16. 49Complex pole pairs: ringing that fades or grows
  17. 50Stability: poles inside the unit circle, ROC contains it
  18. 51Solve with me: transforms and ROC
  19. 52Solve with me: inverse and stability

Part 5

Poles, zeros and the frequency response

Walk round the unit circle and watch the frequency response take shape.

7 lessons

See the 7 lessons planned
  1. 53From H(z) to H(ω): put z on the unit circle
  2. 54Walk round the unit circle to see the response
  3. 55Gain is a ratio of distances
  4. 56Phase from the angles to poles and zeros
  5. 57The moving average puts its zeros evenly round the circle
  6. 58A zero's angle tells you which frequency disappears
  7. 59Solve with me: sketching responses from pole-zero plots

Part 6

FIR design by windows

From the ideal low-pass to a filter you can build, one window at a time.

17 lessons

See the 17 lessons planned
  1. 60The ideal low-pass becomes a sinc (the inverse DTFT at work)
  2. 61Keep M samples and move their centre to the middle
  3. 62What cutting does: ripples at the edge
  4. 63A window's spectrum: the main lobe sets the transition
  5. 64Sidelobes and the −13 dB problem
  6. 65Gentler windows: Hann, Hamming, Blackman
  7. 66Choose the window for ripple, then the length for transition
  8. 67Specifications in dB and in linear units
  9. 68A low-pass design, step by step
  10. 69Same design, four windows: what changes
  11. 70High-pass by subtracting from an all-pass
  12. 71Band-pass and band-stop from low-passes
  13. 72Symmetric taps: a delay times a real amplitude
  14. 73Better attenuation costs taps and delay; pros and cons of windows
  15. 74Equiripple: spread the error to shrink its worst peak
  16. 75Solve with me: FIR low-pass design
  17. 76Solve with me: FIR high-pass and band-pass

Part 7

IIR design

Filters with feedback: single poles, notches, combs, Butterworth and the bilinear transform.

17 lessons

See the 17 lessons planned
  1. 77One pole and one zero make a low-pass
  2. 78The 3 dB point: a quadratic for α
  3. 79Which root? α and stability; the "linear" phase myth
  4. 80Move the zero to z = 1 for a high-pass
  5. 81Band-pass: a complex-conjugate pair of poles
  6. 82Pole radius sets the bandwidth
  7. 83The notch: zeros on the unit circle
  8. 84Designing from hertz, and what the FIR equivalent costs
  9. 85Cascade identical sections for a sharper edge
  10. 86Tools: the nth roots, evenly round the circle
  11. 87The comb filter: replace each delay by L delays
  12. 88Tools: analogue filters and the s-plane
  13. 89The Butterworth prototype: maximally flat
  14. 90The bilinear transform and frequency warping
  15. 91A complete bilinear design in hertz, to the difference equation
  16. 92Solve with me: first- and second-order IIR
  17. 93Solve with me: bilinear design

Part 8

The DFT and the FFT

The spectrum a computer can actually compute, and why the FFT is fast.

7 lessons

See the 7 lessons planned
  1. 94From the DTFT to the DFT: sample the frequency axis
  2. 95Frequency bins and resolution
  3. 96Reading a DFT: the mirror half and the negative-frequency bin
  4. 97The inverse DFT
  5. 98Leakage: a tone between bins, and windows for spectra
  6. 99The FFT: why it is fast (radix-2, the butterfly)
  7. 100Solve with me: the DFT

Part 9

Sampling and multirate

What sampling does to a spectrum, and how to change a sample rate cleanly.

16 lessons

See the 16 lessons planned
  1. 101Sampling makes copies of the spectrum
  2. 102The sampling theorem and reconstruction
  3. 103Aliasing in the frequency picture, and the anti-alias filter
  4. 104Why change a sampling rate
  5. 105Up-sampling: zeros in, images out
  6. 106The interpolation filter: removing images, gain L
  7. 107Down-sampling: keep every Mth sample
  8. 108Down-sampling in frequency: stretched copies that overlap
  9. 109Specifying interpolation and decimation filters
  10. 110Changing the rate by a fraction L/M
  11. 111Multistage interpolation: why stages save taps
  12. 112Multistage decimation
  13. 113Interpolated low-pass filter design
  14. 114The digital differentiator
  15. 115Solve with me: interpolation and decimation
  16. 116Solve with me: fractional and multistage rate change

New lessons go up as each video is published. The plan grows when an idea needs more room: a lesson is split, never rushed.

Free weekly email

Know when the next lesson is out.

The week's new lessons, the daily facts in one place, one thing to try in the lab and one puzzle. Free.

No spam. One click to leave.