Indexing is bottleneck for transforms. Switching to standard representation for FFT will resolve this. Right now the basis functions for the Fourier series are single ...