#99

Makefile: pass 48000 Hz sample rate to eq-w0.py

OpenPranshulSoniwants to merge intofrom

scripts/eq-w0.py expects the sample rate in Hz as its second argument to precalculate angular frequencies (w0) for the 10 Graphic EQ bands.

In the Makefile, it was being called with 8 instead of 48000, which generated coefficients for an 8 Hz sample rate (giving 31.25 Hz a phase of 3.9 instead of ~0.00065). This caused the biquad filters to produce garbage values and silenced the Graphic EQ effect.

This defines SAMPLE_RATE = 48000 in the Makefile and passes it to eq-w0.py, while also using it across the PLAY and ffmpeg rules for consistency. It also adds a test in tests/eq.c that checks the table values and basic filter response.

Activity

2
copilot-pull-request-reviewer[bot]reviewed1mo ago
copilot-pull-request-reviewer[bot]1mo ago

🟢 Approval recommended

The Makefile fix directly addresses the described root cause and the added test meaningfully guards against regressions in EQ table generation and basic filter behavior.

Pull request overview

Fixes the Graphic EQ coefficient generation by passing the correct 48 kHz sample rate to scripts/eq-w0.py, and adds a regression test to ensure the precomputed EQ band table matches the expected sin/cos values and that the EQ biquads produce finite output.

Changes:

  • Define SAMPLE_RATE = 48000 in the Makefile and use it consistently for ffplay, ffmpeg, and build/eq-w0.h generation.
  • Replace the incorrect eq-w0.py invocation argument (8) with $(SAMPLE_RATE) to generate correct EQ_W0 values.
  • Add tests/eq.c and wire it into make test as test-eq.
File summaries
FileDescription
MakefileCentralizes sample-rate configuration and fixes EQ table generation input; adds a new EQ test target.
tests/eq.cNew regression test validating EQ_W0 table values and basic EQ filter stability/finite output.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.