Config::forSampleRate — rate-scaled defaults for non-48 kHz deployments#23
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The library-side fix for the finding from #22:
FilterSpecband edges andServoConfigbandwidths 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
-Werror; README's 16 kHz paragraph now points at the factory.https://claude.ai/code/session_01HuAFfoeD5a5Xe5aGNA16M9
Generated by Claude Code