Commits
Commits on
5a2f5efe3a0771ac7ca43d57bdf63c19a7b75ff6Filtered to crates/ec-dsp/src/mdct.rsClear filter2026-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.