jax
0b90ef1f - jax.scipy.fft.idct: compute the inverse with irfft instead of ifft

Commit
6 days ago
jax.scipy.fft.idct: compute the inverse with irfft instead of ifft `idct` built a full-length complex spectrum and ran a complex-to-complex `ifft`, then discarded the imaginary part. Since the coefficients are real, only the Hermitian part of the spectrum matters, and it can be assembled directly at half length -- a real-to-complex transform then does half the FFT work. `_dct_deinterleave` is also rewritten as a stack + reshape instead of a zero-fill plus two strided scatters. Up to 2.7x faster on GPU and 9.4x on CPU for batched inputs; max absolute difference vs the previous implementation is 3e-8 (float32).
Author
Committer
Parents
Loading