Fast FFT and DCT based on FFTW