NAG Library Function Document
nag_fft_2d_complex (c06fuc) computes the two-dimensional discrete Fourier transform of a bivariate sequence of complex data values.
||nag_fft_2d_complex (Integer m,
const double trigm,
const double trign,
nag_fft_2d_complex (c06fuc) computes the two-dimensional discrete Fourier transform of a bivariate sequence of complex data values , where , .
The discrete Fourier transform is here defined by
(Note the scale factor of in this definition.)
The first call of nag_fft_2d_complex (c06fuc) must be preceded by calls to nag_fft_init_trig (c06gzc)
to initialize the trigm
arrays with trigonometric coefficients according to the value of m
To compute the inverse discrete Fourier transform, defined with
in the above formula instead of
, this function should be preceded and followed by calls of nag_conjugate_complex (c06gcc)
to form the complex conjugates of the data values and the transform.
This function calls nag_fft_multiple_complex (c06frc)
to perform multiple one-dimensional discrete Fourier transforms by the fast Fourier transform algorithm in Brigham (1974)
Brigham E O (1974) The Fast Fourier Transform Prentice–Hall
Temperton C (1983) Self-sorting mixed-radix fast Fourier transforms J. Comput. Phys. 52 1–23
m – IntegerInput
On entry: the number of rows, , of the bivariate data sequence.
n – IntegerInput
On entry: the number of columns, , of the bivariate data sequence.
x – doubleInput/Output
y – doubleInput/Output
: the real and imaginary parts of the complex data values must be stored in arrays x
respectively. Each row of the data must be stored consecutively; hence if the real parts of
are denoted by
, then the
elements of x
must contain the values
The imaginary parts must be ordered similarly in y
On exit: the real and imaginary parts respectively of the corresponding elements of the computed transform.
trigm – const doubleInput
trign – const doubleInput
must contain trigonometric coefficients as returned by calls of nag_fft_init_trig (c06gzc)
. nag_fft_2d_complex (c06fuc) performs a simple check to ensure that both arrays have been initialized and that they are compatible with m
the same array may be supplied for trigm
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
Dynamic memory allocation failed.
Value of m
array are incompatible or trigm
array not initialized.
Value of n
array are incompatible or trign
array not initialized.
On entry, .
On entry, .
Some indication of accuracy can be obtained by performing a subsequent inverse transform and comparing the results with the original sequence (in exact arithmetic they would be identical).
The time taken is approximately proportional to , but also depends on the factorization of the individual dimensions and . The function is somewhat faster than average if their only prime factors are 2, 3 or 5; and fastest of all if they are powers of 2; it is particularly slow if or is a large prime, or has large prime factors.
This program reads in a bivariate sequence of complex data values and prints the two-dimensional Fourier transform. It then performs an inverse transform and prints the sequence so obtained, which may be compared to the original data values.
9.1 Program Text
Program Text (c06fuce.c)
9.2 Program Data
Program Data (c06fuce.d)
9.3 Program Results
Program Results (c06fuce.r)