cfft2f

Return to Main Contents

NAME

CFFT2F - complex, two-dimensional forward fast Fourier transform

SYNOPSIS


 SUBROUTINE CFFT2F (LDIM, L, M, C, WSAVE, LENSAV,
1                     WORK, LENWRK, IER)

 INTEGER    L, M, LDIM, LENSAV, LENWRK, IER
 COMPLEX    C(LDIM,M)
 REAL       WSAVE(LENSAV), WORK(LENWRK)

DESCRIPTION

 FFTPACK 5.0 routine CFFT2F computes the two-dimensional discrete
 Fourier transform of a complex periodic array.  This transform is
 known as the forward transform or Fourier analysis, transforming
 from physical to spectral space.

 Routine CFFT2F is normalized, in that a call to CFFT2F followed
 by a call to CFFT2B (or vice-versa) reproduces the original array
 within roundoff error.


 Input Arguments


 LDIM    Integer first dimension of two-dimensional complex array C.


 L       Integer number of elements to be transformed in the first 
         dimension of the two-dimensional complex array C.  The value 
         of L must be less than or equal to that of LDIM.  The 
         transform is most efficient when L is a product of small 
         primes.


 M       Integer number of elements to be transformed in the second 
         dimension of the two-dimensional complex array C.  The 
         transform is most efficient when M is a product of small 
         primes.
 
 C       Complex array of two dimensions containing the (L,M) subarray
         to be transformed.  C's first dimension is LDIM, its second 
         dimension must be at least M.

 WSAVE   Real work array with dimension LENSAV.  WSAVE's contents 
         must be initialized with a call to subroutine CFFT2I before 
         the first call to routine CFFT2F or CFFT2B with transform 
         lengths L and M.  WSAVE's contents may be re-used for 
         subsequent calls to CFFT2F and CFFT2B having those same 
         transform lengths.
 

 LENSAV  Integer dimension of WSAVE array.  LENSAV must be at least 
         2*(L+M) + INT(LOG(REAL(L))) + INT(LOG(REAL(M))) + 8.


 WORK    Real work array.


 LENWRK  Integer dimension of WORK array.  LENWRK must be at least
         2*L*M.


 Output Arguments


  C      Complex output array.  For purposes of exposition,
         assume the index ranges of array C are defined by
         C(0:L-1,0:M-1).

         For I=0,...,L-1 and J=0,...,M-1, the C(I,J)'s are given
         in the traditional aliased form by

                            L-1  M-1
         C(I,J) =   1/(L*M)*SUM  SUM  C(L1,M1)*
                            L1=0 M1=0

                    EXP(-SQRT(-1)*2*PI*(I*L1/L + J*M1/M))

         And in unaliased form, the C(I,J)'s are given by

                           LF    MF
         C(I,J) =  1/(L*M)*SUM   SUM   C(L1,M1)*
                           L1=LS M1=MS

                    EXP(-SQRT(-1)*2*PI*(I*L1/L + J*M1/M))

         where

            LS= -L/2    and LF=L/2-1   if L is even;
            LS=-(L-1)/2 and LF=(L-1)/2 if L is odd;
            MS= -M/2    and MF=M/2-1   if M is even;
            MS=-(M-1)/2 and MF=(M-1)/2 if M is odd;

         and

            C(L1,M1) = C(L1+L,M1) if L1 is zero or negative;
            C(L1,M1) = C(L1,M1+M) if M1 is zero or negative;

         The two forms give different results when used to
         interpolate between elements of the sequence.

 IER     Integer error return
         =  0 successful exit
         =  2 input parameter LENSAV not big enough
         =  3 input parameter LENWRK not big enough
         =  5 input parameter L > LDIM
         = 20 input error returned by lower level routine