Skip to content

Config::forSampleRate — rate-scaled defaults for non-48 kHz deployments#23

Merged
tap merged 1 commit into
mainfrom
claude/rate-scaling
Jun 12, 2026
Merged

Config::forSampleRate — rate-scaled defaults for non-48 kHz deployments#23
tap merged 1 commit into
mainfrom
claude/rate-scaling

Conversation

@tap

@tap tap commented Jun 12, 2026

Copy link
Copy Markdown
Owner

The library-side fix for the finding from #22: FilterSpec band edges and ServoConfig bandwidths are absolute Hz designed for 48 kHz, and running another rate with unscaled defaults silently costs ~32 dB. Users shouldn't have to know the scaling rule — now they don't.

API

  • FilterSpec::scaledTo(rateHz) — band edges rescaled from the 48 kHz design rate (same L/T ⇒ identical normalized-frequency response).
  • ServoConfig::scaledTo(rateHz) — the six Hz fields scale with the rate; hold times scale inversely (promotion gates wait the same number of loop time constants); frame-denominated thresholds and ppm limits are rate-invariant and stay put.
  • Config::forSampleRate(rateHz) — composes both; the documented starting point for any non-48 kHz deployment.

Validation

  • The 16 kHz quality suite now runs through the factory instead of hand-scaling, making it the behavioral regression test for this API: measured 136.6 / 122.0 / 114.3 / 106.5 dB — identical to 16 kHz quality suite: rate-scaled config, measured thresholds, gtest filter fix #22's hand-scaled numbers within 0.1 dB (this also validates the inverse hold-time scaling, which the hand-scaled original didn't apply).
  • New fast unit test pins the scaling rule field by field (what scales, what must not).
  • Full host suite 51/51 under -Werror; README's 16 kHz paragraph now points at the factory.

https://claude.ai/code/session_01HuAFfoeD5a5Xe5aGNA16M9


Generated by Claude Code

FilterSpec::scaledTo and ServoConfig::scaledTo rescale the absolute-Hz
band edges, loop bandwidths and smoother corners from the 48 kHz design
rate (hold times scale inversely, keeping promotion gates at the same
loop-time-constant count); Config::forSampleRate composes them. The
16 kHz suite now runs through the factory and doubles as its behavioral
regression test: measured 136.6/122.0/114.3/106.5 dB - identical to the
hand-scaled originals within 0.1 dB. New fast unit test pins the
scaling rule field by field. Full suite 51/51.

https://claude.ai/code/session_01HuAFfoeD5a5Xe5aGNA16M9
@tap tap merged commit 1ebfb88 into main Jun 12, 2026
24 checks passed
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