dtmm.fft¶
Custom 2D FFT functions.
numpy, scipy and mkl_fft do not have fft implemented such that output argument can be provided. This implementation adds the output argument for fft2 and ifft2 functions.
Also, for mkl_fft and scipy, the computation can be performed in parallel using ThreadPool.
Module Contents¶
-
dtmm.fft.fft2(a, out=None)¶ Computes fft2 of the input complex array.
- Parameters
a (array_like) – Input array (must be complex).
out (array or None, optional) – Output array. Can be same as input for fast inplace transform.
- Returns
out – Result of the transformation along the last two axes.
- Return type
complex ndarray
-
dtmm.fft.ifft2(a, out=None)¶ Computes ifft2 of the input complex array.
- Parameters
a (array_like) – Input array (must be complex).
out (array or None, optional) – Output array. Can be same as input for fast inplace transform.
- Returns
out – Result of the transformation along the last two axes.
- Return type
complex ndarray
-
dtmm.fft.mfft2(a, overwrite_x=False)¶ Computes matrix fft2 on a matrix of shape (…, n,n,4,4).
This is identical to np.fft2(a, axes = (-4,-3))
- Parameters
a (array_like) – Input array (must be complex).
overwrite_x (bool) – Specifies whether original array can be destroyed (for inplace transform)
- Returns
out – Result of the transformation along the (-4,-3) axes.
- Return type
complex ndarray
-
dtmm.fft.mifft2(a, overwrite_x=False)¶ Computes matrix ifft2 on a matrix of shape (…, n,n,4,4).
This is identical to np.ifft2(a, axes = (-4,-3))
- Parameters
a (array_like) – Input array (must be complex).
overwrite_x (bool) – Specifies whether original array can be destroyed (for inplace transform)
- Returns
out – Result of the transformation along the (-4,-3) axes.
- Return type
complex ndarray
-
dtmm.fft.mfft(a, overwrite_x=False)¶ Computes matrix fft on a matrix of shape (…, n,4,4).
This is identical to np.fft2(a, axis = -3)
- Parameters
a (array_like) – Input array (must be complex).
overwrite_x (bool) – Specifies whether original array can be destroyed (for inplace transform)
- Returns
out – Result of the transformation along the (-4,-3) axes.
- Return type
complex ndarray
-
dtmm.fft.fft(a, overwrite_x=False)¶ Computes fft on a matrix of shape (…, n).
This is identical to np.fft2(a)
- Parameters
a (array_like) – Input array (must be complex).
overwrite_x (bool) – Specifies whether original array can be destroyed (for inplace transform)
- Returns
out – Result of the transformation along the (-4,-3) axes.
- Return type
complex ndarray
-
dtmm.fft.ifft(a, overwrite_x=False)¶ Computes ifft on a matrix of shape (…, n).
This is identical to np.ifft2(a)
- Parameters
a (array_like) – Input array (must be complex).
overwrite_x (bool) – Specifies whether original array can be destroyed (for inplace transform)
- Returns
out – Result of the transformation along the (-4,-3) axes.
- Return type
complex ndarray