Thin wrapper around the fftw3 library for the discrete fourier transform. More...
#include <Image/FourierEngine.H>
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. |
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.
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.
FourierEngine< T >::~FourierEngine | ( | ) | [inline] |
Destructor.
Definition at line 275 of file FourierEngine.C.
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().