Thursday, May 20, 2010

fft in python

the fft of a numpy array is simple and easy, as long as you don't care about performance. i'm finding that speed-critical is a bit more tricky. when i zero-pad to a power of 2 (typically up to 1024), i get a huge (~50 times) speed up. i would expect that a more well-tuned library would give an additional speedup over the default fftpack, but they were apparently removed from scipy in the 2008-2009 time frame. mkl from intel is reportedly the fastest, with a proprietary license. i think djbfft and fftw (fftw3) are probably comparable, though the public domain djbfft looks like abandonware at this point and fftw is gpl, so it might be problematic to depend on it for anything i'm shipping out. i've seen email list chatter about optional backends and conditional compilation, but i there's certainly nothing like that in my epd scipy.

No comments: