Previous Next Contents Generated Index Doc Set Home



Initialize Two-Dimensional Fourier Transform or Synthesis

The subroutines described in this section initialize the array xWSAVE, which is used in both xFFT2F and xFFT2B.

Calling Sequence

CALL RFFT2I
(M, N, RWSAVE)
CALL DFFT2I
(M, N, DWSAVE)
CALL CFFT2I
(M, N, CWSAVE)
CALL ZFFT2I
(M, N, ZWSAVE)






void rfft2i
(int m, int n, float *wsave)
void dfft2i
(int m, int n, double *wsave)
void cfft2i
(int m, int n, complex *wsave)
void zfft2i
(int m, int n, doublecomplex *wsave)

Arguments

M

Number of rows to be transformed. M 0.

N

Number of columns to be transformed. N 0.

xWSAVE

On entry, an array with dimension of at least (M + N + MAX(M,N) + 45). The same work array can be used for both xFFT2F and xFFT2B as long as M and N remain unchanged. Different xWSAVE arrays are required for different values of N. This initialization does not have to be repeated between calls to xFFT2F or xFFT2B as long as M and N and xWSAVE remain unchanged, thus subsequent transforms can be obtained faster than the first.

Sample Program




      PROGRAM TEST
      IMPLICIT NONE
C
      INTEGER           LWSAVE, M, N
      PARAMETER        (M = 2)
      PARAMETER        (N = 4)
      PARAMETER        (LWSAVE = 4 * (M + N + N) + 45)
C
      INTEGER           I, J
      REAL              PI, WSAVE(LWSAVE)
      REAL              X, Y
      COMPLEX           C(M,N)
C
      EXTERNAL          CFFT2B, CFFT2F, CFFT2I
      INTRINSIC         ACOS, CMPLX, COS, SIN
C
C     Initialize the array C to a complex sequence.
C
      PI = ACOS (-1.0)
      DO 110, J = 1, N
        DO 100, I = 1, M
          X = SIN ((I - 1.0) * 2.0 * PI / N)
          Y = COS ((J - 1.0) * 2.0 * PI / M)
          C(I,J) = CMPLX (X, Y)
  100   CONTINUE
  110 CONTINUE
C
      PRINT 1000
      DO 200, I = 1, M
        PRINT 1010, (C(I,J), J = 1, N)
  200 CONTINUE
      CALL CFFT2I (M, N, WSAVE)
      CALL CFFT2F (M, N, C, M, WSAVE, LWSAVE)
      PRINT 1020
      DO 300, I = 1, M
        PRINT 1010, (C(I,J), J = 1, N)
  300 CONTINUE
      CALL CFFT2B (M, N, C, M, WSAVE, LWSAVE)
      PRINT 1030
      DO 400, I = 1, M
        PRINT 1010, (C(I,J), J = 1, N)
  400 CONTINUE
C
 1000 FORMAT (1X, `Original Sequences:')
 1010 FORMAT (1X, 100(F4.1' +',F4.1,'i  `))
 1020 FORMAT (1X, `Transformed Sequences:')
 1030 FORMAT (1X, `Recovered Sequences:')
C
      END



Sample Output




  0.0 + 1.0i   0.0 +-1.0i   0.0 + 1.0i   0.0 +-1.0i  
  1.0 + 1.0i   1.0 +-1.0i   1.0 + 1.0i   1.0 +-1.0i  
 Transformed Sequences:
  4.0 + 0.0i   0.0 + 0.0i   0.0 + 8.0i   0.0 + 0.0i  
 -4.0 + 0.0i   0.0 + 0.0i   0.0 + 0.0i   0.0 + 0.0i  
 Recovered Sequences:
  0.0 + 8.0i   0.0 +-8.0i   0.0 + 8.0i   0.0 +-8.0i  
  8.0 + 8.0i   8.0 +-8.0i   8.0 + 8.0i   8.0 +-8.0i  






Previous Next Contents Generated Index Doc Set Home