VIGRA - Fast Fourier Transform

[ VIGRA Homepage | Class Index | Function Index | File Index | Main Page ]

| Fast Fourier Transform |
--- | --- | ---

This documentation describes the deprecated VIGRA interface to FFTW 2. Use the interface to the newer version FFTW 3 instead.

VIGRA uses the FFTW Fast Fourier Transform package to perform Fourier transformations. VIGRA provides a wrapper for FFTW's complex number type (FFTWComplex), but FFTW's functions are used verbatim. If the image is stored as a FFTWComplexImage, a FFT is performed like this:

        vigra::FFTWComplexImage spatial(width,height), fourier(width,height);
        ... // fill image with data

        // create a plan for optimal performance
        fftwnd_plan forwardPlan=
            fftw2d_create_plan(height, width, FFTW_FORWARD, FFTW_ESTIMATE );

        // calculate FFT
        fftwnd_one(forwardPlan, spatial.begin(), fourier.begin());

Note that in the creation of a plan, the height must be given first. Note also that `spatial.begin()` may only be passed to `fftwnd_one` if the transform shall be applied to the entire image. When you want to retrict operation to an ROI, you create a copy of the ROI in an image of appropriate size.

More information on using FFTW can be found here.

FFTW produces fourier images that have the DC component (the origin of the Fourier space) in the upper left corner. Often, one wants the origin in the center of the image, so that frequencies always increase towards the border of the image. This can be achieved by calling moveDCToCenter(). The inverse transformation is done by moveDCToUpperLeft().

#include "vigra/fftw.hxx"
Namespace: vigra

© Ullrich Köthe (koethe@informatik.uni-hamburg.de) Cognitive Systems Group, University of Hamburg, Germany | html generated using doxygen and Python VIGRA 1.5.0 (7 Dec 2006)