It has been sometime since I posted about pyFFTW, the last being well over a year ago when I introduced the wisdom functionality. Despite that, the development has been plodding along steadily (and quiet releases made!) and with the 0.9.1 release it has now reached the stage where it satisfies much of my wishlist.
Please go and check out the latest docs for all the features (the tutorial gives a pretty good overview). The main big improvements since the last post are the pretty neat
interfaces module, which offers a drop in replacement for both
scipy.fftpack. Though not all of the functionality of those modules is provided by code within pyFFTW, the namespace is complete through importing parts of
scipy.fftpack as appropriate. There is some slowdown with using
pyfftw.interfaces, but this can be largely alleviated with the
Both the above interfaces depend build on the simplified interface to construct FFT objects,
pyfftw.builders, which is itself of potential interest to end users who want to squeeze out every drop of performance without getting bogged down in the details of creating
pyfftw.FFTW objects directly.
In addition, some nice helper functionality has been added to
pyfftw.FFTW objects. Mainly, the objects can now be called to yield the suitable output, updating the arrays as desired, with normalisation optionally applied to inverse FFTs. This makes creating and calling a
pyfftw.FFTW object as simple as:
>>> import pyfftw >>> a = pyfftw.n_byte_align_empty(4, 32, dtype='complex128') >>> fft = pyfftw.builders.fft(a) >>> a[:] = [1, 2, 3, 4] >>> fft() # returns the output array([ 10.+0.j, -2.+2.j, -2.+0.j, -2.-2.j]) >>> fft([5, 6, 7, 8]) array([ 26.+0.j, -2.+2.j, -2.+0.j, -2.-2.j])
Though in the above example,
a is set to be aligned to 32 bytes, the builder will by default handle that automatically and the
FFTW object will consequently align all the array updates to make sure the alignment is maintained (the optimum alignment is inspected from the CPU). In the above example, the update to the array is not explicitly aligned and is of the incorrect dtype for the
FFTW object. The correction is automatically handled by the call.
That is in a nutshell most of important improvements, though there are loads of little usability enhancements and bug fixes. Please, everyone, go and have a play with it and report back bugs to the github page.