SigPack - the C++ signal processing library
sp::FFTW Class Reference

#include <fftw.h>

Collaboration diagram for sp::FFTW:
Collaboration graph

Public Member Functions

 FFTW (unsigned int _N, int _alg=FFTW_ESTIMATE)
 
 FFTW (unsigned int _R, unsigned int _C, int _alg)
 
 ~FFTW ()
 
void fft_cx (arma::cx_vec &x, arma::cx_vec &Pxx)
 
arma::cx_vec fft_cx (arma::cx_vec &x)
 
void ifft_cx (arma::cx_vec &Pxx, arma::cx_vec &x)
 
arma::cx_vec ifft_cx (arma::cx_vec &Pxx)
 
void fft (arma::vec &x, arma::cx_vec &Pxx)
 
arma::cx_vec fft (arma::vec &x)
 
void ifft (arma::cx_vec &Pxx, arma::vec &x)
 
arma::vec ifft (arma::cx_vec &Pxx)
 
void fft2 (arma::mat &x, arma::cx_mat &Pxx)
 
arma::cx_mat fft2 (arma::mat &x)
 
void ifft2 (arma::cx_mat &Pxx, arma::mat &x)
 
arma::mat ifft2 (arma::cx_mat &Pxx)
 
void import_wisdom_string (const std::string wisd)
 
void import_wisdom_file (const std::string fname)
 
void export_wisdom_fft (const std::string fname)
 
void export_wisdom_ifft (const std::string fname)
 
void export_wisdom_fft_cx (const std::string fname)
 
void export_wisdom_ifft_cx (const std::string fname)
 

Private Attributes

fftw_plan pl_fft
 
fftw_plan pl_ifft
 
fftw_plan pl_fft_cx
 
fftw_plan pl_ifft_cx
 
unsigned int N
 
unsigned int R
 
unsigned int C
 
int alg
 
int export_alg
 

Detailed Description

Implements FFT functions for Armadillo types. For more info see fftw.org

Examples:
fftw_loop.cpp, fftw_wisdom.cpp, and image.cpp.

Definition at line 25 of file fftw.h.

Constructor & Destructor Documentation

◆ FFTW() [1/2]

sp::FFTW::FFTW ( unsigned int  _N,
int  _alg = FFTW_ESTIMATE 
)
inline

Constructor.

Parameters
_NFFT length
_algFFTW algorithm selection

Definition at line 44 of file fftw.h.

◆ FFTW() [2/2]

sp::FFTW::FFTW ( unsigned int  _R,
unsigned int  _C,
int  _alg 
)
inline

Constructor.

Parameters
_RFFT Nr of rows
_CFFT Nr of cols
_algFFTW algorithm selection

Definition at line 63 of file fftw.h.

◆ ~FFTW()

sp::FFTW::~FFTW ( )
inline

Destructor.

Definition at line 79 of file fftw.h.

Member Function Documentation

◆ export_wisdom_fft()

void sp::FFTW::export_wisdom_fft ( const std::string  fname)
inline

Export real FFT wisdom to file.

Parameters
fnameFile name

Definition at line 355 of file fftw.h.

References err_handler.

◆ export_wisdom_fft_cx()

void sp::FFTW::export_wisdom_fft_cx ( const std::string  fname)
inline

Export complex FFT wisdom to file.

Parameters
fnameFile name

Definition at line 440 of file fftw.h.

References err_handler.

◆ export_wisdom_ifft()

void sp::FFTW::export_wisdom_ifft ( const std::string  fname)
inline

Export real IFFT wisdom to file.

Parameters
fnameFile name

Definition at line 397 of file fftw.h.

References err_handler.

◆ export_wisdom_ifft_cx()

void sp::FFTW::export_wisdom_ifft_cx ( const std::string  fname)
inline

Export complex IFFT wisdom to file.

Parameters
fnameFile name

Definition at line 481 of file fftw.h.

References err_handler.

◆ fft() [1/2]

void sp::FFTW::fft ( arma::vec &  x,
arma::cx_vec &  Pxx 
)
inline

FFT of real input.

Parameters
xInput data
[out]PxxVector to hold complex FFT of length N
Examples:
fftw_loop.cpp.

Definition at line 162 of file fftw.h.

References err_handler.

Referenced by fft(), and main().

◆ fft() [2/2]

arma::cx_vec sp::FFTW::fft ( arma::vec &  x)
inline

FFT of real input.

Returns
Complex FFT of length N
Parameters
xReal input data

Definition at line 188 of file fftw.h.

References fft().

Here is the call graph for this function:

◆ fft2() [1/2]

void sp::FFTW::fft2 ( arma::mat &  x,
arma::cx_mat &  Pxx 
)
inline

FFT of real 2D input.

Parameters
xInput data matrix
[out]PxxMatrix to hold complex FFT of length [RxC]
Examples:
fftw_wisdom.cpp, and image.cpp.

Definition at line 233 of file fftw.h.

References C, err_handler, and R.

Referenced by fft2(), and main().

◆ fft2() [2/2]

arma::cx_mat sp::FFTW::fft2 ( arma::mat &  x)
inline

