Fast Fourier Transforms (FFTs) in Numpy/SciPy are not threaded. Enthought Python is shipped with the Intel MKL numerical library, which is capable of threaded FFTs. How does one
A cleaner version of my original answer is as follows:
from ctypes import *
mkl = cdll.LoadLibrary("mk2_rt.dll")
c_double_p = POINTER(c_double)
DFTI_COMPLEX = c_int(32)
DFTI_DOUBLE = c_int(36)
def fft2(a):
Desc_Handle = c_void_p(0)
dims = (c_int*2)(*a.shape)
mkl.DftiCreateDescriptor(byref(Desc_Handle), DFTI_DOUBLE, DFTI_COMPLEX, 2, dims )
mkl.DftiCommitDescriptor(Desc_Handle)
mkl.DftiComputeForward(Desc_Handle, a.ctypes.data_as(c_void_p) )
mkl.DftiFreeDescriptor(byref(Desc_Handle))
return a
def ifft2(a):
Desc_Handle = c_void_p(0)
dims = (c_int*2)(*a.shape)
mkl.DftiCreateDescriptor(byref(Desc_Handle), DFTI_DOUBLE, DFTI_COMPLEX, 2, dims )
mkl.DftiCommitDescriptor(Desc_Handle)
mkl.DftiComputeBackward(Desc_Handle, a.ctypes.data_as(c_void_p) )
mkl.DftiFreeDescriptor(byref(Desc_Handle))
return a