Previous Next Contents Generated Index Doc Set Home



Three-Dimensional Fourier Synthesis

The subroutines described in this section compute a periodic sequence from its Fourier coefficients. The xFFT3 operations are unnormalized, so a call of xFFT3F followed by a call of xFFT3B will multiply the input sequence by M*N*K.

Calling Sequence

CALL RFFT3B
(PLACE, M, N, K, RX, LDX, LD2X, RY, LDY, LD2Y, RWSAVE, 
LWSAVE)
CALL DFFT3B
(PLACE, M, N, K, DX, LDX, LD2X, DY, LDY, LD2Y, DWSAVE, 
LWSAVE)
CALL CFFT3B
(M, N, K, CX, LDX, LD2X, CWSAVE, LWSAVE)
CALL ZFFT3B
(M, N, K, ZX, LDX, LD2X, ZWSAVE, LWSAVE)






void rfft3b
(char place, int m, int n, int k, float *rx, int ldx, 
int ld2x, float *ry, int ldy, int ld2y, float *wsave, 
int lwsave)
void dfft3b
(char place, int m, int n, int k, double *dx, int ldx, 
int ld2x, double *dy, int ldy, int ld2y, double *wsave, 
int lwsave)
void cfft3b
(char place, int m, int n, int k, complex *cx, int ldx, 
int ld2x, complex *cy, int ldy, int ld2y, complex 
*wsave, int lwsave)
void zfft3b
(char place, int m, int n, int k, doublecomplex *zx, 
int ldx, int ld2x, doublecomplex *zy, int ldy, int 
ld2y, doublecomplex *wsave, int lwsave)

Arguments

PLACE

Indicates whether the transform should be performed in place or out-of-place. The legal values for PLACE are listed below. Any values not listed below are illegal.

`I' or `i' In-place. Input is supplied in xX and the transformed input is returned in xX. xY is not referenced.

`O' or `o' Out-of-place. Input is supplied in xX and the transformed input is returned in xY.

M

Number of rows to be transformed. These subroutines are most efficient when M is a product of small primes. M 0.

N

Number of columns to be transformed. These subroutines are most efficient when N is a product of small primes. N 0.

K

Number of planes to be transformed. These subroutines are most efficient when K is a product of small primes. K 0.

xX

On entry, if the caller selected an in-place transform then xX is a three-dimensional array xX(LDX,N,K) that contains the sequences to be transformed. On exit, the transformed sequences.

LDX

Leading dimension of the array containing the data to be transformed. LDX M.

LD2X

Second dimension of the array containing the data to be transformed. LDX N.

xY

On entry, if the caller selected an out-of-place transform then xY is a three-dimensional array xY(LDY,N,K) that contains the sequences to be transformed. If the caller selected an in-place transform then this argument is never referenced.

LDY

Leading dimension of the array for an out-of-place transform. LDY M.

LD2Y

Second dimension of the array for an out-of-place transform. LDY N.

xWSAVE

On entry, an array with dimension of at least (M + N + MAX(M,N,K) + 45). The array must have been initialized by xFFT3I.

LWSAVE

Length of the WSAVE array.

Sample Program




      PROGRAM TEST
      IMPLICIT NONE
C
      INTEGER           LWSAVE, M, N, K
      PARAMETER        (K = 2)
      PARAMETER        (M = 2)
      PARAMETER        (N = 4)
      PARAMETER        (LWSAVE = 4 * (M + N + N) + 45)
C
      INTEGER           I, J, L
      REAL              PI, WSAVE(LWSAVE)
      REAL              X, Y
      COMPLEX           C(M,N,K)
C
      EXTERNAL          CFFT3B, CFFT3F, CFFT3I
      INTRINSIC         ACOS, CMPLX, COS, SIN
C
C     Initialize the array C to a complex sequence.
C
      PI = ACOS (-1.0)
      DO 120, L = 1, K
        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,L) = CMPLX (X, Y)
  100     CONTINUE
  110   CONTINUE
  120 CONTINUE
C
      PRINT 1000
      DO 210, L = 1, K
        PRINT 1010, L
        DO 200, I = 1, M
          PRINT 1020, (C(I,J,L), J = 1, N)
  200   CONTINUE
  210 CONTINUE
      CALL CFFT3I (M, N, K, WSAVE)
      CALL CFFT3F (M, N, K, C, M, N, WSAVE, LWSAVE)
      PRINT 1030
      DO 310, L = 1, K
        PRINT 1010, L
        DO 300, I = 1, M
          PRINT 1020, (C(I,J,L), J = 1, N)
  300   CONTINUE
  310 CONTINUE
      CALL CFFT3B (M, N, K, C, M, N, WSAVE, LWSAVE)
      PRINT 1040
      DO 410, L = 1, K
        PRINT 1010, L
        DO 400, I = 1, M
          PRINT 1020, (C(I,J,L), J = 1, N)
  400   CONTINUE
  410 CONTINUE
C
 1000 FORMAT (1X, 'Original Sequences:')
 1010 FORMAT (1X, '  Plane', I2)
 1020 FORMAT (5X, 100(F5.1' +',F5.1,'i  '))
 1030 FORMAT (/1X, 'Transformed Sequences:')
 1040 FORMAT (/1X, 'Recovered Sequences:')
C
      END



Sample Output

 
 Original Sequences:
   Plane 1
       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  
   Plane 2
       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:
   Plane 1
       8.0 +  0.0i    0.0 +  0.0i    0.0 + 16.0i    0.0 +  0.0i  
      -8.0 +  0.0i    0.0 +  0.0i    0.0 +  0.0i    0.0 +  0.0i  
   Plane 2
       0.0 +  0.0i    0.0 +  0.0i    0.0 +  0.0i    0.0 +  0.0i  
       0.0 +  0.0i    0.0 +  0.0i    0.0 +  0.0i    0.0 +  0.0i  



 Recovered Sequences:
   Plane 1
       0.0 + 16.0i    0.0 +-16.0i    0.0 + 16.0i    0.0 +-16.0i  
      16.0 + 16.0i   16.0 +-16.0i   16.0 + 16.0i   16.0 +-16.0i  
   Plane 2
       0.0 + 16.0i    0.0 +-16.0i    0.0 + 16.0i    0.0 +-16.0i  
      16.0 + 16.0i   16.0 +-16.0i   16.0 + 16.0i   16.0 +-16.0i  






Previous Next Contents Generated Index Doc Set Home