#ifndef INCLUDED_FFT_HH #define INCLUDED_FFT_HH #include #include namespace math { // Reorders the elements of vals as they would appear in the call-tree // of the recursive fft. // pre: vals.size() == 2^k // post: vals_out[i] = vals_in[bitReverse(i)] template void bitReverse(std::vector >& vals); // Simple recursive fft. // The size of vals must be a power of 2. template void fftRecursive(const std::vector >& vals, std::vector >& rvals, int dir); // Simple iterative Inplace fft. // The size of vals must be a power of 2. template void fftInplace(std::vector >& vals,int dir); // Simple recursive fft for 2 REAL sequences. // The size of the vals must be a power of 2. template void fftRealRecursive(const std::vector<_REAL>& vals1, const std::vector<_REAL>& vals2, std::vector<_REAL>& rvals1, std::vector<_REAL>& rvals2, int dir); // Simple recursive fft for 2 REAL sequences. // The size of the vals must be a power of 2. template void fftRealInplace(std::vector<_REAL>& vals1, std::vector<_REAL>& vals2, int dir); // Simple (quadratic) dft. template void dft(const std::vector >& vals, std::vector >& rvals, int dir); } #include "fft.cpp" #endif