[SciPy-dev] Single precision FFT

David Cournapeau david@ar.media.kyoto-u.ac...
Wed Jan 7 09:45:23 CST 2009


Tiziano Zito wrote:
>>>> Has there been any progress on the single precision FFT front?
>>>>         
>>> For anyone moderately familiar with f2py and numpy, it would not take
>>> much time, since it would mostly be a copy and paste of the existing
>>> code for the low-level wrapper, and a bit careful work to avoid breaking
>>> any public API for the high-level wrapper,
>>>       
>> I think this would make a very good GSOC project.  I heard that some
>> students were interested in working on Scipy.
>>     
>
> If this is going to be scheduled for the 0.8 release, I think I can
> try to add the single precision fft wrappers in the next months.
>   

I got bored during a meeting: single precision is now implemented in
scipy.fftpack for complex fft (1d and nd) and 'real' fft (that is real
input -> hermitian output for rfft). It should be transparent, e.g:

from scipy.fftpack import fft, rfft
import numpy as np

fft(np.random.randn(10)).dtype == np.cdouble
fft(np.random.randn(10).astype(np.complex64)).dtype == np.complex64

Note that not everything works yet - float32 input to fft does not work
yet, for example (it is upcasted to double precision, as before). It is
not super-tested either (not less than the double versions, though).

cheers,

David


More information about the Scipy-dev mailing list