forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on a7e1d4c2a137ca49bdbbcbd82bed574d0477ef4bFiltered to crates/ec-dsp/src/window.rsClear filter

2026-08-14

feat(dsp): FFT/DCT/MDCT/window primitivesAhmet Kaan Gümüş · 09790f6
feat(dsp): FFT/DCT/MDCT/window primitives

Radix-4/radix-2 Stockham FFT (power-of-two, 1..65536, f32 and f64),
real-input wrapper on the N/2 complex trick, DCT-II/III via Makhoul and
DCT-IV via an N/2 FFT, MDCT/IMDCT folded onto DCT-IV (AAC 2048/256 and
Vorbis/CELT sizes go through an N/4-point FFT), and sine/KBD/Vorbis
windows with fused application.

No feature gates: the fast transform is the only transform, and the only
O(n^2) code in the crate is the reference DFT/DCT/MDCT behind cfg(test).
Hot loops vectorise through wide on chunks_exact, so the bounds checks
fold; the scalar remainder is the same expression.

Accuracy vs the f64 reference, sizes 8..8192: 3.1e-15 f64, 1.3e-7 f32;
f32 forward+inverse round trip 1.6e-7 to n=32768; MDCT TDAC 2.2e-15 f64
/ 4.8e-7 f32 with every window shipped.