10 Commits
Author SHA1 Message Date
Matiq 2f854cd1da spectral: vectors instead of new[]; vlaw: extract law + vlaw_check target
- spectral.cpp: window_/buf_/tmp_buf_/fir_buf_/fir_freq_ as std::vector (no
  exception-leak in ctor, destructor = default)
- framed_model.hpp: extract vlaw_cut/vlaw_mask inline (BLOCKMAP:314 softplus)
- dsp/vlaw_check.cpp: unit test for law (monotonic, zero-level, delta, ref,
  comb-neutral) — PASS
- CMake: add vlaw_check target
- Guard: corpus --compare d=+0.000, fn529fe0_check PASS, twin_check PASS
2026-09-02 23:19:34 +03:00
Matiq 4d78785f0b cascade integration: sin-peak floor, complex twin resp storage, per-band cascade
- Add sin-peak floor mechanism (529c60): RT_CASC_SINPEAK param
  Formula: sin_peak = sin(param*30-90) * 0.115129 * peak_level
  Floor active for param in [3,9], max at param=6 (ln10/20=0.115129)
  Prevents over-reduction by clamping level curve from below

- Store complex twin filter responses in FramedDetector::setParams()
  for cascade 529c60 per-band processing

- Add cascade state persistence (fn529fe0::CascadeState per band)

- ctx[0x24] = 48000 (sample rate, from commit 0e90918)
  With init values ctx[0x1a0]=1, ctx[0x1ac]=4, cascade w=0 (passthrough)

- All tests pass: fn529fe0_check, render48k build OK
2026-08-27 03:12:56 +03:00
Matiq 16853d7e0b Integrate live-captured A/B/gamma params into framed_model; add CAP_ constants and parametric LUT helper 2026-08-20 22:59:21 +03:00
Matiq f8ecf6a1af P4: Phase B — framed_model re-transcribed to the confirmed chain (NOTES:199-226)
Fixes structural divergences: IIR1 into shared 0x5406f8 buffer + bridge to band
mask (FUN_18052d650, 0x5160); IIR2 on band mask; Hermitian mirror (0x11940);
blend step f6f8=axis(1-mix)+mix*0.8, mask=exp2(-mask)*f6f8; real combine via
kRTAtt/kRTRel weights (0x5406c8/6e8); warp, IIR3x2, dry/wet.

Validation: t1kq only1 fc1000 -21.1 vs -22.1 (OK); fc-scan shape intact;
dual @500 matches (s30 -51.5 vs -53.7), @2000 gap -4..-13 vs -29.6 remains.
That gap = dB-domain band LUT (FUN_180563a60) not yet in chain -> Phase A.
2026-08-20 17:16:22 +03:00
Matiq ddf2ac2050 P4: lock PRNG prologue + correct constants (DAT_*=1); scale via prng_fvar30
CRITICAL fix: soothe_mem.bin is VA-linear (offset=RVA). DAT_18262b5c8/b704/b700
are INT 1 (cvtdq2ps -> 1.0), NOT the 0.4552/0.6089/0.6070 read earlier via a bad
section offset. Transcribed FUN_180529fe0 PRNG prologue into prng_fvar30():
fVar30=(int)(LUT[s+1]*LUT[s]+0.001). At live state 112 this is deterministically
1.0 over 300 frames, so scale level *= (1/2048)*440.95 is not randomized in
practice. Scale coefficient now computed structurally; t1kq unchanged -0.43 dB.
2026-08-20 16:14:50 +03:00
Matiq d4a0a68584 P4: transcribe exact FUN_180529fe0 mask chain (structural, not yet calibrated)
framed_model.cpp now follows the decoded mono-path structure:
  level -> scale(0x540870*0x54088c/0x1a0) -> IIR1 leaky(A1/B1) -> IIR2(A2/B2)
  -> exp2(0.5*(mask-blend)) -> combine/acc -> warp -> IIR3(A3/B3)x2 -> dry/wet
IIR stages are the real live tables (iir_leaky y=A*acc+B*x, B=1-A). Removed the
empirical mask_lut=(1/(1+K*acc))^n. Not numerically calibrated yet: exp2 bigkernel
exact semantics + PRNG prologue (fVar30) + FFT-conv still TBD; t1kq depth -2.9 vs
-14.98 dB ref.
2026-08-20 15:10:29 +03:00
Matiq f23bbfa1f6 P4: decode FUN_180529fe0 mono-path exactly + extract live mask tables
Full decomp of the per-band mask-apply loop (scale -> IIR1/2/3 leaky ->
blend -> exp2 bigkernel -> combine/accumulate -> dual warp -> dry/wet -> FFT-conv).
Extracted runtime tables to rt_mask_tables.{hpp,cpp}: IIR A1/B1,A2/B2,A3/B3
(leaky y=A*acc+B*x, B=1-A), warp 0x5406a8, per-band 0x540768, PRNG LUT 0x5408b0.
bigkernel 0x26b820 = vectorized exp2 (log2e/floor/mantissa tables). Fixed the
broken warp line in framed_model.cpp (compiles again).
2026-08-20 15:00:53 +03:00
Matiq fc48a9fee4 P4: real mask chain in FramedDetector (level-tracker + accumulator + live-calibrated LUT), t1kq err 0.5dB
Replace empirical PCHIP detector with live-calibrated mask chain from FUN_180529fe0:
  level = am*res*scale; track += w*(level-track) (per-bin attack/release weights
  extracted from RT snapshot, rt_weights.hpp); acc = (level-track)+level; mask =
  (1/(1+K*acc))^n (K=9.8026 n=0.25966 fitted to live mask band0). min-combine.

Results (N=2048 hop=512): t1kq single-band err +0.51 dB (-14.47 vs -14.98 dB ref);
comb 4-band per-tone -3.4..+5.8 dB (old PCHIP over-cut comb ~6 dB). Adds framed_test
harness for C++ FramedDetector eval on tone1kq/comb.
2026-08-20 13:11:27 +03:00
Matiq 5c939583f5 P4: multi-band FramedDetector (per-band twin res, sens-scaled GAIN, min-combine); tt_base 61.40%; min-combine wrong (soothe2 uses additive accumulator 0x5407c8) 2026-08-20 10:41:24 +03:00
Matiq 0cdc57972c P4: port framed_render.py model to C++ (FramedDetector: twin-res -> level -> Pchip LUT -> warp -> res^rp gain), replace empirical Detector; tt_base 49.93%->61.45% (single-band); multi-band refs still 100% (model is single-band) 2026-08-20 10:31:43 +03:00