Discrete Fourier transforms (scipy.fft
)¶
Fast Fourier Transforms¶
Compute the one-dimensional FFT. |
|
Compute the one-dimensional inverse FFT. |
|
Compute the two-dimensional FFT. |
|
Compute the two-dimensional inverse FFT. |
|
Compute the N-dimensional FFT. |
|
Compute the N-dimensional inverse FFT. |
|
Compute the one-dimensional FFT for real input. |
|
Compute the one-dimensional inverse FFT for real input. |
|
Compute the two-dimensional FFT for real input. |
|
Compute the two-dimensional inverse FFT for real input. |
|
Compute the N-dimensional FFT for real input. |
|
Compute the N-dimensional inverse FFT for real input. |
|
Compute the FFT of a signal that has Hermitian symmetry. |
|
Compute the FFT of a signal that has Hermitian symmetry. |
Helper functions for FFT¶
Find the next fast size to |
Code compatibility features¶
As with other FFT modules in CuPy, FFT functions in this module can take advantage of an existing cuFFT plan (returned by
get_fft_plan()
) to accelarate the computation. The plan can be either passed in explicitly via the keyword-onlyplan
argument or used as a context manager.The boolean switch
cupy.fft.config.enable_nd_planning
also affects the FFT functions in this module, see FFT Functions. This switch is neglected when planning manually usingget_fft_plan()
.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. For this reason, when an in-place FFT is desired, the user should always reassign the input in the following manner:x = cupyx.scipy.fftpack.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.The boolean switch
cupy.fft.config.use_multi_gpus
also affects the FFT functions in this module, see FFT Functions. Moreover, this switch is honored when planning manually usingget_fft_plan()
.
Note
scipy.fft
requires SciPy version 1.4.0 or newer.
Note
To use scipy.fft.set_backend()
together with an explicit plan
argument requires SciPy version 1.5.0 or newer.