[SciPy-dev] fftpack2 for review
Pearu Peterson
pearu at cens.ioc.ee
Sat Sep 28 16:53:43 EDT 2002
Dear SciPy devels,
Please find a scipy.fftpack replacement candidate fftpack2 from
http://cens.ioc.ee/~pearu/misc/fftpack2-0.1.tar.gz
for review. fftpack2 main features include:
- Optional support for high-performance FFT libraries such as FFTW and
DJBFFT libraries. By default, Fortran FFTPACK is used and other
libraries are automatically detected by
the scipy_distutils/system_info.py script.
- Support for both real and complex DFT's and their inverse
transforms. When used with FFTW and/or DJBFFT libraries then fftpack2
routines are considerably faster than Numeric.FFT and the current
scipy.fftpack.
Some comparison timings are included at the end of this message.
- Implementation of differentiation and integration of periodic
sequences, various pseudo-differential operators such as Tilbert
transform, Hilbert transform, hyperbolic pseudo-differential
operators, their inverses, etc.
- Because different FFT libraries use different data storage convention,
fftpack2 implements interface to these conventions so that users
and developers need not to learn all these conventions, just
one is enough. Namely, fftpack2 uses the same data storage
specification as Fortran FFTPACK (also used by Numeric.FFT and
Matlab, though with somewhat different formal definitions).
- Generic convolution routines that allow quick and easy way of
introducing new pseudo-differential operators with the same
performance as core pseudo-differential operators.
- All functions have complete documentation strings.
- A rather complete testing site.
Note that fftpack2 requires the latest F2PY that you can get from
http://cens.ioc.ee/projects/f2py2e/2.x/F2PY-2-latest.tar.gz
For testing, fftpack2 uses scipy_test from SciPy CVS repository.
For building/testing instructions and for various notes, including open
questions, see NOTES.txt file after unpacking fftpack2-0.1.tar.gz.
As usual, comments, suggestions, and criticism are most welcome.
Regards,
Pearu
-------------------------------
fftpack2 timing results:
-------------------------------
Fast Fourier Transform
========================================================
| real input | complex input
--------------------------------------------------------
size |fftpack2| FFT | scipy |fftpack2| FFT | scipy
--------------------------------------------------------
100 | 0.38 | 0.39 | 0.38 | 0.40 | 0.40 | 0.38 (secs for7000calls)
1000 | 0.31 | 0.63 | 0.60 | 0.54 | 0.64 | 0.61 (secs for 2000
256 | 0.60 | 0.75 | 0.62 | 0.71 | 0.78 | 0.66 (secs for 10000
512 | 0.77 | 1.30 | 1.00 | 0.95 | 1.30 | 1.01 (secs for 10000
1024 | 0.14 | 0.26 | 0.18 | 0.17 | 0.25 | 0.19 (secs for 1000
2048 | 0.21 | 0.51 | 0.36 | 0.34 | 0.65 | 0.54 (secs for 1000
4096 | 0.28 | 1.08 | 0.66 | 0.56 | 0.93 | 0.79 (secs for 500
8192 | 1.09 | 3.88 | 3.94 | 2.19 | 4.36 | 3.48 (secs for 500
Inverse Fast Fourier Transform
========================================================
| real input | complex input
--------------------------------------------------------
size |fftpack2| FFT | scipy |fftpack2| FFT | scipy
--------------------------------------------------------
100 | 0.17 | 0.26 | 0.63 | 0.45 | 0.87 | 0.85 (secs for 7000
1000 | 0.34 | 1.24 | 1.25 | 0.72 | 1.29 | 1.29 (secs for 2000
256 | 0.62 | 1.57 | 1.44 | 0.69 | 1.62 | 1.47 (secs for 10000
512 | 0.80 | 2.69 | 2.30 | 1.00 | 2.62 | 2.20 (secs for 10000
1024 | 0.12 | 0.51 | 0.41 | 0.18 | 0.54 | 0.44 (secs for 1000
2048 | 0.23 | 1.16 | 1.09 | 0.40 | 1.33 | 1.27 (secs for 1000
4096 | 0.35 | 1.75 | 1.44 | 0.63 | 1.72 | 1.54 (secs for 500
8192 | 1.34 | 5.71 | 6.02 | 2.40 | 6.14 | 5.67 (secs for 500
Multi-dimensional Fast Fourier Transform
========================================================
| real input | complex input
--------------------------------------------------------
size |fftpack2| FFT | scipy |fftpack2| FFT | scipy
--------------------------------------------------------
100x100 | 0.43 | 0.87 | 0.81 | 0.48 | 0.88 | 0.82 (secs for 100
1000x100 | 0.54 | 0.78 | 0.72 | 0.56 | 0.73 | 0.75 (secs for 7
256x256 | 0.69 | 0.72 | 0.62 | 0.67 | 0.72 | 0.64 (secs for 10
512x512 | 0.81 | 0.91 | 0.84 | 0.81 | 0.87 | 0.81 (secs for 3
Fast Fourier Transform (real data)
==================================
size |fftpack2| FFT | scipy
----------------------------------
100 | 0.36 | 0.47 | 0.47 (secs for 7000 calls)
1000 | 0.29 | 0.38 | 0.38 (secs for 2000 calls)
256 | 0.55 | 0.76 | 0.81 (secs for 10000 calls)
512 | 0.67 | 1.06 | 1.07 (secs for 10000 calls)
1024 | 0.10 | 0.18 | 0.17 (secs for 1000 calls)
2048 | 0.16 | 0.30 | 0.30 (secs for 1000 calls)
4096 | 0.20 | 0.37 | 0.32 (secs for 500 calls)
8192 | 0.75 | 1.29 | 1.26 (secs for 500 calls)
Inverse Fast Fourier Transform (real data)
==================================
size |fftpack2| FFT | scipy
----------------------------------
100 | 0.39 | 0.90 | 0.92 (secs for 7000 calls)
1000 | 0.32 | 0.63 | 0.70 (secs for 2000 calls)
256 | 0.59 | 1.37 | 1.39 (secs for 10000 calls)
512 | 0.73 | 1.70 | 1.80 (secs for 10000 calls)
1024 | 0.11 | 0.27 | 0.27 (secs for 1000 calls)
2048 | 0.20 | 0.45 | 0.44 (secs for 1000 calls)
4096 | 0.24 | 0.65 | 0.68 (secs for 500 calls)
8192 | 0.73 | 1.98 | 2.06 (secs for 500 calls)
Shifting periodic functions
==============================
size | optimized | naive
------------------------------
100 | 0.09 | 0.52 (secs for 1500 calls)
1000 | 0.06 | 0.66 (secs for 300 calls)
256 | 0.10 | 0.84 (secs for 1500 calls)
512 | 0.10 | 1.02 (secs for 1000 calls)
1024 | 0.07 | 1.07 (secs for 500 calls)
2048 | 0.06 | 0.80 (secs for 200 calls)
4096 | 0.00 | 0.86 (secs for 100 calls)
8192 | 0.13 | 1.23 (secs for 50 calls)
Differentiation of periodic functions
=====================================
size | convolve | naive
-------------------------------------
100 | 0.09 | 0.59 (secs for 1500 calls)
1000 | 0.06 | 0.75 (secs for 300 calls)
256 | 0.11 | 0.97 (secs for 1500 calls)
512 | 0.09 | 1.21 (secs for 1000 calls)
1024 | 0.08 | 1.19 (secs for 500 calls)
2048 | 0.06 | 1.11 (secs for 200 calls)
4096 | 0.09 | 1.19 (secs for 100 calls)
8192 | 0.14 | 1.48 (secs for 50 calls)
Tilbert transform of periodic functions
=========================================
size | optimized | naive
-----------------------------------------
100 | 0.09 | 0.54 (secs for 1500 calls)
1000 | 0.06 | 0.60 (secs for 300 calls)
256 | 0.10 | 0.77 (secs for 1500 calls)
512 | 0.09 | 0.89 (secs for 1000 calls)
1024 | 0.07 | 0.90 (secs for 500 calls)
2048 | 0.05 | 0.83 (secs for 200 calls)
4096 | 0.07 | 0.92 (secs for 100 calls)
8192 | 0.11 | 1.04 (secs for 50 calls)
.
Hilbert transform of periodic functions
=========================================
size | optimized | naive
-----------------------------------------
100 | 0.09 | 0.47 (secs for 1500 calls)
1000 | 0.06 | 0.48 (secs for 300 calls)
256 | 0.10 | 0.68 (secs for 1500 calls)
512 | 0.09 | 0.77 (secs for 1000 calls)
1024 | 0.07 | 0.74 (secs for 500 calls)
2048 | 0.06 | 0.72 (secs for 200 calls)
4096 | 0.07 | 0.79 (secs for 100 calls)
8192 | 0.11 | 0.93 (secs for 50 calls)
More information about the SciPy-Dev
mailing list