FFT of real 2D input.

Returns
Complex FFT of size [RxC]
Parameters
xReal input matrix

Definition at line 276 of file fftw.h.

References fft2().

Here is the call graph for this function:

◆ fft_cx() [1/2]

void sp::FFTW::fft_cx ( arma::cx_vec &  x,
arma::cx_vec &  Pxx 
)
inline

FFT of complex input.

Parameters
xComplex input data
[out]PxxVector to hold complex FFT of length N

Definition at line 97 of file fftw.h.

References err_handler.

Referenced by fft_cx().

◆ fft_cx() [2/2]

arma::cx_vec sp::FFTW::fft_cx ( arma::cx_vec &  x)
inline

FFT of complex input.

Returns
Complex FFT of length N
Parameters
xComplex input data

Definition at line 117 of file fftw.h.

References fft_cx().

Here is the call graph for this function:

◆ ifft() [1/2]

void sp::FFTW::ifft ( arma::cx_vec &  Pxx,
arma::vec &  x 
)
inline

Inverse FFT.

Parameters
PxxComplex FFT
[out]xVector to hold real data of length N

Definition at line 200 of file fftw.h.

References err_handler, and N.

Referenced by ifft().

◆ ifft() [2/2]

arma::vec sp::FFTW::ifft ( arma::cx_vec &  Pxx)
inline

Inverse FFT.

Returns
Real data vector of length N
Parameters
PxxComplex FFT

Definition at line 221 of file fftw.h.

References ifft().

Here is the call graph for this function:

◆ ifft2() [1/2]

void sp::FFTW::ifft2 ( arma::cx_mat &  Pxx,
arma::mat &  x 
)
inline

Inverse 2D FFT.

Parameters
PxxComplex FFT
[out]xMatrix to hold real data of size[RxC]

Definition at line 288 of file fftw.h.

References C, and err_handler.

Referenced by ifft2().

◆ ifft2() [2/2]

arma::mat sp::FFTW::ifft2 ( arma::cx_mat &  Pxx)
inline

Inverse FFT.

Returns
Real data vector of length N
Parameters
PxxComplex FFT

Definition at line 322 of file fftw.h.

References ifft2().

Here is the call graph for this function:

◆ ifft_cx() [1/2]

void sp::FFTW::ifft_cx ( arma::cx_vec &  Pxx,
arma::cx_vec &  x 
)
inline

Inverse FFT.

Parameters
PxxComplex FFT
[out]xVector to hold complex data of length N

Definition at line 129 of file fftw.h.

References err_handler, and N.

Referenced by ifft_cx().

◆ ifft_cx() [2/2]

arma::cx_vec sp::FFTW::ifft_cx ( arma::cx_vec &  Pxx)
inline

Inverse FFT.

Returns
Complex data vector of length N
Parameters
PxxComplex FFT

Definition at line 150 of file fftw.h.

References ifft_cx().

Here is the call graph for this function:

◆ import_wisdom_file()

void sp::FFTW::import_wisdom_file ( const std::string  fname)
inline

Import wisdom from file.

Parameters
fnameFile name

Definition at line 344 of file fftw.h.

References err_handler.

◆ import_wisdom_string()

void sp::FFTW::import_wisdom_string ( const std::string  wisd)
inline

Import wisdom from string.

Parameters
wisdWisdom string
Examples:
fftw_wisdom.cpp.

Definition at line 333 of file fftw.h.

References err_handler.

Referenced by main().

Member Data Documentation

◆ alg

int sp::FFTW::alg
private

plans](http://fftw.org/fftw3_doc/Planner-Flags.html#Planner-Flags)

One of FFTW_ESTIMATE, FFTW_MEASURE, FFTW_PATIENT, FFTW_EXHAUSTIVE, FFTW_WISDOM_ONLY see [FFTW

Definition at line 34 of file fftw.h.

◆ C

unsigned int sp::FFTW::C
private

FFT 2D dims.

Definition at line 33 of file fftw.h.

Referenced by fft2(), and ifft2().

◆ export_alg

int sp::FFTW::export_alg
private

Alg used for exporting wisdom.

Definition at line 37 of file fftw.h.

◆ N

unsigned int sp::FFTW::N
private

FFT length.

Definition at line 32 of file fftw.h.

Referenced by ifft(), and ifft_cx().

◆ pl_fft

fftw_plan sp::FFTW::pl_fft
private

Real FFTW plan.

Definition at line 28 of file fftw.h.

◆ pl_fft_cx

fftw_plan sp::FFTW::pl_fft_cx
private

Complex FFTW plan.

Definition at line 30 of file fftw.h.

◆ pl_ifft

fftw_plan sp::FFTW::pl_ifft
private

Real IFFTW plan.

Definition at line 29 of file fftw.h.

◆ pl_ifft_cx

fftw_plan sp::FFTW::pl_ifft_cx
private

Complex IFFTW plan.

Definition at line 31 of file fftw.h.

◆ R

unsigned int sp::FFTW::R
private

Definition at line 33 of file fftw.h.

Referenced by fft2().


The documentation for this class was generated from the following file: