Biquad Filters (DSP with STM32) - Phil's Lab #172

Phil’s Lab
Phil’s LabApr 8, 2026

Why It Matters

Understanding and efficiently implementing biquad filters enables embedded designers to deliver stable, low‑latency audio processing on cost‑effective hardware, a critical advantage in today’s competitive DSP market.

Key Takeaways

  • Biquad filters form core of digital audio equalization.
  • Transposed Direct Form‑2 reduces memory and improves floating‑point accuracy.
  • Cascading stable second‑order sections avoids high‑order filter instability.
  • Coefficient updates should be ramped or cross‑faded to prevent transients.
  • STM32‑based pedal demonstrates real‑time biquad implementation on embedded hardware.

Summary

The video walks viewers through biquad filters, the second‑order IIR building blocks that underpin most digital audio processing, and shows how to move from theory to a working implementation on an STM32‑based guitar pedal. It covers block diagrams, transfer functions, and the practical steps needed to code the filters in C for a 24‑bit, 48 kHz audio codec.

Key technical insights include the distinction between Direct Form 1 and the more efficient Transposed Direct Form 2, which halves the required delay elements and improves numerical stability in floating‑point arithmetic. The presenter explains why cascading stable second‑order sections is preferred over designing high‑order filters directly, and outlines three common methods for deriving filter coefficients—from analog prototypes, bilinear transforms, and published EQ cookbook formulas. He also warns about quantization‑induced instability and the need for careful coefficient updates.

A notable quote from the host emphasizes the relevance: "Biquad filters are probably the single most important building block in digital audio." The demonstration uses two internal state variables (w1, w2) to compute output samples, illustrating how a simple set of multiply‑accumulate operations can realize low‑pass, high‑pass, band‑pass, and notch responses in real time. The video also highlights hardware considerations such as floating‑ versus fixed‑point arithmetic, double‑precision options, and the impact of PCB design on performance.

For developers, the tutorial shows that high‑quality audio effects can be achieved on modest embedded platforms without sacrificing stability or latency. By mastering biquad implementation, engineers can rapidly prototype configurable equalizers, crossovers, and other DSP effects, accelerating product development cycles for musical instruments and consumer audio devices.

Original Description

Theory and implementation of digital, discrete-time biquad filters on an STM32-based audio-processing system. Covering basics, implementation details, coefficient calculation, software implementation, and real-world tests.
Limited-time: $2 for 6-layer PCBs up to 100×100 mm - grab your $33 coupon now: https://jlcpcb.com/events/6-layer-pcb?from=PhilsLab (Ad)
Altium Develop: http://altium.com/yt/philslab (Ad)
[SUPPORT]
[LINKS]
[TIMESTAMPS]
00:00 Intro
02:02 JLCPCB (Ad)
03:37 Altium Develop (Ad)
04:42 Basics
07:02 Why use Biquads?
08:35 Transposed Direct Form II
09:58 Difference Equations
12:58 Computing Coefficients
15:33 Implementation
23:09 Lowpass Filter Test (2nd Order)
24:47 Cascading Biquads (4th Order LPF)
25:59 Outro

Comments

Want to join the conversation?

Loading comments...