LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::realFFT Class Reference

A class for FFT. More...

#include <ltiRealFFT.h>

Inheritance diagram for lti::realFFT:
Inheritance graph
[legend]
Collaboration diagram for lti::realFFT:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 Parameter class of the realFFT class. More...

Public Member Functions

 realFFT (void)
 ~realFFT (void)
const parametersgetParameters () const
virtual const char * getTypeName () const
virtual functorclone () 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

Detailed Description

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

Constructor & Destructor Documentation

lti::realFFT::realFFT ( void   ) 

constructor

lti::realFFT::~realFFT ( void   ) 

destructor


Member Function Documentation

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!

Parameters:
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.

Parameters:
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.

Parameters:
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.


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

Generated on Sat Apr 10 15:27:45 2010 for LTI-Lib by Doxygen 1.6.1