FFT2DForward() -- Forward 2D FFT

Perform 2D forward FFT on a potentially large image which may not entirely fit into memory. The algorithm is based on a series of 1D FFT's on the rows and the columns of the image. If necessary, a disk buffer is used to store intermediate transform result.

See Also: FFT2DInverse(), Transform2DForward(), Transform2DInverse(), FFTAndFilter()

CALL SEQUENCE

TBool FFT2DForward ( nTform, fpIn, dbic, dbiw, fpOut, dboc,
                   dbow, bZeroInCenter, pfnProgress,pProgressArg);
int     nTform;
           Indicates the type of transform output. Should
           take either T_FIR (for real and imaginary
           output) or T_FMP (for magnitude and phase
           output).
FILE    *fpIn;
           File pointer of the input database file.
int     *dbic;
           Array of 1 input channel.
int     *dbiw;
           Offset and size of input window.
FILE    *fpOut;
           File pointer of the output database file.
int     *dboc;
           Array of 2 output channels (for complex data
           output). The channels should be 32-bit real.
int     *dbow;
           Offset and size of output window. Window size
           should be a power of 2 and should be equal to
           or larger than the input window size.
TBool   bZeroInCenter;
           Indicates whether zero frequency should be
           shifted to the image center. Normally in the
           result of FFT, zero frequency is in the
           upper-left corner of the image. If this
           parameter is set to TRUE, the 4 quadrants
           of transform image will be reordered so that
           zero frequency is at the image center.
IMPProgressFunc pfnProgress;
       is the pointer to a progress counter function.  See
       IMPProgressFunc for details.
void*   pProgressArg;
       is the callback data argument to the pfnProgress() function.

EXAMPLE

Perform 2D forward FFT on a 256x256 window on the upper-left corner of channel 1 of file "irvine.pix". The real the imaginary parts of transform are to be saved in channel 8 and 9 of "irvine.pix". Zero frequency is to be saved in the center of image.

    FILE    *fpIn, *fpOut;
    int     dbic[1], dbiw[4], dboc[2], dbow[4];

    fpIn = fpOut = IDBOpen ( "irvine.pix", "r+");
    dbic[0] = 1;
    dbiw[0] = dbiw[1] = 0;
    dbiw[2] = dbiw[3] = 256;
    dboc[0] = 8;
    dboc[1] = 9;
    dbow[0] = dbow[1] = 0;
    dbow[2] = dbow[3] = 256;

    FFT2DForward (T_FIR, fpIn, dbic, dbiw, fpOut, dboc, dbow, TRUE,
                  IMPTermProgressCounter,NULL);

About PCI Help Gateway