RE: [SciPy-dev] fft benchmarks for new routines
Hi Pearu,
Then we should bench your algorithms also against FFTW as FFTW is faster than FFTPACK.
Where are the wrappers for FFTW? They seem to have disappeared from scipy, certainly they didn't come down with the latest CVS update. What order is preferred for the real transforms? The most natural order for my routine is real in the bottom and imaginary reversed in the top. Not reversing the top is easy, but interlacing real and imaginary is more difficult and time consuming. By the way, I think I can get rid of the out of cache issues pretty easily by chunking the data, but micro-optimization questions of efficient stack addressing come to mind. These sort of things tend to be processor and compiler dependent, and I don't want to get into that -- so maybe different routines for large and small transforms.
These generic functions give additional overhead and in principle we could implement them in C in future but right now it's better to keep them in Python until the interface stabilizes. After all, the overhead of calling Python functions will be relevant only for small fft sizes.
Yep, I looked at doing the checks in the C interface and decided to pass for the time being. Chuck _______________________________________________ Scipy-dev mailing list Scipy-dev@scipy.net http://www.scipy.net/mailman/listinfo/scipy-dev
Chuck, On Mon, 12 May 2003, Chuck Harris wrote:
Then we should bench your algorithms also against FFTW as FFTW is faster than FFTPACK.
Where are the wrappers for FFTW? They seem to have disappeared from scipy, certainly they didn't come down with the latest CVS update.
FFTW as well as other FFT backends are wrapped by scipy.fftpack. For example, see fftpack/src/zfft.c that defines void zfft(...) This C function calls either FFTW, FFTPACK or DJBFFT routines depending on whether cpp-macros WITH_DJBFFT or WITH_FFTW are defined. These macros are determined from calling scipy_distutils.system_info.get_info('djbfft') scipy_distutils.system_info.get_info('fftw') in fftpack/setup_fftpack.py. In general, setup_fftpack.py should pick up FFTW libraries when available, Otherwise FFTPACK is used. See fftpack/NOTES.txt for more information how to build scipy.fftpack with a particular FFT backend. The C function zfft itself is wrapped using f2py. See fftpack/_fftpack.pyf that defines _fftpack extension module. And finally, _fftpack.zfft is called from fft Python function defined in fftpack/basic.py.
What order is preferred for the real transforms? The most natural order for my routine is real in the bottom and imaginary reversed in the top.
So this is the same as in FFTW: http://www.fftw.org/fftw3_doc/The-Halfcomplex-format-DFT.html
Not reversing the top is easy, but interlacing real and imaginary is more difficult and time consuming.
scipy currently uses FFTPACK convention, that is, rfft(x) returns [y(0),Re(y(1)),Im(y(1)),...,Re(y(n/2))] where y is FT of real x. See scipy.fftpack.rfft.__doc__ for a complete definition. Btw, Numeric.real_fft uses the same convention (because it uses f2c version of FFTPACK) but returns y as a complex array. Pearu
participants (2)
-
Chuck Harris -
Pearu Peterson