Skip to content

Add 3-band parametric EQ to speaker output#105

Draft
gburlingame wants to merge 1 commit into
developfrom
add-speaker-parametric-eq
Draft

Add 3-band parametric EQ to speaker output#105
gburlingame wants to merge 1 commit into
developfrom
add-speaker-parametric-eq

Conversation

@gburlingame
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a 3-band parametric EQ (peaking filters) applied to the speaker output in speaker_pipeline_output(), immediately before DAC output via I2S
  • Header-only biquad implementation using Q28 fixed-point arithmetic with int64_t accumulators (Direct Form I)
  • Three bands: 1825 Hz/-7.7 dB, 3542 Hz/-10.0 dB, 166 Hz/-6.1 dB — targeting mid and upper-mid resonances plus a low-frequency cut

Details

  • Coefficients pre-computed from Audio EQ Cookbook peaking EQ formulas at Fs = 48 kHz
  • EQ is applied to both L/R channels independently using static filter state
  • AEC reference signal is derived after EQ, so it accurately models speaker output
  • Estimated CPU cost: ~1.5 ms per 15 ms frame (~10% of thread budget at 100 MHz effective clock)

Files Changed

File Change
satellite-xmos-firmware/src/eq/biquad_eq.h New — header-only biquad EQ implementation
satellite-xmos-firmware/src/eq/bode_plot_eq.png New — frequency response plot
satellite-xmos-firmware/src/eq/EQ_CHANGES.md New — detailed design documentation
satellite-xmos-firmware/src/main.c Modified — integrate EQ into speaker output path

Test plan

  • Build firmware and verify no compilation errors
  • Flash device and confirm audio output with EQ applied
  • Verify frequency response matches expected Bode plot
  • Confirm AEC still functions correctly with EQ in the signal path

🤖 Generated with Claude Code

Introduces a header-only biquad EQ (Q28 fixed-point, Direct Form I)
applied in speaker_pipeline_output() before DAC output. Three peaking
bands (1825 Hz/-7.7 dB, 3542 Hz/-10.0 dB, 166 Hz/-6.1 dB) shape the
speaker frequency response. Estimated CPU cost ~1.5 ms per 15 ms frame
(~10% of thread budget).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@gnumpi gnumpi self-assigned this Mar 12, 2026
@gnumpi gnumpi marked this pull request as draft March 12, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants