forge
Explore
Log in

Don't you dare go Hollow

diag(aac-sbr): normative 640-tap QMF window embedded, checksum-pinned; bank replacement reverted, dead end recorded

Browse files at this commit

2928bfe72ff82a672c607c5d5d26a6b8dd3929fcAhmet Kaan GümüşParent: 6f27127
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.rsmodified+1 -0
@@ -36,6 +36,7 @@ mod sbr_env;
36 mod sbr_hf;36 mod sbr_hf;
37 mod sbr_payload;37 mod sbr_payload;
38 pub mod sbr_qmf;38 pub mod sbr_qmf;
39+mod sbr_qmf_window;
39 mod sbr_tables;40 mod sbr_tables;
40 pub mod tables;41 pub mod tables;
41 42
crates/ec-aac/src/sbr_qmf_window.rsadded+205 -0
@@ -0,0 +1,205 @@
1+//! ISO/IEC 14496-3 4.6.18.4/4.6.18.8 QMF prototype filter: the normative
2+//! 640-tap coefficient table, cross-validated from two independent sources
3+//! (checksum: sum, sum-of-squares, max and its index).
4+//!
5+//! NOT wired into `crate::sbr_qmf` -- see that module and the ledger for why
6+//! this round reverted: every analysis/synthesis carrier-phase and
7+//! window-derivation hypothesis tried against this table (the literal
8+//! folded 4.6.18.4/4.6.18.8 reading a review produced, and several
9+//! offset/omega variants of the prior fitted bank's own convention) failed
10+//! to round-trip a broadband signal above ~0.70 correlation (the folded
11+//! reading specifically collapsed to ~0.03-0.05, i.e. not even
12+//! structurally close), so `sbr_qmf` still runs its own fitted Kaiser bank.
13+//! This table is kept, checksum-pinned, as a verified input for the next
14+//! attempt.
15+
16+/// The normative 640-tap QMF prototype, index 0..639. Not currently
17+/// consumed by `sbr_qmf` (see the module doc); kept and checksum-pinned for
18+/// the next attempt at the normative bank.
19+#[allow(dead_code)]
20+pub const QMF_WINDOW: [f64; 640] = [
21+ 0.00000000000000000e+00, -5.52528650469999959e-04, -5.61769257379999957e-04, -4.94751808959999987e-04,
22+ -4.87522797119999997e-04, -4.89379124979999946e-04, -5.04071434970000047e-04, -5.22656429719999959e-04,
23+ -5.46656563370000030e-04, -5.67780256129999956e-04, -5.87093048519999987e-04, -6.13274739379999958e-04,
24+ -6.31249353189999992e-04, -6.54033336209999989e-04, -6.77769077639999947e-04, -6.94161462730000039e-04,
25+ -7.15773647440000002e-04, -7.25504312220000042e-04, -7.44094185410000010e-04, -7.49059805319999975e-04,
26+ -7.68137192699999954e-04, -7.72484859490000044e-04, -7.83433228769999952e-04, -7.77986949269999996e-04,
27+ -7.80366470999999963e-04, -7.80144962570000029e-04, -7.75797733100000030e-04, -7.63079357570000034e-04,
28+ -7.53000142009999985e-04, -7.31935715250000033e-04, -7.21539198759999986e-04, -6.91793753720000050e-04,
29+ -6.65041508930000035e-04, -6.34159490250000017e-04, -5.94611893300000041e-04, -5.56457639060000016e-04,
30+ -5.14557221080000023e-04, -4.60632548030000006e-04, -4.09512145219999985e-04, -3.50117587559999998e-04,
31+ -2.89698117479999975e-04, -2.09833734399999996e-04, -1.44638093489999996e-04, -6.17334407200000046e-05,
32+ 1.34949741799999995e-05, 1.09438312739999999e-04, 2.04301706880000004e-04, 2.94953110410000024e-04,
33+ 4.02654021600000011e-04, 5.10738849519999974e-04, 6.23937613909999957e-04, 7.45802588650000000e-04,
34+ 8.60844332620000052e-04, 9.88598830149999995e-04, 1.12501551306999994e-03, 1.25778846474999990e-03,
35+ 1.39024948271999991e-03, 1.54432198470999993e-03, 1.68680832531000000e-03, 1.83482654223999998e-03,
36+ 1.98411407369000021e-03, 2.14615835557000010e-03, 2.30172547746000005e-03, 2.46256169126000003e-03,
37+ 2.62017586901999982e-03, 2.78704643465000007e-03, 2.94694477164999993e-03, 3.11254206525000011e-03,
38+ 3.27396134846999996e-03, 3.44188741827999986e-03, 3.60082681231000019e-03, 3.76039229103999981e-03,
39+ 3.92074323702999977e-03, 4.08197531935000028e-03, 4.22642692269999988e-03, 4.37307196780999975e-03,
40+ 4.52098527825000023e-03, 4.66064606118000036e-03, 4.79325608497999968e-03, 4.91376035744999981e-03,
41+ 5.03930226012999985e-03, 5.14073539031999985e-03, 5.24611661323999990e-03, 5.34716811981999964e-03,
42+ 5.41967759306999971e-03, 5.48760401507000003e-03, 5.54757145088000028e-03, 5.59380230045000010e-03,
43+ 5.62206432097000011e-03, 5.64551969164000036e-03, 5.63891995151000018e-03, 5.62661141931999984e-03,
44+ 5.59171286630000004e-03, 5.54043639400000031e-03, 5.47537830770000039e-03, 5.38389758970000010e-03,
45+ 5.27157587272000013e-03, 5.13822754514000040e-03, 4.98396877629000024e-03, 4.81094690599999982e-03,
46+ 4.60395301470999975e-03, 4.38018617447000040e-03, 4.12516423269999963e-03, 3.84564081245999988e-03,
47+ 3.54012465506999994e-03, 3.20918858098000019e-03, 2.84467578623000001e-03, 2.45085400321000011e-03,
48+ 2.02741761850000002e-03, 1.57846825767999992e-03, 1.09023290512000001e-03, 5.83226424800000029e-04,
49+ 2.76045190500000009e-05, -5.46428086640000032e-04, -1.15681355226999994e-03, -1.80394725893000003e-03,
50+ -2.48267236448999982e-03, -3.19337783899999996e-03, -3.94011240521999987e-03, -4.72225962399999959e-03,
51+ -5.53372111087999975e-03, -6.37922932685000034e-03, -7.26158168517000019e-03, -8.17982333726000044e-03,
52+ -9.13253296085000076e-03, -1.01150215498599996e-02, -1.11315548032100003e-02, -1.21849995950799993e-02,
53+ 1.32718220035100004e-02, 1.43904666079200001e-02, 1.55405553342300006e-02, 1.67324712998900005e-02,
54+ 1.79433381344300015e-02, 1.91872431369799999e-02, 2.04531793355499994e-02, 2.17467550253499994e-02,
55+ 2.30680169286200006e-02, 2.44160992028500008e-02, 2.57875847546699989e-02, 2.71859429632900010e-02,
56+ 2.86072173638499995e-02, 3.00502657427899993e-02, 3.15017608738899987e-02, 3.29754081033699978e-02,
57+ 3.44620948768599999e-02, 3.59697560554200005e-02, 3.74812850425199975e-02, 3.90053679474499995e-02,
58+ 4.05349170558400029e-02, 4.20649094636700027e-02, 4.36097542130400029e-02, 4.51488405641300022e-02,
59+ 4.66843027264199975e-02, 4.82165720067199988e-02, 4.97385755601399970e-02, 5.12556155521600026e-02,
60+ 5.27630746520700022e-02, 5.42452768358899981e-02, 5.57173648213799971e-02, 5.71616450129900019e-02,
61+ 5.85915683626000022e-02, 5.99837480176100002e-02, 6.13455171720699993e-02, 6.26857808117199933e-02,
62+ 6.39715898068100031e-02, 6.52247106438000046e-02, 6.64367512210399941e-02, 6.76075985122800011e-02,
63+ 6.87043828351199953e-02, 6.97630244712700021e-02, 7.07628710726599941e-02, 7.17002673110199995e-02,
64+ 7.25682583308299989e-02, 7.33620255080300043e-02, 7.41003642434199944e-02, 7.47452558119399979e-02,
65+ 7.53137336201900043e-02, 7.58008358658399939e-02, 7.61992479339600043e-02, 7.64992170411900041e-02,
66+ 7.67093490424499980e-02, 7.68173975696399974e-02, 7.68230011392300044e-02, 7.67204924174599984e-02,
67+ 7.65050718319399969e-02, 7.61748321853600030e-02, 7.57305756506100047e-02, 7.51576255287000061e-02,
68+ 7.44664394756399950e-02, 7.36406005762000049e-02, 7.26774642729900028e-02, 7.15826364790300013e-02,
69+ 7.03533073509299972e-02, 6.89664013195099984e-02, 6.74525021516600015e-02, 6.57690668650799948e-02,
70+ 6.39444805963299973e-02, 6.19602779038700008e-02, 5.98166570808999973e-02, 5.75152691986699979e-02,
71+ 5.50460034300900014e-02, 5.24093821736600005e-02, 4.95978676344500033e-02, 4.66303305170100019e-02,
72+ 4.34768782195799966e-02, 4.01458278412700001e-02, 3.66418116813300027e-02, 3.29583930669100009e-02,
73+ 2.90824006012499990e-02, 2.50307561890899984e-02, 2.07997072862199997e-02, 1.63701258222800003e-02,
74+ 1.17623832785699999e-02, 6.96368621616999962e-03, 1.97656014503000020e-03, -3.20868968303999981e-03,
75+ -8.57117491365999920e-03, -1.41288827355800003e-02, -1.98834129257299992e-02, -2.58227288806400015e-02,
76+ -3.19531274533199974e-02, -3.82776572082200034e-02, -4.47806821585600007e-02, -5.14804176793400015e-02,
77+ -5.83705326833600033e-02, -6.54409853135899944e-02, -7.26943300812900040e-02, -8.01372934427899974e-02,
78+ -8.77547536559299957e-02, -9.55533352891400067e-02, -1.03532953114629997e-01, -1.11682693177299994e-01,
79+ -1.20007798467999999e-01, -1.28500285038779999e-01, -1.37155176119340000e-01, -1.45976649118700008e-01,
80+ -1.54960707106050005e-01, -1.64095885566689997e-01, -1.73380817217060001e-01, -1.82817254851420002e-01,
81+ -1.92396674572670012e-01, -2.02125017681030000e-01, -2.11973585380559992e-01, -2.21965269641489993e-01,
82+ -2.32069087067909990e-01, -2.42301688459740011e-01, -2.52648030957219993e-01, -2.63105329946029975e-01,
83+ -2.73663404056250004e-01, -2.84321418910849999e-01, -2.95071671706459981e-01, -3.05909857519160000e-01,
84+ -3.16827891364560021e-01, -3.27811372721049987e-01, -3.38872269386649994e-01, -3.49991412293099990e-01,
85+ 3.61158990313549977e-01, 3.72379554630610010e-01, 3.83635001390429997e-01, 3.94921176156749987e-01,
86+ 4.06231767676250022e-01, 4.17569689684089973e-01, 4.28911992073729986e-01, 4.40255375436649998e-01,
87+ 4.51599653568240000e-01, 4.62930808527570015e-01, 4.74245321461150005e-01, 4.85525309110990011e-01,
88+ 4.96770825457070020e-01, 5.07981750004339982e-01, 5.19123497023910030e-01, 5.30224089568550050e-01,
89+ 5.41255344873220023e-01, 5.52205125850609990e-01, 5.63078914013700027e-01, 5.73852413169229969e-01,
90+ 5.84540323546789975e-01, 5.95112308624960007e-01, 6.05578353891800036e-01, 6.15910993202909984e-01,
91+ 6.26124269560550006e-01, 6.36198010772859979e-01, 6.46126969594610023e-01, 6.55901630246709999e-01,
92+ 6.65513988016270042e-01, 6.74966319017120009e-01, 6.84235329345979970e-01, 6.93328237670320036e-01,
93+ 7.02238871935390030e-01, 7.10941042630950037e-01, 7.19446263495610028e-01, 7.27744890029940028e-01,
94+ 7.35821175827690022e-01, 7.43682786364880055e-01, 7.51313745612369965e-01, 7.58708076082419969e-01,
95+ 7.65867486509389961e-01, 7.72778088133269980e-01, 7.79428751902159989e-01, 7.85835312039199985e-01,
96+ 7.91973584164240019e-01, 7.97846641377000010e-01, 8.03448575185049974e-01, 8.08769500444910028e-01,
97+ 8.13819127062169967e-01, 8.18577600464679977e-01, 8.23041989054089984e-01, 8.27227534733600001e-01,
98+ 8.31103845715200018e-01, 8.34693736184019985e-01, 8.37971733788649975e-01, 8.40954139247219956e-01,
99+ 8.43623828120049990e-01, 8.45981846982060026e-01, 8.48031577707630047e-01, 8.49780519842679993e-01,
100+ 8.51197152493429976e-01, 8.52304703521470031e-01, 8.53102094970169977e-01, 8.53572057391070005e-01,
101+ 8.53738560059369989e-01, 8.53572057391070005e-01, 8.53102094970169977e-01, 8.52304703521470031e-01,
102+ 8.51197152493429976e-01, 8.49780519842679993e-01, 8.48031577707630047e-01, 8.45981846982060026e-01,
103+ 8.43623828120049990e-01, 8.40954139247219956e-01, 8.37971733788649975e-01, 8.34693736184019985e-01,
104+ 8.31103845715200018e-01, 8.27227534733600001e-01, 8.23041989054089984e-01, 8.18577600464679977e-01,
105+ 8.13819127062169967e-01, 8.08769500444910028e-01, 8.03448575185049974e-01, 7.97846641377000010e-01,
106+ 7.91973584164240019e-01, 7.85835312039199985e-01, 7.79428751902159989e-01, 7.72778088133269980e-01,
107+ 7.65867486509389961e-01, 7.58708076082419969e-01, 7.51313745612369965e-01, 7.43682786364880055e-01,
108+ 7.35821175827690022e-01, 7.27744890029940028e-01, 7.19446263495610028e-01, 7.10941042630950037e-01,
109+ 7.02238871935390030e-01, 6.93328237670320036e-01, 6.84235329345979970e-01, 6.74966319017120009e-01,
110+ 6.65513988016270042e-01, 6.55901630246709999e-01, 6.46126969594610023e-01, 6.36198010772859979e-01,
111+ 6.26124269560550006e-01, 6.15910993202909984e-01, 6.05578353891800036e-01, 5.95112308624960007e-01,
112+ 5.84540323546789975e-01, 5.73852413169229969e-01, 5.63078914013700027e-01, 5.52205125850609990e-01,
113+ 5.41255344873220023e-01, 5.30224089568550050e-01, 5.19123497023910030e-01, 5.07981750004339982e-01,
114+ 4.96770825457070020e-01, 4.85525309110990011e-01, 4.74245321461150005e-01, 4.62930808527570015e-01,
115+ 4.51599653568240000e-01, 4.40255375436649998e-01, 4.28911992073729986e-01, 4.17569689684089973e-01,
116+ 4.06231767676250022e-01, 3.94921176156749987e-01, 3.83635001390429997e-01, 3.72379554630610010e-01,
117+ -3.61158990313549977e-01, -3.49991412293099990e-01, -3.38872269386649994e-01, -3.27811372721049987e-01,
118+ -3.16827891364560021e-01, -3.05909857519160000e-01, -2.95071671706459981e-01, -2.84321418910849999e-01,
119+ -2.73663404056250004e-01, -2.63105329946029975e-01, -2.52648030957219993e-01, -2.42301688459740011e-01,
120+ -2.32069087067909990e-01, -2.21965269641489993e-01, -2.11973585380559992e-01, -2.02125017681030000e-01,
121+ -1.92396674572670012e-01, -1.82817254851420002e-01, -1.73380817217060001e-01, -1.64095885566689997e-01,
122+ -1.54960707106050005e-01, -1.45976649118700008e-01, -1.37155176119340000e-01, -1.28500285038779999e-01,
123+ -1.20007798467999999e-01, -1.11682693177299994e-01, -1.03532953114629997e-01, -9.55533352891400067e-02,
124+ -8.77547536559299957e-02, -8.01372934427899974e-02, -7.26943300812900040e-02, -6.54409853135899944e-02,
125+ -5.83705326833600033e-02, -5.14804176793400015e-02, -4.47806821585600007e-02, -3.82776572082200034e-02,
126+ -3.19531274533199974e-02, -2.58227288806400015e-02, -1.98834129257299992e-02, -1.41288827355800003e-02,
127+ -8.57117491365999920e-03, -3.20868968303999981e-03, 1.97656014503000020e-03, 6.96368621616999962e-03,
128+ 1.17623832785699999e-02, 1.63701258222800003e-02, 2.07997072862199997e-02, 2.50307561890899984e-02,
129+ 2.90824006012499990e-02, 3.29583930669100009e-02, 3.66418116813300027e-02, 4.01458278412700001e-02,
130+ 4.34768782195799966e-02, 4.66303305170100019e-02, 4.95978676344500033e-02, 5.24093821736600005e-02,
131+ 5.50460034300900014e-02, 5.75152691986699979e-02, 5.98166570808999973e-02, 6.19602779038700008e-02,
132+ 6.39444805963299973e-02, 6.57690668650799948e-02, 6.74525021516600015e-02, 6.89664013195099984e-02,
133+ 7.03533073509299972e-02, 7.15826364790300013e-02, 7.26774642729900028e-02, 7.36406005762000049e-02,
134+ 7.44664394756399950e-02, 7.51576255287000061e-02, 7.57305756506100047e-02, 7.61748321853600030e-02,
135+ 7.65050718319399969e-02, 7.67204924174599984e-02, 7.68230011392300044e-02, 7.68173975696399974e-02,
136+ 7.67093490424499980e-02, 7.64992170411900041e-02, 7.61992479339600043e-02, 7.58008358658399939e-02,
137+ 7.53137336201900043e-02, 7.47452558119399979e-02, 7.41003642434199944e-02, 7.33620255080300043e-02,
138+ 7.25682583308299989e-02, 7.17002673110199995e-02, 7.07628710726599941e-02, 6.97630244712700021e-02,
139+ 6.87043828351199953e-02, 6.76075985122800011e-02, 6.64367512210399941e-02, 6.52247106438000046e-02,
140+ 6.39715898068100031e-02, 6.26857808117199933e-02, 6.13455171720699993e-02, 5.99837480176100002e-02,
141+ 5.85915683626000022e-02, 5.71616450129900019e-02, 5.57173648213799971e-02, 5.42452768358899981e-02,
142+ 5.27630746520700022e-02, 5.12556155521600026e-02, 4.97385755601399970e-02, 4.82165720067199988e-02,
143+ 4.66843027264199975e-02, 4.51488405641300022e-02, 4.36097542130400029e-02, 4.20649094636700027e-02,
144+ 4.05349170558400029e-02, 3.90053679474499995e-02, 3.74812850425199975e-02, 3.59697560554200005e-02,
145+ 3.44620948768599999e-02, 3.29754081033699978e-02, 3.15017608738899987e-02, 3.00502657427899993e-02,
146+ 2.86072173638499995e-02, 2.71859429632900010e-02, 2.57875847546699989e-02, 2.44160992028500008e-02,
147+ 2.30680169286200006e-02, 2.17467550253499994e-02, 2.04531793355499994e-02, 1.91872431369799999e-02,
148+ 1.79433381344300015e-02, 1.67324712998900005e-02, 1.55405553342300006e-02, 1.43904666079200001e-02,
149+ -1.32718220035100004e-02, -1.21849995950799993e-02, -1.11315548032100003e-02, -1.01150215498599996e-02,
150+ -9.13253296085000076e-03, -8.17982333726000044e-03, -7.26158168517000019e-03, -6.37922932685000034e-03,
151+ -5.53372111087999975e-03, -4.72225962399999959e-03, -3.94011240521999987e-03, -3.19337783899999996e-03,
152+ -2.48267236448999982e-03, -1.80394725893000003e-03, -1.15681355226999994e-03, -5.46428086640000032e-04,
153+ 2.76045190500000009e-05, 5.83226424800000029e-04, 1.09023290512000001e-03, 1.57846825767999992e-03,
154+ 2.02741761850000002e-03, 2.45085400321000011e-03, 2.84467578623000001e-03, 3.20918858098000019e-03,
155+ 3.54012465506999994e-03, 3.84564081245999988e-03, 4.12516423269999963e-03, 4.38018617447000040e-03,
156+ 4.60395301470999975e-03, 4.81094690599999982e-03, 4.98396877629000024e-03, 5.13822754514000040e-03,
157+ 5.27157587272000013e-03, 5.38389758970000010e-03, 5.47537830770000039e-03, 5.54043639400000031e-03,
158+ 5.59171286630000004e-03, 5.62661141931999984e-03, 5.63891995151000018e-03, 5.64551969164000036e-03,
159+ 5.62206432097000011e-03, 5.59380230045000010e-03, 5.54757145088000028e-03, 5.48760401507000003e-03,
160+ 5.41967759306999971e-03, 5.34716811981999964e-03, 5.24611661323999990e-03, 5.14073539031999985e-03,
161+ 5.03930226012999985e-03, 4.91376035744999981e-03, 4.79325608497999968e-03, 4.66064606118000036e-03,
162+ 4.52098527825000023e-03, 4.37307196780999975e-03, 4.22642692269999988e-03, 4.08197531935000028e-03,
163+ 3.92074323702999977e-03, 3.76039229103999981e-03, 3.60082681231000019e-03, 3.44188741827999986e-03,
164+ 3.27396134846999996e-03, 3.11254206525000011e-03, 2.94694477164999993e-03, 2.78704643465000007e-03,
165+ 2.62017586901999982e-03, 2.46256169126000003e-03, 2.30172547746000005e-03, 2.14615835557000010e-03,
166+ 1.98411407369000021e-03, 1.83482654223999998e-03, 1.68680832531000000e-03, 1.54432198470999993e-03,
167+ 1.39024948271999991e-03, 1.25778846474999990e-03, 1.12501551306999994e-03, 9.88598830149999995e-04,
168+ 8.60844332620000052e-04, 7.45802588650000000e-04, 6.23937613909999957e-04, 5.10738849519999974e-04,
169+ 4.02654021600000011e-04, 2.94953110410000024e-04, 2.04301706880000004e-04, 1.09438312739999999e-04,
170+ 1.34949741799999995e-05, -6.17334407200000046e-05, -1.44638093489999996e-04, -2.09833734399999996e-04,
171+ -2.89698117479999975e-04, -3.50117587559999998e-04, -4.09512145219999985e-04, -4.60632548030000006e-04,
172+ -5.14557221080000023e-04, -5.56457639060000016e-04, -5.94611893300000041e-04, -6.34159490250000017e-04,
173+ -6.65041508930000035e-04, -6.91793753720000050e-04, -7.21539198759999986e-04, -7.31935715250000033e-04,
174+ -7.53000142009999985e-04, -7.63079357570000034e-04, -7.75797733100000030e-04, -7.80144962570000029e-04,
175+ -7.80366470999999963e-04, -7.77986949269999996e-04, -7.83433228769999952e-04, -7.72484859490000044e-04,
176+ -7.68137192699999954e-04, -7.49059805319999975e-04, -7.44094185410000010e-04, -7.25504312220000042e-04,
177+ -7.15773647440000002e-04, -6.94161462730000039e-04, -6.77769077639999947e-04, -6.54033336209999989e-04,
178+ -6.31249353189999992e-04, -6.13274739379999958e-04, -5.87093048519999987e-04, -5.67780256129999956e-04,
179+ -5.46656563370000030e-04, -5.22656429719999959e-04, -5.04071434970000047e-04, -4.89379124979999946e-04,
180+ -4.87522797119999997e-04, -4.94751808959999987e-04, -5.61769257379999957e-04, -5.52528650469999959e-04,
181+];
182+
183+#[cfg(test)]
184+mod tests {
185+ use super::*;
186+
187+ #[test]
188+ fn checksum_matches_the_cross_validated_source() {
189+ let sum: f64 = QMF_WINDOW.iter().sum();
190+ let sum_sq: f64 = QMF_WINDOW.iter().map(|v| v * v).sum();
191+ let mut max = f64::MIN;
192+ let mut argmax = 0usize;
193+ for (i, &v) in QMF_WINDOW.iter().enumerate() {
194+ if v > max {
195+ max = v;
196+ argmax = i;
197+ }
198+ }
199+ assert!((sum - 8.14630094365516442e+01).abs() < 1e-9, "sum={sum}");
200+ assert!((sum_sq - 6.40000000000000284e+01).abs() < 1e-9, "sum_sq={sum_sq}");
201+ assert!((max - 8.53738560059369989e-01).abs() < 1e-12, "max={max}");
202+ assert_eq!(argmax, 320);
203+ }
204+}
205+