dsp + golden net: prep for the encoder relocation (modular-backends part 3a/3b) - #3
Merged
Conversation
Move the biquad/Butterworth filters and the band-splitting peak extractor (BiquadCoeffs, ButterworthLow/High, ApplyBiquad, SplitBandsAndPeaks) into a new stdlib-only `dsp` package, so both the analyzer and the soon-to-move Pioneer encoders can share them without depending on the whole analysis package. SplitBandsAndPeaks is parameterized on its crossover frequencies (callers pass the analysis-level BandBassMidHz/BandMidTrebleHz) to keep dsp brand-agnostic. Pure relocation — behavior unchanged; the PWV4/5/6/7 golden hashes and the band-waveform tests are byte-for-byte identical.
Detailed staging (3a–3e) for moving the Pioneer wire encoders into link/prolink and flipping to serve-time encoding, with the risk/verification per step and the real-CDJ smoke-test gate on the flow flip. Anchors the encoder-relocation branch alongside the modular-backends ADR.
… (part 3b) Lock GeneratePQT2, GenerateBeatGrid[FromBeats], GeneratePSSI, GeneratePVB2, and GeneratePVBR byte-for-byte against synthetic deterministic inputs (a fixed 120-BPM beat grid + phrase set), completing the golden safety net over the Pioneer wire encoders ahead of the 3c relocation. Test-only.
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.
Summary
Low-risk groundwork for relocating the Pioneer wire encoders (part 3c, a follow-up PR). Two things, both additive with zero behavior change:
dsppackage — the low-level signal-processing primitives the analyzer and the (soon-to-move) encoders both need.Landing this first means part 3c is fully guarded before it starts.
What's in it
dsp/(part 3a) — new stdlib-only package withBiquadCoeffs,ButterworthLow/ButterworthHigh,ApplyBiquad, andSplitBandsAndPeaks, moved out ofanalysis/waveform.go.SplitBandsAndPeaksis parameterized on its crossover frequencies (callers pass the analysis-levelBandBassMidHz/BandMidTrebleHz) sodspstays brand-agnostic.analysis(bothwaveform.goandbandwaveform.go) now imports it. Pure relocation.Golden tests (part 3b) — byte-for-byte hash tests for the encoders that had none:
GeneratePQT2,GenerateBeatGrid,GenerateBeatGridFromBeats,GeneratePSSI,GeneratePVB2,GeneratePVBR, against deterministic synthetic inputs (a fixed 120-BPM beat grid + phrase set) that isolate the encoder from the detector. Together with the existing PWV4/5/6/7 tests, all 10 Pioneer wire encoders are now locked.docs/design/part3-encoder-relocation.md— the detailed 3a–3e plan (relocate encoders → flip to serve-time encoding), with the risk/verification per step and the real-CDJ smoke-test gate on the flow flip. Anchors the follow-up.Why it's safe
dspextraction is byte-identical), and the 6 new blob hashes are deterministic (verified-count=2).Verification
go build ./...✅ ·go vet ./dsp/ ./analysis/✅ ·gofmt -lclean ✅go test ./analysis/ ./dsp/✅ — all 10 golden hashes byte-for-byte, plus the band-waveform /core.Analysistests.Next
Part 3c (move the encoders into
link/prolink/anlz) and 3d (neutral cache + serve-time encoding) land as their own PR — the latter with a real-CDJ smoke test before merge. This PR just makes that move safe to attempt.Where to look
dsp/biquad.go+dsp/bands.goare the whole new package;analysis/blob_golden_test.goshows the new guardrails; the plan doc frames what's coming.