[Numpy-discussion] Choosing between NumPy and SciPy functions

josef.pktd at gmail.com josef.pktd at gmail.com
Mon Oct 27 23:31:54 EDT 2014


On Mon, Oct 27, 2014 at 10:50 PM, Sturla Molden <sturla.molden at gmail.com>
wrote:

> <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.
>


Ok, I didn't remember correctly.

I didn't use much fft recently, I never used DCT. My favorite "fft
function" is fftconvolve.
https://github.com/scipy/scipy/blob/e758c482efb8829685dcf494bdf71eeca3dd77f0/scipy/signal/signaltools.py#L13
   doesn't seem to mind mixing numpy and scipy  (quick github search)


It's sometimes useful to have simplified functions that are "good enough"
where we don't have to figure out all the extras that the docstring of the
fancy version is mentioning.

Josef



>
> Sturla
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20141027/85c4d47c/attachment.html>


More information about the NumPy-Discussion mailing list