From e5e97003338b48544ad6417bb062331dea43253a Mon Sep 17 00:00:00 2001 From: Matiq Date: Fri, 21 Aug 2026 00:32:39 +0300 Subject: [PATCH] fix: restore pchip LUT in framed_model (revert 12094f8 regression) 12094f8 replaced the empirical Pchip LUT with the parametric linear form (CAP_A_LEVEL=-24/B=28/gamma=1). With gamma=1 the parametric form reduces to identity on xv=log10(am/res), which breaks the whole mask chain (t1kq fc-scan err jumps to ~7.9 dB). Re-instating lut_pchip restores the honest baseline: t1kq mean|err| 0.226 dB (was 7.9). Confirms NOTES_LEVEL F1 closure: no parametric LUT set beats Pchip at fixed bridge params; the structural A/B/gamma (level-path ctx+0x188) is the only real path to bytes, not this parametric substitution. --- dsp/framed_model.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsp/framed_model.cpp b/dsp/framed_model.cpp index 397651a..cc6d30b 100644 --- a/dsp/framed_model.cpp +++ b/dsp/framed_model.cpp @@ -139,7 +139,7 @@ void FramedDetector::processFrame(const std::complex* spectrum, float* m double res_k = std::max(static_cast(res_[b][k]), 1e-12); double lvl = static_cast(am_[k]) / res_k; double xv = std::log10(std::max(lvl, 1e-9)); - double C = G_FIT * lut_parametric(xv, CAP_A_LEVEL, CAP_B_LEVEL, CAP_GAMMA) + W_FIT * std::pow(warp_c(fk), A_FIT); + double C = G_FIT * lut_pchip(xv) + W_FIT * std::pow(warp_c(fk), A_FIT); double g = std::max(1.0 - C, 1e-9) * std::pow(res_k, rp); mask[k] = std::min(static_cast(g), mask[k]); fk += fstep;