22w: faithful mask-shaping chain v1 behind RT_FAITHFUL (fnfaith.cpp) — exact 180533340 freq-warped bidir-IIR coefficients (fc_bin=85@48k/4096, constants from dump); corpus TOTAL 5.315 but comb 2.57 best-ever; decisive: mask shape cannot balance dual tones -> level contrast is created by the DETECTOR (time-domain twin bank hypothesis priority #1)

This commit is contained in:
2026-08-23 17:04:23 +03:00
parent 34156315e6
commit 13c2d028bf
5 changed files with 200 additions and 0 deletions
+13
View File
@@ -4,6 +4,7 @@
#include "rt_mask_tables.hpp"
#include "rt_weights.hpp"
#include "fn529fe0.hpp"
#include "fnfaith.hpp"
#include <cmath>
#include <cstring>
#include <algorithm>
@@ -414,10 +415,22 @@ void FramedDetector::processFrame(const std::complex<double>* spectrum, float* m
for (size_t k = 0; k <= half; k++) mask[k] = 1.0f;
if (is_internal_grid(nfft_, sample_rate_)) {
// RT_FAITHFUL=1 (NOTES 22w): BLOCKMAP_529fe0 transcription path
static const int faithful = getenv("RT_FAITHFUL") ? atoi(getenv("RT_FAITHFUL")) : 0;
static const fnfaith::Params fparams = faithful ? fnfaith::params_from_env()
: fnfaith::Params{};
// same scale_factor as process_band_structural (line ~79)
constexpr float sf = 15.0f * 440.95f / 2048.0f;
for (size_t b = 0; b < bands_.size(); b++) {
std::vector<float> band_mask(nfft_, 1.0f);
if (faithful) {
fnfaith::band_mask_faithful(am_.data(), res_[b].data(), half + 1,
sample_rate_, sf, fparams,
band_mask.data());
} else {
process_band_structural(am_.data(), res_[b].data(), bands_[b],
band_mask.data(), nfft_, sample_rate_);
}
for (size_t k = 0; k <= half; k++) {
mask[k] = std::min(band_mask[k], mask[k]);
}