FFTW1DTransformer Class Reference

Ratpac-two: FFTW1DTransformer Class Reference
Ratpac-two

A class for performing 1D FFTs using the FFTW library. More...

#include <FFTW1DTransformer.hh>

Classes

struct  buf_deleter
 

Public Types

enum class  direction_t { FORWARD = FFTW_FORWARD , INVERSE = FFTW_BACKWARD }
 Represents the direction of the FFT transformation. More...
 

Public Member Functions

 FFTW1DTransformer (size_t size, direction_t direction=direction_t::FORWARD, unsigned flag=FFTW_MEASURE)
 Constructor for FFTW1DTransformer. More...
 
size_t GetSize () const
 
std::vector< std::complex< double > > transform (const std::vector< double > &input)
 Forward transformation.
 
std::vector< double > transform (const std::vector< std::complex< double >> &input)
 Inverse transformation.
 
void ifft (const std::complex< double > *input, double *output)
 Inverse transformation. Performant version since user can use fftw_malloc to ensure alignment.
 

Protected Attributes

size_t fft_size
 
direction_t fft_direction
 
fftw_plan plan
 
std::unique_ptr< double[], buf_deleterrbuf
 
std::unique_ptr< fftw_complex[], buf_deletercbuf
 

Detailed Description

A class for performing 1D FFTs using the FFTW library.

Author
James Shen jiera.nosp@m.ns@s.nosp@m.as.up.nosp@m.enn..nosp@m.edu

FFTW has the concept of a plan, which is a pre-computed set of instructions coupled to specific input and output memroy buffers. Compared to the execution of a plan, the creation of the plan is much more expensive. This class is a RAII style wrapper around a FFTW plan. It lives and dies with a fftw plan, and manages the input/output buffers associated with it. It provides transformation fucntions that correctly pads the input data to the size expected by the plan.

Member Enumeration Documentation

◆ direction_t

Represents the direction of the FFT transformation.

Enumerator
INVERSE 

Forward FFT Transformation. Real to complex.

Constructor & Destructor Documentation

◆ FFTW1DTransformer()

FFTW1DTransformer::FFTW1DTransformer ( size_t  size,
direction_t  direction = direction_t::FORWARD,
unsigned  flag = FFTW_MEASURE 
)
inline

Constructor for FFTW1DTransformer.

Parameters
sizeSize of the FFT (must be a power of two). Note: this is always defined in the time domain. The freq domain will have length size/2 + 1.
directionDirection of the FFT (default is FORWARD).

The documentation for this class was generated from the following file:
  • /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/util/include/RAT/FFTW1DTransformer.hh