latest version v1.9 - last update 10 Apr 2010 |
A class for inverse FFT. More...
#include <ltiRealInvFFT.h>
Public Types | |
typedef realFFT::parameters | parameters |
Public Member Functions | |
realInvFFT (void) | |
~realInvFFT (void) | |
const parameters & | getParameters () const |
virtual const char * | getTypeName () const |
virtual functor * | clone () const |
void | apply (const vector< float > &realInput, const vector< float > &imagInput, vector< float > &realOutput) const |
void | apply (const vector< double > &realInput, const vector< double > &imagInput, vector< double > &realOutput) const |
void | apply (const matrix< float > &realInput, const matrix< float > &imagInput, matrix< float > &realOutput) const |
A class for inverse FFT.
realFFT is a class for Fast Fourier Transforms on lti::vectors and lti::matrix<float>. The input can either be in polar or cartesic format, specified by the parameter inputMode. The FFT on matrix<float> works full-sized input matrices (i.e the size of the output data), while the vector FFT works only one half (!) of the Fourier coefficients per dimension (real and imaginary). Note that cartesic input data computes faster! The apply-methods are based on fast inverse FFT-routines written by Takuya Ooura (the original code can be found here) that have been adapted for the use on lti::vectors and matrix<float>. Note that the cartesic output is faster ! Usage:
#include "ltiRealInvFFT.h" #include "ltiRealFFT.h" lti::realFFT fft2d; // for 2-dimensional FFT lti::realInvFFT ifft2d; // for 2-dimensional inverse FFT lti::realFFT::parameters par2d; par2d.mode = lti::realFFT::parameters::Polar; ifft2d.setParameters(par2d); fft2d.setParameters(par2d); fft2d.apply(R, re, im); // the actual FFT ifft2d.apply(re, im, back); // inverse FFT
Parameter class of the realInvFFT class (are compatible with the parameters of the realFFT functor).
lti::realInvFFT::realInvFFT | ( | void | ) |
constructor
lti::realInvFFT::~realInvFFT | ( | void | ) |
detsructor
void lti::realInvFFT::apply | ( | const matrix< float > & | realInput, | |
const matrix< float > & | imagInput, | |||
matrix< float > & | realOutput | |||
) | const |
on-copy method for matrix<float>.
The input data has the half the size of the output data (i.e. only the positive coefficients are used). Note that the DC component of the signal is in the upper-left corner of the two-dimensional FFT. (corresponds to the FFT output)
realInput | the real part of the Fourier coefficients (Polar or Cartesic), size n | |
imagInput | the imaginary part of the Fourier coefficients (Polar or Cartesic), size n | |
realOutput | the real inverse-computed signal, size n |
void lti::realInvFFT::apply | ( | const vector< double > & | realInput, | |
const vector< double > & | imagInput, | |||
vector< double > & | realOutput | |||
) | const |
on-copy method vor vectors.
The input data has the half the size of the output data (i.e. only the positive coefficients are used).
realInput | the real part of the Fourier coefficients (Polar or Cartesic), size (n/2)+1 | |
imagInput | the imaginary part of the Fourier coefficients (Polar or Cartesic), size (n/2)+1 | |
realOutput | the real inverse-computed signal, size n |
void lti::realInvFFT::apply | ( | const vector< float > & | realInput, | |
const vector< float > & | imagInput, | |||
vector< float > & | realOutput | |||
) | const |
on-copy method vor vectors.
The input data has the half the size of the output data (i.e. only the positive coefficients are used).
realInput | the real part of the Fourier coefficients (Polar or Cartesic), size (n/2)+1 | |
imagInput | the imaginary part of the Fourier coefficients (Polar or Cartesic), size (n/2)+1 | |
realOutput | the real inverse-computed signal, size n |
virtual functor* lti::realInvFFT::clone | ( | ) | const [virtual] |
returns a pointer to a clone of the functor.
Implements lti::functor.
const parameters& lti::realInvFFT::getParameters | ( | ) | const |
returns current parameters.
Reimplemented from lti::transform.
virtual const char* lti::realInvFFT::getTypeName | ( | ) | const [virtual] |
returns the name of this type
Reimplemented from lti::transform.