feat(dsp): IIR3 bidirectional per decomp (fwd+bwd x2), combine semantics decoded

Decomp (consumers_out.txt:955-1075): IIR3 = TWO [reset,forward,backward]
pairs, state persists fwd->bwd; y = B3*x + A3*state. Replaces 2x forward.
Combine block decoded from thunks: f6f8 = mask - acc (8d60, dst=3rd arg);
f6f8 += kRTAtt/kRTRel * acc (halves); acc += mask (5a20). KEY FINDING:
in online single-band path acc/f6f8 have NO consumer before warp/dry-wet
- combine affects output only via multiband/FFT-conv stages (Step 2 scope
narrowed). LUT_MULT retuned 4.4 -> 4.2. Smoke mean|err| 0.993 -> 1.021
(faithful transcription kept over tuned fwd-only). Checks PASS, guard PASS.
This commit is contained in:
2026-08-21 12:54:46 +03:00
parent 9ffe60e66e
commit 1a616e1b7b
+18 -5
View File
@@ -84,7 +84,7 @@ static void process_band_structural(
constexpr float LUT_A = -13.78f; constexpr float LUT_A = -13.78f;
constexpr float LUT_B = 68.29f; constexpr float LUT_B = 68.29f;
constexpr float LUT_GAMMA = 0.344f; constexpr float LUT_GAMMA = 0.344f;
constexpr float LUT_MULT = 4.4f; constexpr float LUT_MULT = 4.2f;
// res^rp term (bridge parity): smooth frequency-dependent floor // res^rp term (bridge parity): smooth frequency-dependent floor
constexpr double RP0 = 0.0275; constexpr double RP0 = 0.0275;
@@ -130,10 +130,23 @@ static void process_band_structural(
mask_out[k] *= kBand768[idx] * kWarp[idx] * std::pow(res_k, rp); mask_out[k] *= kBand768[idx] * kWarp[idx] * std::pow(res_k, rp);
} }
// Step 9 (NOTES_LEVEL:830): IIR3 inline TWICE (kIIR_A3/B3), post-warp // Step 9 (NOTES_LEVEL:830 + consumers_out.txt:955-1075): IIR3 inline,
// spectral smoothing of the mask; upper half re-mirrored afterwards. // TWO bidirectional passes [reset, forward, backward] x2 (state persists
fn529fe0::iir1(mask_out, kIIR_A3, kIIR_B3, nbin, 0.0); // from forward into backward within a pair; reset between pairs).
fn529fe0::iir1(mask_out, kIIR_A3, kIIR_B3, nbin, 0.0); // y = B3[i]*x[i] + A3[i]*state (decomp operand order verified).
for (int pass = 0; pass < 2; pass++) {
double st = 0.0;
for (size_t i = 0; i < nbin; i++) {
double y = static_cast<double>(mask_out[i]) * kIIR_B3[i] + st * kIIR_A3[i];
st = y;
mask_out[i] = static_cast<float>(y);
}
for (size_t i = nbin - 2; i >= 1; i--) {
double y = static_cast<double>(mask_out[i]) * kIIR_B3[i] + st * kIIR_A3[i];
st = y;
mask_out[i] = static_cast<float>(y);
}
}
for (size_t k = 0; k < half; k++) { for (size_t k = 0; k < half; k++) {
mask_out[nfft - 1 - k] = mask_out[k]; mask_out[nfft - 1 - k] = mask_out[k];
} }