mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-30 13:08:07 -06:00
Every FFT stage was a generic DFT butterfly: p * p complex multiplications per butterfly (16 for radix 4) and a modulo on every twiddle index. Add kiss_fft-style kernels for radix 2, 3 and 4 (three twiddle multiplications and eight additions for radix 4, a sqrt(3)/2 constant for radix 3, +-j done by swapping parts). The generic butterfly stays for radix 5, which occurs once per transform, with its roots precomputed. The modulo is dropped: the twiddle index q * k * tw_stride is always below n. The results differ from before at f32 rounding level, so a few packets change on speech and hybrid input (CELT music stays byte-identical). A new test checks the FFT against a direct DFT for every radix combination up to the 480-point frame size. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>