📖 What Pearson does
Chapter 8 is about filters — circuits that pass some frequencies and block others. The three main types:
- Low-pass filter (LPF). Lets the low frequencies through, attenuates the highs. The “bass boost” on a hi-fi is an LPF.
- High-pass filter (HPF). Lets the highs through, attenuates the lows. The “telephone” EQ on a voice (or the wah pedal on a guitar) is an HPF.
- Band-pass filter (BPF). Lets a band of frequencies through, attenuates everything else. A radio tuner is a BPF.
Pearson distinguishes passive filters (made of resistors and capacitors only, no power) from active filters (which add an op-amp like the LM741 to amplify the signal). Active filters are sharper and more controllable.
Projects:
- The passive low-pass filter.
- The passive high-pass filter.
- The active high-pass filter.
- The active low-pass filter.
- The active band-pass filter.
🎓 Background: filters in software
A digital filter takes the incoming stream of audio samples and transforms it. The three main types are:
FILTER_LPF— low-pass.FILTER_HPF— high-pass.FILTER_BPF— band-pass.
AMY’s filter, like Pearson’s op-amp-based filter, has two controls:
filter_freq— where the cutoff happens (in Hz).filter_resonance— how aggressive the peak is at the cutoff (the “Q” factor).
In our firmware, the equivalent of “twist the cutoff knob on a
Moog” is Knob A in tweak FILTER mode — it adjusts filter_freq.
The equivalent of “twist the resonance knob” is Knob B in tweak
FILTER mode — it adjusts filter_resonance.
🔧 Try it on the device
Exercise 1: low-pass filter sweep.
Pick a melodic slot and trigger a note with different cutoff values:
> tweak_filter 10 0
> note 9 60
> tweak_filter 100 0
> note 9 60
> tweak_filter 200 0
> note 9 60
The first note is filtered very low — almost no high frequencies. The second note lets more highs through. The third is fully open. This is Pearson’s “sweep the cutoff knob” demo.
Exercise 2: with resonance.
> tweak_filter 50 100
> note 9 60
That sets cutoff to 50 (~1570 Hz) and resonance to 100. You’ll
hear a peak in the spectrum around 1.5 kHz. This is the “wah” — a
low-pass filter with high resonance, played around a fixed cutoff.
Move cutoff to 30, 200, 250 to hear different “wah” sounds.
Exercise 3: high-pass filter via FX.
The PO-33 has a punch-in effect called FILTER_SWEEP that is explicitly meant to drive the filter. With this FX active:
> fx FILTER_SWEEP
> note 9 60
the filter sweeps up over the duration of the note, opening from closed to fully open. That is the “filter sweep” sound from thousands of dance records.
🛠 Code reference
- The tweak-filter UI —
main/ui/knobs.c. The two ADCs on ESP32-S3 GPIO 2 (Knob A) and GPIO 46 (Knob B) read 0…4095 and scale to 0…255. - The filter application —
main/audio/amy_bridge.c,amy_bridge_play_note(). Lines aroundfilter_freq,filter_resonance,filter_typeset the AMY filter struct. - The FILTER_SWEEP FX —
main/audio/amy_bridge.c,apply_fx(),case PO33_FX_FILTER_SWEEP:. Triggers an automated sweep over the duration of the note.
🚫 What we can’t simulate
- The math. Pearson explains why filters work in terms of RC time constants and the Fourier transform. We don’t dive into the math here; we trust AMY’s filter to be correct. The reader who wants the math should read Pearson’s chapter 7 (and probably some Wikipedia on biquad filters).
- The active filter circuits. The op-amp-based active filter is a circuit, not a math formula. Our firmware has no analog of “supply the op-amp with ±12 V”; AMY’s filter is digital and operates on 16-bit integers.