Discrete Fourier transforms (scipy.fft
)¶
Fast Fourier Transforms¶
cupyx.scipy.fft.fft |
Compute the one-dimensional FFT. |
cupyx.scipy.fft.ifft |
Compute the one-dimensional inverse FFT. |
cupyx.scipy.fft.fft2 |
Compute the two-dimensional FFT. |
cupyx.scipy.fft.ifft2 |
Compute the two-dimensional inverse FFT. |
cupyx.scipy.fft.fftn |
Compute the N-dimensional FFT. |
cupyx.scipy.fft.ifftn |
Compute the N-dimensional inverse FFT. |
cupyx.scipy.fft.rfft |
Compute the one-dimensional FFT for real input. |
cupyx.scipy.fft.irfft |
Compute the one-dimensional inverse FFT for real input. |
cupyx.scipy.fft.rfft2 |
Compute the two-dimensional FFT for real input. |
cupyx.scipy.fft.irfft2 |
Compute the two-dimensional inverse FFT for real input. |
cupyx.scipy.fft.rfftn |
Compute the N-dimensional FFT for real input. |
cupyx.scipy.fft.irfftn |
Compute the N-dimensional inverse FFT for real input. |
cupyx.scipy.fft.hfft |
Compute the FFT of a signal that has Hermitian symmetry. |
cupyx.scipy.fft.ihfft |
Compute the FFT of a signal that has Hermitian symmetry. |
Code compatibility features¶
- The boolean switch
cupy.fft.config.enable_nd_planning
also affects the FFT functions in this module, see FFT Functions. Moreover, as with other FFT modules in CuPy, FFT functions in this module can take advantage of an existing cuFFT plan (returned bycupyx.scipy.fftpack.get_fft_plan()
) when used as a context manager. - Like in
scipy.fft
, all FFT functions in this module have an optional argumentoverwrite_x
(default isFalse
), which has the same semantics as inscipy.fft
: when it is set toTrue
, the input arrayx
can (not will) be overwritten arbitrarily. This is not an in-place FFT, the user should always use the return value from the functions, e.g.x = cupyx.scipy.fft.fft(x, ..., overwrite_x=True, ...)
. - The
cupyx.scipy.fft
module can also be used as a backend forscipy.fft
e.g. by installing withscipy.fft.set_backend(cupyx.scipy.fft)
. This can allowscipy.fft
to work with bothnumpy
andcupy
arrays.
Note
scipy.fft
requires SciPy version 1.4.0 or newer.