[Numpy-discussion] Choosing between NumPy and SciPy functions

Sturla Molden sturla.molden at gmail.com
Mon Oct 27 22:50:07 EDT 2014


<josef.pktd at gmail.com> wrote:

> For fft I use mostly scipy, IIRC.   (scipy's fft imports numpy's fft,
> partially?)

No. SciPy uses the Fortran library FFTPACK (wrapped with f2py) and NumPy
uses a smaller C library called fftpack_lite. Algorithmically they are are
similar, but fftpack_lite has fewer features (e.g. no DCT). scipy.fftpack
does not import numpy.fft. Neither of these libraries are very "fast", but
usually they are "fast enough" for practical purposes. If we really need a
kick-ass fast FFT we need to go to libraries like FFTW, Intel MKL or
Apple's Accelerate Framework, or even use tools like CUDA or OpenCL to run
the FFT on the GPU. But using such tools takes more coding (and reading API
specifications) than the convinience of just using the FFTs already in
NumPy or SciPy. So if you count in your own time as well, it might not be
that FFTW or MKL are the "faster" FFTs.

Sturla




More information about the NumPy-Discussion mailing list