Fast Fourier Transform¶
Overview¶
The Fast Fourier Transform (FFT) module nvmath.fft
in nvmath-python leverages the NVIDIA cuFFT library and provides a powerful suite of APIs
that can be directly called from the host to efficiently perform discrete Fourier Transformations. Both stateless function-form APIs and stateful class-form APIs are
provided to support a spectrum of N-dimensional FFT operations. These include forward and inverse transformations, as well as complex-to-complex (C2C), complex-to-real (C2R),
and real-to-complex (R2C) transforms:
N-dimensional forward C2C FFT transform by
nvmath.fft.fft()
.N-dimensional inverse C2C FFT transform by
nvmath.fft.ifft()
.N-dimensional forward R2C FFT transform by
nvmath.fft.rfft()
.N-dimensional inverse C2R FFT transform by
nvmath.fft.irfft()
.All types of N-dimensional FFT by stateful
nvmath.fft.FFT
.
Furthermore, the nvmath.fft.FFT
class includes utility APIs designed to help users cache FFT plans, facilitating the efficient execution of repeated calculations across various computational tasks
(see create_key()
).
Note
The API fft()
and related function-form APIs perform N-D FFT operations, similar to numpy.fft.fftn()
. There are no special 1-D (numpy.fft.fft()
) or 2-D FFT (numpy.fft.fft2()
) APIs.
This not only reduces the API surface, but also avoids the potential for incorrect use because the number of batch dimensions is \(N - 1\) for numpy.fft.fft()
and \(N - 2\) for numpy.fft.fft2()
, where \(N\) is the operand dimension.
Host API Reference¶
FFT support (nvmath.fft
)¶
|
Perform an N-D complex-to-complex (C2C) FFT on the provided complex operand. |
|
Perform an N-D complex-to-complex (C2C) inverse FFT on the provided complex operand. |
|
Perform an N-D real-to-complex (R2C) FFT on the provided real operand. |
|
Perform an N-D complex-to-real (C2R) FFT on the provided complex operand. |
|
Error type for layouts not supported by the library. |
|
Create a stateful object that encapsulates the specified FFT computations and required resources. |
|
A data class for providing options to the |
|
An IntEnum class specifying the direction of the transform. |
|
A data class capturing LTO-IR callables. |