latest version v1.9 - last update 10 Apr 2010 |
A class for FFT. More...
#include <ltiRealFFT.h>
Classes | |
class | parameters |
Parameter class of the realFFT class. More... | |
Public Member Functions | |
realFFT (void) | |
~realFFT (void) | |
const parameters & | getParameters () const |
virtual const char * | getTypeName () const |
virtual functor * | clone () const |
virtual void | apply (const vector< float > &input, vector< float > &realOutput, vector< float > &imagOutput) const |
virtual void | apply (const vector< double > &input, vector< double > &realOutput, vector< double > &imagOutput) const |
void | apply (const matrix< float > &input, matrix< float > &realOutput, matrix< float > &imagOutput) const |
A class for FFT.
realFFT is a class for Fast Fourier Transforms on lti::vectors and lti::channels. The output can either be in polar or cartesic format, specified by the parameter mode. The FFT on channels produces two full-sized output matrices (i.e the size of the input data), while the vector FFT generates only one half (!) of the Fourier coefficients per dimension (real and imaginary). The output data will be padded to a power of 2 (is done automatically).
In the case of channels, the DC component of the signal is in the upper-left corner of the two-dimensional FFT! The apply-methods are based on fast FFT-routines written by Takuya Ooura (the original code can be found here) that have been adapted for the use on lti::vectors and channels. Note that the cartesic output computes faster.
Usage:
#include "ltiRealFFT.h" #include "ltiRealInvFFT.h" lti::realFFT fft2d; // for 2-dimensional FFT lti::realInvFFT ifft2d; // for 2-dimensional inverse FFT lti::realFFT::parameters par2d; lti::realInvFFT::parameters ipar2d; 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
lti::realFFT::realFFT | ( | void | ) |
constructor
lti::realFFT::~realFFT | ( | void | ) |
destructor
void lti::realFFT::apply | ( | const matrix< float > & | input, | |
matrix< float > & | realOutput, | |||
matrix< float > & | imagOutput | |||
) | const |
on-copy operator for channels.
The output is full-size (possibly padded to power of 2). The DC component of the signal is in the upper-left corner of the two-dimensional FFT!
input | the real input data (constant) | |
realOutput | the real output data (e.g. FFT: the real part) | |
imagOutput | the imaginary output data (e.g. FFT: the imaginary part) |
virtual void lti::realFFT::apply | ( | const vector< double > & | input, | |
vector< double > & | realOutput, | |||
vector< double > & | imagOutput | |||
) | const [virtual] |
on-copy operator for vectors.
The size of the output data is half of the input data (possibly padded to power of 2). The output vectors will have the dimension of the padded input divided by 2 plus one.
input | the real input data (constant) | |
realOutput | the real output data (e.g. FFT: the real part) | |
imagOutput | the imaginary output data (e.g. FFT: the imaginary part) |
virtual void lti::realFFT::apply | ( | const vector< float > & | input, | |
vector< float > & | realOutput, | |||
vector< float > & | imagOutput | |||
) | const [virtual] |
on-copy operator for vectors.
The size of the output data is half of the input data (possibly padded to power of 2). The output vectors will have the dimension of the padded input divided by 2 plus one.
input | the real input data (constant) | |
realOutput | the real output data (e.g. FFT: the real part) | |
imagOutput | the imaginary output data (e.g. FFT: the imaginary part) |
virtual functor* lti::realFFT::clone | ( | ) | const [virtual] |
returns a pointer to a clone of the functor.
Implements lti::functor.
const parameters& lti::realFFT::getParameters | ( | ) | const |
returns current parameters.
Reimplemented from lti::transform.
virtual const char* lti::realFFT::getTypeName | ( | ) | const [virtual] |
returns the name of this type
Reimplemented from lti::transform.