YAKL
|
Compute batched real-to-complex forward and inverse FFTs on yakl::Array objects using vendor libraries. More...
#include <YAKL_fft.h>
Public Member Functions | |
RealFFT1D () | |
~RealFFT1D () | |
template<int N> | |
void | forward_real (Array< T, N, memDevice, styleC > &arr, int trdim_in=-1, int transform_size_in=-1) |
Perform a forward transform (real-to-complex) More... | |
template<int N> | |
void | init (Array< T, N, memDevice, styleC > &arr, int trdim, int tr_size) |
Setup FFT plans, allocate, compute needed data. More... | |
template<int N> | |
void | inverse_real (Array< T, N, memDevice, styleC > &arr, int trdim_in=-1, int transform_size_in=-1) |
Perform an inverse transform (complex-to-real) More... | |
void | nullify () |
Compute batched real-to-complex forward and inverse FFTs on yakl::Array objects using vendor libraries.
This class uses metadata from the yakl::Array object to provide a simplified interface for computing 1-D real-to-complex FFTs batched over the non-transformed dimensions of the Array object. If the user calls init()
, then calls to forward_real() and reverse_real() do not need the optional transform dimension and transform size parameters. The user can avoid calling init()
, though, and then provide these parameters to forward_real()
and reverse_real()
.
Complex results of a forward transform are stored in interleaved real,imag,real,imag format in-place in the array.
Since it's real-to-complex, for even-element transforms, you'll need n+2
elements available in the transform dimension(s). For odd-element transforms, you'll need n+1
.
Example Usage:
Twiddle and chirp factors are not re-computed unless init()
is called or forward_real() is called with a different dimension to transform or a different transform size (or the batch size changes).
|
inline |
|
inline |
|
inline |
Perform a forward transform (real-to-complex)
trdim_in
and transform_size_in
are only needed if you did not call init()
or you're changing the parameters of the transform (batch size, transform dim, transform size).
|
inline |
Setup FFT plans, allocate, compute needed data.
This is not a necessary call. You can pass the trdim
and tr_size
parameters to forward_real() and inverse_real() if you want.
|
inline |
Perform an inverse transform (complex-to-real)
trdim_in
and transform_size_in
are only needed if you did not call init()
or you're changing the parameters of the transform (batch size, transform dim, transform size).
|
inline |