[SciPy-user] Numpy/Scipy rfft transformations do not match?

Jochen Schroeder cycomanic at gmail.com
Sun Mar 1 15:29:10 EST 2009


On 01/03/09 09:30, Michael Cohen wrote:
> Stéfan van der Walt wrote:
> > NumPy's rfft returns a complex result, whether scipy unpacks the real
> > and imaginary components.  I wonder if this makes much sense, and
> > whether we shouldn't modify SciPy to yield the same output as NumPy?
> 
> Ah, that makes sense.
> In order to switch to the scipy version, the speed improvement has to 
> also take into account the fact that I have to recast the result into 
> the numpy form then.
> Right now, my scipy takes twice as long as it is.  How do I make sure 
> it's using fftw3, and is there a way to make numpy use this library?

Hi Michael,

the fftw3 implementation was never that fast on scipy and is not used in
0.7 anymore. I've written a wrapper around fftw3 using ctypes. The
interface follows the C-implementation of fftw3 so it's less "pythonic"
(i.e. you execute plans instead of doing y=fft(x)) however it's quite a
bit faster than both numpy and scipy on my machines. You can find it
here: http://developer.berlios.de/projects/pyfftw/

Cheers
Jochen



More information about the SciPy-User mailing list