FourierEngine< T > Class Template Reference

Thin wrapper around the fftw3 library for the discrete fourier transform. More...

#include <Image/FourierEngine.H>

Collaboration diagram for FourierEngine< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 FourierEngine (const Dims &d)
 Set up an engine for computing the fft of images with given Dims.
 ~FourierEngine ()
 Destructor.
Image< std::complex< T > > fft (const Image< T > &x)
 Compute the fourier transform of x, returning the complex result.

Detailed Description

template<class T>
class FourierEngine< T >

Thin wrapper around the fftw3 library for the discrete fourier transform.

The fftw library works by devising an optimized 'plan' for computing fourier transforms of arrays of a given size -- the 'plan' is optimized at run-time for the particular machine architecture on which the code is being run. Therefore, it is necessary to use a separate FourierEngine object for each size of array for which one wishes to compute the fft. Typically this is not a significant imposition, since most applications are expected to compute the fft of a large number of identically-sized images (e.g. processing a video stream).

Definition at line 62 of file FourierEngine.H.


Constructor & Destructor Documentation

template<class T >
FourierEngine< T >::FourierEngine ( const Dims d  )  [inline]

Set up an engine for computing the fft of images with given Dims.

Definition at line 238 of file FourierEngine.C.

References Dims::h(), and Dims::w().

template<class T >
FourierEngine< T >::~FourierEngine (  )  [inline]

Destructor.

Definition at line 275 of file FourierEngine.C.


Member Function Documentation

template<class T>
Image< std::complex< T > > FourierEngine< T >::fft ( const Image< T > &  x  )  [inline]

Compute the fourier transform of x, returning the complex result.

Since the full-size complex fft of a real image is symmetric, this function (following the fftw conventions) returns only half of the complex result. The full result could be reconstructed as needed. Also note that the result is not 'shifted' -- that is, the DC component will be at the upper-left corner of the returned image, rather than in the center.

Definition at line 291 of file FourierEngine.C.

References ASSERT, Image< T >::begin(), Image< T >::end(), Image< T >::getArrayPtr(), Image< T >::getDims(), Dims::h(), NO_INIT, and Dims::w().

Referenced by SpectralResidualChannel::getOutput().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:43:20 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3