From 2928bfe72ff82a672c607c5d5d26a6b8dd3929fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 20 Aug 2026 16:03:32 +0300 Subject: [PATCH] diag(aac-sbr): normative 640-tap QMF window embedded, checksum-pinned; bank replacement reverted, dead end recorded Charter: replace sbr_qmf's fitted Kaiser bank with the normative ISO/IEC 14496-3 4.6.18.4/4.6.18.8 analysis/synthesis pair built from the provided 640-tap prototype table. Embedded the table verbatim as crate::sbr_qmf_window::QMF_WINDOW with a checksum test (sum/sum-of-squares/max/argmax) -- passes, table transcription confirmed correct. Implemented and empirically tried, in order, against a broadband-noise round-trip correlation probe (independent of any real file): 1. The literal folded reading of 4.6.18.4/4.6.18.8 an external spec review produced (320-sample analysis buffer folded 5-way to 64 taps, carrier exp(j*pi/64*(k+0.5)*(2n-1)); 1280-sample synthesis overlap-add, carrier exp(j*pi/64*(k+0.5)*(2n-255)), synthesis window built by mirroring the 640-tap table to 1280 samples) -- broadband round-trip correlation plateaued at ~0.03-0.05 regardless of a grid search over analysis/ synthesis phase-intercept sign and offset (tried +-1, +-63, +-65, +-127, +-129, +-255, +-511, 0) and an alternating-sign fold variant. Not a near-miss: this structure does not reconstruct at all. 2. The prior fitted bank's own direct (unfolded) 640-tap-dot-product structure, with the real QMF_WINDOW table substituted for the fitted Kaiser prototype (no fold, theta = omega_step*(k+0.5)*(n+offset), one omega_step per bank) -- best found ~0.697 correlation (offset=bands/2, omega_step=pi/64 analysis / pi/128 synthesis, the fitted bank's own convention), well short of the fitted bank's own 0.9998 achieved only through its Kaiser-beta + cutoff fit. A grid over omega_step in {pi/64, pi/128} x2 banks and offset in {+-16, +-32} never exceeded ~0.70. Both avenues ruled out a fold-based reading of the reviewed equations outright, and showed the review's exact phase-intercept constants (-1, -255) are not simply a typo away from working with either window-derivation guess. Given no access to the literal ISO text (only a review's paraphrase, itself flagged "review, not ground truth") and no reference decoder's QMF internals to cross-check against, further correction is a guess-and-check search over an open constant space, not a bounded fix. Reverted crates/ec-aac/src/sbr_qmf.rs and sbr_hf.rs to HEAD (4346f31) to avoid shipping a QMF pair that round-trips at ~0.03-0.70 in place of one that round-trips the passband at ~0.9998 -- verified unchanged real-file numbers below. DONE-GATE, unchanged from baseline (revert confirmed exact): cargo test -p ec-aac --lib: 51 passed (50 baseline + 1 new window checksum test), 0 failed. reeln (44.1k): ch0 full-band corr 0.972474, ch1 0.969785 (both unchanged); below 5000Hz 0.992799/0.992329, above 5000Hz 0.761967/0.746352; whole-file windowed mean 0.955717/0.951577. FMJ (48k, kx=27): ch0 full-band corr -0.024069, ch1 0.010887 (both unchanged, pre-existing catastrophic decorrelation, separately tracked). sbr_qmf_window.rs's QMF_WINDOW is not wired into sbr_qmf (module doc there states why); kept for the next attempt, which needs either the literal ISO text or a reference decoder's QMF stage to check phase/window hypotheses against instead of guessing. --- crates/ec-aac/src/lib.rs | 1 + crates/ec-aac/src/sbr_qmf_window.rs | 205 ++++++++++++++++++++++++++++ 2 files changed, 206 insertions(+) create mode 100644 crates/ec-aac/src/sbr_qmf_window.rs diff --git a/crates/ec-aac/src/lib.rs b/crates/ec-aac/src/lib.rs index 2175849a..75c5aab7 100644 --- a/crates/ec-aac/src/lib.rs +++ b/crates/ec-aac/src/lib.rs @@ -36,6 +36,7 @@ mod sbr_env; mod sbr_hf; mod sbr_payload; pub mod sbr_qmf; +mod sbr_qmf_window; mod sbr_tables; pub mod tables; diff --git a/crates/ec-aac/src/sbr_qmf_window.rs b/crates/ec-aac/src/sbr_qmf_window.rs new file mode 100644 index 00000000..09ea3fd2 --- /dev/null +++ b/crates/ec-aac/src/sbr_qmf_window.rs @@ -0,0 +1,205 @@ +//! ISO/IEC 14496-3 4.6.18.4/4.6.18.8 QMF prototype filter: the normative +//! 640-tap coefficient table, cross-validated from two independent sources +//! (checksum: sum, sum-of-squares, max and its index). +//! +//! NOT wired into `crate::sbr_qmf` -- see that module and the ledger for why +//! this round reverted: every analysis/synthesis carrier-phase and +//! window-derivation hypothesis tried against this table (the literal +//! folded 4.6.18.4/4.6.18.8 reading a review produced, and several +//! offset/omega variants of the prior fitted bank's own convention) failed +//! to round-trip a broadband signal above ~0.70 correlation (the folded +//! reading specifically collapsed to ~0.03-0.05, i.e. not even +//! structurally close), so `sbr_qmf` still runs its own fitted Kaiser bank. +//! This table is kept, checksum-pinned, as a verified input for the next +//! attempt. + +/// The normative 640-tap QMF prototype, index 0..639. Not currently +/// consumed by `sbr_qmf` (see the module doc); kept and checksum-pinned for +/// the next attempt at the normative bank. +#[allow(dead_code)] +pub const QMF_WINDOW: [f64; 640] = [ + 0.00000000000000000e+00, -5.52528650469999959e-04, -5.61769257379999957e-04, -4.94751808959999987e-04, + -4.87522797119999997e-04, -4.89379124979999946e-04, -5.04071434970000047e-04, -5.22656429719999959e-04, + -5.46656563370000030e-04, -5.67780256129999956e-04, -5.87093048519999987e-04, -6.13274739379999958e-04, + -6.31249353189999992e-04, -6.54033336209999989e-04, -6.77769077639999947e-04, -6.94161462730000039e-04, + -7.15773647440000002e-04, -7.25504312220000042e-04, -7.44094185410000010e-04, -7.49059805319999975e-04, + -7.68137192699999954e-04, -7.72484859490000044e-04, -7.83433228769999952e-04, -7.77986949269999996e-04, + -7.80366470999999963e-04, -7.80144962570000029e-04, -7.75797733100000030e-04, -7.63079357570000034e-04, + -7.53000142009999985e-04, -7.31935715250000033e-04, -7.21539198759999986e-04, -6.91793753720000050e-04, + -6.65041508930000035e-04, -6.34159490250000017e-04, -5.94611893300000041e-04, -5.56457639060000016e-04, + -5.14557221080000023e-04, -4.60632548030000006e-04, -4.09512145219999985e-04, -3.50117587559999998e-04, + -2.89698117479999975e-04, -2.09833734399999996e-04, -1.44638093489999996e-04, -6.17334407200000046e-05, + 1.34949741799999995e-05, 1.09438312739999999e-04, 2.04301706880000004e-04, 2.94953110410000024e-04, + 4.02654021600000011e-04, 5.10738849519999974e-04, 6.23937613909999957e-04, 7.45802588650000000e-04, + 8.60844332620000052e-04, 9.88598830149999995e-04, 1.12501551306999994e-03, 1.25778846474999990e-03, + 1.39024948271999991e-03, 1.54432198470999993e-03, 1.68680832531000000e-03, 1.83482654223999998e-03, + 1.98411407369000021e-03, 2.14615835557000010e-03, 2.30172547746000005e-03, 2.46256169126000003e-03, + 2.62017586901999982e-03, 2.78704643465000007e-03, 2.94694477164999993e-03, 3.11254206525000011e-03, + 3.27396134846999996e-03, 3.44188741827999986e-03, 3.60082681231000019e-03, 3.76039229103999981e-03, + 3.92074323702999977e-03, 4.08197531935000028e-03, 4.22642692269999988e-03, 4.37307196780999975e-03, + 4.52098527825000023e-03, 4.66064606118000036e-03, 4.79325608497999968e-03, 4.91376035744999981e-03, + 5.03930226012999985e-03, 5.14073539031999985e-03, 5.24611661323999990e-03, 5.34716811981999964e-03, + 5.41967759306999971e-03, 5.48760401507000003e-03, 5.54757145088000028e-03, 5.59380230045000010e-03, + 5.62206432097000011e-03, 5.64551969164000036e-03, 5.63891995151000018e-03, 5.62661141931999984e-03, + 5.59171286630000004e-03, 5.54043639400000031e-03, 5.47537830770000039e-03, 5.38389758970000010e-03, + 5.27157587272000013e-03, 5.13822754514000040e-03, 4.98396877629000024e-03, 4.81094690599999982e-03, + 4.60395301470999975e-03, 4.38018617447000040e-03, 4.12516423269999963e-03, 3.84564081245999988e-03, + 3.54012465506999994e-03, 3.20918858098000019e-03, 2.84467578623000001e-03, 2.45085400321000011e-03, + 2.02741761850000002e-03, 1.57846825767999992e-03, 1.09023290512000001e-03, 5.83226424800000029e-04, + 2.76045190500000009e-05, -5.46428086640000032e-04, -1.15681355226999994e-03, -1.80394725893000003e-03, + -2.48267236448999982e-03, -3.19337783899999996e-03, -3.94011240521999987e-03, -4.72225962399999959e-03, + -5.53372111087999975e-03, -6.37922932685000034e-03, -7.26158168517000019e-03, -8.17982333726000044e-03, + -9.13253296085000076e-03, -1.01150215498599996e-02, -1.11315548032100003e-02, -1.21849995950799993e-02, + 1.32718220035100004e-02, 1.43904666079200001e-02, 1.55405553342300006e-02, 1.67324712998900005e-02, + 1.79433381344300015e-02, 1.91872431369799999e-02, 2.04531793355499994e-02, 2.17467550253499994e-02, + 2.30680169286200006e-02, 2.44160992028500008e-02, 2.57875847546699989e-02, 2.71859429632900010e-02, + 2.86072173638499995e-02, 3.00502657427899993e-02, 3.15017608738899987e-02, 3.29754081033699978e-02, + 3.44620948768599999e-02, 3.59697560554200005e-02, 3.74812850425199975e-02, 3.90053679474499995e-02, + 4.05349170558400029e-02, 4.20649094636700027e-02, 4.36097542130400029e-02, 4.51488405641300022e-02, + 4.66843027264199975e-02, 4.82165720067199988e-02, 4.97385755601399970e-02, 5.12556155521600026e-02, + 5.27630746520700022e-02, 5.42452768358899981e-02, 5.57173648213799971e-02, 5.71616450129900019e-02, + 5.85915683626000022e-02, 5.99837480176100002e-02, 6.13455171720699993e-02, 6.26857808117199933e-02, + 6.39715898068100031e-02, 6.52247106438000046e-02, 6.64367512210399941e-02, 6.76075985122800011e-02, + 6.87043828351199953e-02, 6.97630244712700021e-02, 7.07628710726599941e-02, 7.17002673110199995e-02, + 7.25682583308299989e-02, 7.33620255080300043e-02, 7.41003642434199944e-02, 7.47452558119399979e-02, + 7.53137336201900043e-02, 7.58008358658399939e-02, 7.61992479339600043e-02, 7.64992170411900041e-02, + 7.67093490424499980e-02, 7.68173975696399974e-02, 7.68230011392300044e-02, 7.67204924174599984e-02, + 7.65050718319399969e-02, 7.61748321853600030e-02, 7.57305756506100047e-02, 7.51576255287000061e-02, + 7.44664394756399950e-02, 7.36406005762000049e-02, 7.26774642729900028e-02, 7.15826364790300013e-02, + 7.03533073509299972e-02, 6.89664013195099984e-02, 6.74525021516600015e-02, 6.57690668650799948e-02, + 6.39444805963299973e-02, 6.19602779038700008e-02, 5.98166570808999973e-02, 5.75152691986699979e-02, + 5.50460034300900014e-02, 5.24093821736600005e-02, 4.95978676344500033e-02, 4.66303305170100019e-02, + 4.34768782195799966e-02, 4.01458278412700001e-02, 3.66418116813300027e-02, 3.29583930669100009e-02, + 2.90824006012499990e-02, 2.50307561890899984e-02, 2.07997072862199997e-02, 1.63701258222800003e-02, + 1.17623832785699999e-02, 6.96368621616999962e-03, 1.97656014503000020e-03, -3.20868968303999981e-03, + -8.57117491365999920e-03, -1.41288827355800003e-02, -1.98834129257299992e-02, -2.58227288806400015e-02, + -3.19531274533199974e-02, -3.82776572082200034e-02, -4.47806821585600007e-02, -5.14804176793400015e-02, + -5.83705326833600033e-02, -6.54409853135899944e-02, -7.26943300812900040e-02, -8.01372934427899974e-02, + -8.77547536559299957e-02, -9.55533352891400067e-02, -1.03532953114629997e-01, -1.11682693177299994e-01, + -1.20007798467999999e-01, -1.28500285038779999e-01, -1.37155176119340000e-01, -1.45976649118700008e-01, + -1.54960707106050005e-01, -1.64095885566689997e-01, -1.73380817217060001e-01, -1.82817254851420002e-01, + -1.92396674572670012e-01, -2.02125017681030000e-01, -2.11973585380559992e-01, -2.21965269641489993e-01, + -2.32069087067909990e-01, -2.42301688459740011e-01, -2.52648030957219993e-01, -2.63105329946029975e-01, + -2.73663404056250004e-01, -2.84321418910849999e-01, -2.95071671706459981e-01, -3.05909857519160000e-01, + -3.16827891364560021e-01, -3.27811372721049987e-01, -3.38872269386649994e-01, -3.49991412293099990e-01, + 3.61158990313549977e-01, 3.72379554630610010e-01, 3.83635001390429997e-01, 3.94921176156749987e-01, + 4.06231767676250022e-01, 4.17569689684089973e-01, 4.28911992073729986e-01, 4.40255375436649998e-01, + 4.51599653568240000e-01, 4.62930808527570015e-01, 4.74245321461150005e-01, 4.85525309110990011e-01, + 4.96770825457070020e-01, 5.07981750004339982e-01, 5.19123497023910030e-01, 5.30224089568550050e-01, + 5.41255344873220023e-01, 5.52205125850609990e-01, 5.63078914013700027e-01, 5.73852413169229969e-01, + 5.84540323546789975e-01, 5.95112308624960007e-01, 6.05578353891800036e-01, 6.15910993202909984e-01, + 6.26124269560550006e-01, 6.36198010772859979e-01, 6.46126969594610023e-01, 6.55901630246709999e-01, + 6.65513988016270042e-01, 6.74966319017120009e-01, 6.84235329345979970e-01, 6.93328237670320036e-01, + 7.02238871935390030e-01, 7.10941042630950037e-01, 7.19446263495610028e-01, 7.27744890029940028e-01, + 7.35821175827690022e-01, 7.43682786364880055e-01, 7.51313745612369965e-01, 7.58708076082419969e-01, + 7.65867486509389961e-01, 7.72778088133269980e-01, 7.79428751902159989e-01, 7.85835312039199985e-01, + 7.91973584164240019e-01, 7.97846641377000010e-01, 8.03448575185049974e-01, 8.08769500444910028e-01, + 8.13819127062169967e-01, 8.18577600464679977e-01, 8.23041989054089984e-01, 8.27227534733600001e-01, + 8.31103845715200018e-01, 8.34693736184019985e-01, 8.37971733788649975e-01, 8.40954139247219956e-01, + 8.43623828120049990e-01, 8.45981846982060026e-01, 8.48031577707630047e-01, 8.49780519842679993e-01, + 8.51197152493429976e-01, 8.52304703521470031e-01, 8.53102094970169977e-01, 8.53572057391070005e-01, + 8.53738560059369989e-01, 8.53572057391070005e-01, 8.53102094970169977e-01, 8.52304703521470031e-01, + 8.51197152493429976e-01, 8.49780519842679993e-01, 8.48031577707630047e-01, 8.45981846982060026e-01, + 8.43623828120049990e-01, 8.40954139247219956e-01, 8.37971733788649975e-01, 8.34693736184019985e-01, + 8.31103845715200018e-01, 8.27227534733600001e-01, 8.23041989054089984e-01, 8.18577600464679977e-01, + 8.13819127062169967e-01, 8.08769500444910028e-01, 8.03448575185049974e-01, 7.97846641377000010e-01, + 7.91973584164240019e-01, 7.85835312039199985e-01, 7.79428751902159989e-01, 7.72778088133269980e-01, + 7.65867486509389961e-01, 7.58708076082419969e-01, 7.51313745612369965e-01, 7.43682786364880055e-01, + 7.35821175827690022e-01, 7.27744890029940028e-01, 7.19446263495610028e-01, 7.10941042630950037e-01, + 7.02238871935390030e-01, 6.93328237670320036e-01, 6.84235329345979970e-01, 6.74966319017120009e-01, + 6.65513988016270042e-01, 6.55901630246709999e-01, 6.46126969594610023e-01, 6.36198010772859979e-01, + 6.26124269560550006e-01, 6.15910993202909984e-01, 6.05578353891800036e-01, 5.95112308624960007e-01, + 5.84540323546789975e-01, 5.73852413169229969e-01, 5.63078914013700027e-01, 5.52205125850609990e-01, + 5.41255344873220023e-01, 5.30224089568550050e-01, 5.19123497023910030e-01, 5.07981750004339982e-01, + 4.96770825457070020e-01, 4.85525309110990011e-01, 4.74245321461150005e-01, 4.62930808527570015e-01, + 4.51599653568240000e-01, 4.40255375436649998e-01, 4.28911992073729986e-01, 4.17569689684089973e-01, + 4.06231767676250022e-01, 3.94921176156749987e-01, 3.83635001390429997e-01, 3.72379554630610010e-01, + -3.61158990313549977e-01, -3.49991412293099990e-01, -3.38872269386649994e-01, -3.27811372721049987e-01, + -3.16827891364560021e-01, -3.05909857519160000e-01, -2.95071671706459981e-01, -2.84321418910849999e-01, + -2.73663404056250004e-01, -2.63105329946029975e-01, -2.52648030957219993e-01, -2.42301688459740011e-01, + -2.32069087067909990e-01, -2.21965269641489993e-01, -2.11973585380559992e-01, -2.02125017681030000e-01, + -1.92396674572670012e-01, -1.82817254851420002e-01, -1.73380817217060001e-01, -1.64095885566689997e-01, + -1.54960707106050005e-01, -1.45976649118700008e-01, -1.37155176119340000e-01, -1.28500285038779999e-01, + -1.20007798467999999e-01, -1.11682693177299994e-01, -1.03532953114629997e-01, -9.55533352891400067e-02, + -8.77547536559299957e-02, -8.01372934427899974e-02, -7.26943300812900040e-02, -6.54409853135899944e-02, + -5.83705326833600033e-02, -5.14804176793400015e-02, -4.47806821585600007e-02, -3.82776572082200034e-02, + -3.19531274533199974e-02, -2.58227288806400015e-02, -1.98834129257299992e-02, -1.41288827355800003e-02, + -8.57117491365999920e-03, -3.20868968303999981e-03, 1.97656014503000020e-03, 6.96368621616999962e-03, + 1.17623832785699999e-02, 1.63701258222800003e-02, 2.07997072862199997e-02, 2.50307561890899984e-02, + 2.90824006012499990e-02, 3.29583930669100009e-02, 3.66418116813300027e-02, 4.01458278412700001e-02, + 4.34768782195799966e-02, 4.66303305170100019e-02, 4.95978676344500033e-02, 5.24093821736600005e-02, + 5.50460034300900014e-02, 5.75152691986699979e-02, 5.98166570808999973e-02, 6.19602779038700008e-02, + 6.39444805963299973e-02, 6.57690668650799948e-02, 6.74525021516600015e-02, 6.89664013195099984e-02, + 7.03533073509299972e-02, 7.15826364790300013e-02, 7.26774642729900028e-02, 7.36406005762000049e-02, + 7.44664394756399950e-02, 7.51576255287000061e-02, 7.57305756506100047e-02, 7.61748321853600030e-02, + 7.65050718319399969e-02, 7.67204924174599984e-02, 7.68230011392300044e-02, 7.68173975696399974e-02, + 7.67093490424499980e-02, 7.64992170411900041e-02, 7.61992479339600043e-02, 7.58008358658399939e-02, + 7.53137336201900043e-02, 7.47452558119399979e-02, 7.41003642434199944e-02, 7.33620255080300043e-02, + 7.25682583308299989e-02, 7.17002673110199995e-02, 7.07628710726599941e-02, 6.97630244712700021e-02, + 6.87043828351199953e-02, 6.76075985122800011e-02, 6.64367512210399941e-02, 6.52247106438000046e-02, + 6.39715898068100031e-02, 6.26857808117199933e-02, 6.13455171720699993e-02, 5.99837480176100002e-02, + 5.85915683626000022e-02, 5.71616450129900019e-02, 5.57173648213799971e-02, 5.42452768358899981e-02, + 5.27630746520700022e-02, 5.12556155521600026e-02, 4.97385755601399970e-02, 4.82165720067199988e-02, + 4.66843027264199975e-02, 4.51488405641300022e-02, 4.36097542130400029e-02, 4.20649094636700027e-02, + 4.05349170558400029e-02, 3.90053679474499995e-02, 3.74812850425199975e-02, 3.59697560554200005e-02, + 3.44620948768599999e-02, 3.29754081033699978e-02, 3.15017608738899987e-02, 3.00502657427899993e-02, + 2.86072173638499995e-02, 2.71859429632900010e-02, 2.57875847546699989e-02, 2.44160992028500008e-02, + 2.30680169286200006e-02, 2.17467550253499994e-02, 2.04531793355499994e-02, 1.91872431369799999e-02, + 1.79433381344300015e-02, 1.67324712998900005e-02, 1.55405553342300006e-02, 1.43904666079200001e-02, + -1.32718220035100004e-02, -1.21849995950799993e-02, -1.11315548032100003e-02, -1.01150215498599996e-02, + -9.13253296085000076e-03, -8.17982333726000044e-03, -7.26158168517000019e-03, -6.37922932685000034e-03, + -5.53372111087999975e-03, -4.72225962399999959e-03, -3.94011240521999987e-03, -3.19337783899999996e-03, + -2.48267236448999982e-03, -1.80394725893000003e-03, -1.15681355226999994e-03, -5.46428086640000032e-04, + 2.76045190500000009e-05, 5.83226424800000029e-04, 1.09023290512000001e-03, 1.57846825767999992e-03, + 2.02741761850000002e-03, 2.45085400321000011e-03, 2.84467578623000001e-03, 3.20918858098000019e-03, + 3.54012465506999994e-03, 3.84564081245999988e-03, 4.12516423269999963e-03, 4.38018617447000040e-03, + 4.60395301470999975e-03, 4.81094690599999982e-03, 4.98396877629000024e-03, 5.13822754514000040e-03, + 5.27157587272000013e-03, 5.38389758970000010e-03, 5.47537830770000039e-03, 5.54043639400000031e-03, + 5.59171286630000004e-03, 5.62661141931999984e-03, 5.63891995151000018e-03, 5.64551969164000036e-03, + 5.62206432097000011e-03, 5.59380230045000010e-03, 5.54757145088000028e-03, 5.48760401507000003e-03, + 5.41967759306999971e-03, 5.34716811981999964e-03, 5.24611661323999990e-03, 5.14073539031999985e-03, + 5.03930226012999985e-03, 4.91376035744999981e-03, 4.79325608497999968e-03, 4.66064606118000036e-03, + 4.52098527825000023e-03, 4.37307196780999975e-03, 4.22642692269999988e-03, 4.08197531935000028e-03, + 3.92074323702999977e-03, 3.76039229103999981e-03, 3.60082681231000019e-03, 3.44188741827999986e-03, + 3.27396134846999996e-03, 3.11254206525000011e-03, 2.94694477164999993e-03, 2.78704643465000007e-03, + 2.62017586901999982e-03, 2.46256169126000003e-03, 2.30172547746000005e-03, 2.14615835557000010e-03, + 1.98411407369000021e-03, 1.83482654223999998e-03, 1.68680832531000000e-03, 1.54432198470999993e-03, + 1.39024948271999991e-03, 1.25778846474999990e-03, 1.12501551306999994e-03, 9.88598830149999995e-04, + 8.60844332620000052e-04, 7.45802588650000000e-04, 6.23937613909999957e-04, 5.10738849519999974e-04, + 4.02654021600000011e-04, 2.94953110410000024e-04, 2.04301706880000004e-04, 1.09438312739999999e-04, + 1.34949741799999995e-05, -6.17334407200000046e-05, -1.44638093489999996e-04, -2.09833734399999996e-04, + -2.89698117479999975e-04, -3.50117587559999998e-04, -4.09512145219999985e-04, -4.60632548030000006e-04, + -5.14557221080000023e-04, -5.56457639060000016e-04, -5.94611893300000041e-04, -6.34159490250000017e-04, + -6.65041508930000035e-04, -6.91793753720000050e-04, -7.21539198759999986e-04, -7.31935715250000033e-04, + -7.53000142009999985e-04, -7.63079357570000034e-04, -7.75797733100000030e-04, -7.80144962570000029e-04, + -7.80366470999999963e-04, -7.77986949269999996e-04, -7.83433228769999952e-04, -7.72484859490000044e-04, + -7.68137192699999954e-04, -7.49059805319999975e-04, -7.44094185410000010e-04, -7.25504312220000042e-04, + -7.15773647440000002e-04, -6.94161462730000039e-04, -6.77769077639999947e-04, -6.54033336209999989e-04, + -6.31249353189999992e-04, -6.13274739379999958e-04, -5.87093048519999987e-04, -5.67780256129999956e-04, + -5.46656563370000030e-04, -5.22656429719999959e-04, -5.04071434970000047e-04, -4.89379124979999946e-04, + -4.87522797119999997e-04, -4.94751808959999987e-04, -5.61769257379999957e-04, -5.52528650469999959e-04, +]; + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn checksum_matches_the_cross_validated_source() { + let sum: f64 = QMF_WINDOW.iter().sum(); + let sum_sq: f64 = QMF_WINDOW.iter().map(|v| v * v).sum(); + let mut max = f64::MIN; + let mut argmax = 0usize; + for (i, &v) in QMF_WINDOW.iter().enumerate() { + if v > max { + max = v; + argmax = i; + } + } + assert!((sum - 8.14630094365516442e+01).abs() < 1e-9, "sum={sum}"); + assert!((sum_sq - 6.40000000000000284e+01).abs() < 1e-9, "sum_sq={sum_sq}"); + assert!((max - 8.53738560059369989e-01).abs() < 1e-12, "max={max}"); + assert_eq!(argmax, 320); + } +} +