FFT2B

 


   more...

Computes the inverse Fourier transform of a complex periodic two-dimensional array.

Required Arguments

COEFNRCOEF by NCCOEF complex array containing the Fourier coefficients to be transformed. (Input)

ANRCOEF by NCCOEF complex array containing the Inverse Fourier coefficients of COEF. (Output)

Optional Arguments

NRCOEF — The number of rows of COEF. (Input)
Default: NRCOEF = size (COEF,1).

NCCOEF — The number of columns of COEF. (Input)
Default: NCCOEF = size (COEF,2).

LDCOEF — Leading dimension of COEF exactly as specified in the dimension statement of the calling program. (Input)
Default: LDCOEF = size (COEF,1).

LDA — Leading dimension of A exactly as specified in the dimension statement of the calling program. (Input)
Default: LDA = size (A,1).

FORTRAN 90 Interface

Generic: CALL FFT2B (COEF, A [])

Specific: The specific interface names are S_FFT2B and D_FFT2B.

FORTRAN 77 Interface

Single: CALL FFT2B (NRCOEF, NCCOEF, COEF, LDCOEF, A, LDA)

Double: The double precision name is DFFT2B.

Description

The routine FFT2B computes the inverse discrete complex Fourier transform of a complex two-dimensional array of size (NRCOEF = N× (NCCOEF = M). It uses the Intel® Math Kernel Library, Sun Performance Library or IBM Engineering and Scientific Subroutine Library for the computation, if available. Otherwise, the method used is a variant of the Cooley-Tukey algorithm , which is most efficient when N and M are both products of small prime factors. If N and M satisfy this condition, then the computational effort is proportional to N M log N M. This considerable savings has historically led people to refer to this algorithm as the “fast Fourier transform” or FFT.

Specifically, given an N × M array c = COEF, FFT2B returns in a

 

Furthermore, a vector of Euclidean norm S is mapped into a vector of norm

 

Finally, note that an unnormalized inverse is implemented in FFT2D. The routine FFT2B is based on the complex FFT in FFTPACK. The package FFTPACK was developed by Paul Swarztrauber at the National Center for Atmospheric Research.

Comments

1. Workspace may be explicitly provided, if desired, by use of F2T2B/DF2T2B. The reference is:

CALL F2T2B (NRCOEF, NCCOEF, A, LDA, COEF, LDCOEF, WFF1, WFF2, CWK, CPY)

The additional arguments are as follows:

WFF1 — Real array of length 4 * NRCOEF + 15 initialized by FFTCI. The initialization depends on NRCOEF. (Input)

WFF2 — Real array of length 4 * NCCOEF + 15 initialized by FFTCI. The initialization depends on NCCOEF. (Input)

CWK — Complex array of length 1. (Workspace)

CPY — Real array of length 2 * MAX(NRCOEF, NCCOEF). (Workspace)

If the Intel® Math Kernel Library, Sun Performance Library or IBM Engineering and Scientific Subroutine Library is used, WFF1, WFF2, CWK, and CPY are not referenced.

2. The routine FFT2B is most efficient when NRCOEF and NCCOEF are the product of small primes.

3. The arrays COEF and A may be the same.

4. If FFT2D/FFT2B is used repeatedly, with the same values for NRCOEF and NCCOEF, then use FFTCI to fill WFF1(N = NRCOEF) and WFF2(N = NCCOEF). Follow this with repeated calls to F2T2D/F2T2B. This is more efficient than repeated calls to FFT2D/FFT2B.

If the Intel® Math Kernel Library, Sun Performance Library or IBM Engineering and Scientific Subroutine Library is used, parameters computed by FFTCI are not used. In this case, there is no need to call FFTCI.

Example

In this example, we first compute the Fourier transform of the 5 × 4 array

 

for 1  n  5 and 1  m  4 using the IMSL routine FFT2D. The result

 

is then inverted by a call to FFT2B. Note that the result is an array a satisfying a = (5)(4)x = 20x. In general, FFT2B is an unnormalized inverse with expansion factor N M.

 

USE FFT2B_INT

USE FFT2D_INT

USE WRCRN_INT

 

IMPLICIT NONE

INTEGER M, N, NCA, NRA

COMPLEX CMPLX, X(5,4), A(5,4), COEF(5,4)

CHARACTER TITLE1*26, TITLE2*26, TITLE3*26

INTRINSIC CMPLX

!

TITLE1 = 'The input matrix is below '

TITLE2 = 'After FFT2D '

TITLE3 = 'After FFT2B '

NRA = 5

NCA = 4

! Fill X with initial data

DO 20 N=1, NRA

DO 10 M=1, NCA

X(N,M) = CMPLX(FLOAT(N+5*M-5),0.0)

10 CONTINUE

20 CONTINUE

!

CALL WRCRN (TITLE1, X)

!

CALL FFT2D (X, COEF)

!

CALL WRCRN (TITLE2, COEF)

!

CALL FFT2B (COEF, A)

!

CALL WRCRN (TITLE3, A)

!

END

Output

 

The input matrix is below

1 2 3 4

1 ( 1.00, 0.00) ( 6.00, 0.00) ( 11.00, 0.00) ( 16.00, 0.00)

2 ( 2.00, 0.00) ( 7.00, 0.00) ( 12.00, 0.00) ( 17.00, 0.00)

3 ( 3.00, 0.00) ( 8.00, 0.00) ( 13.00, 0.00) ( 18.00, 0.00)

4 ( 4.00, 0.00) ( 9.00, 0.00) ( 14.00, 0.00) ( 19.00, 0.00)

5 ( 5.00, 0.00) ( 10.00, 0.00) ( 15.00, 0.00) ( 20.00, 0.00)

 

After FFT2D

1 2 3 4

1 ( 210.0, 0.0) ( -50.0, 50.0) ( -50.0, 0.0) ( -50.0, -50.0)

2 ( -10.0, 13.8) ( 0.0, 0.0) ( 0.0, 0.0) ( 0.0, 0.0)

3 ( -10.0, 3.2) ( 0.0, 0.0) ( 0.0, 0.0) ( 0.0, 0.0)

4 ( -10.0, -3.2) ( 0.0, 0.0) ( 0.0, 0.0) ( 0.0, 0.0)

5 ( -10.0, -13.8) ( 0.0, 0.0) ( 0.0, 0.0) ( 0.0, 0.0)

 

After FFT2B

1 2 3 4

1 ( 20.0, 0.0) ( 120.0, 0.0) ( 220.0, 0.0) ( 320.0, 0.0)

2 ( 40.0, 0.0) ( 140.0, 0.0) ( 240.0, 0.0) ( 340.0, 0.0)

3 ( 60.0, 0.0) ( 160.0, 0.0) ( 260.0, 0.0) ( 360.0, 0.0)

4 ( 80.0, 0.0) ( 180.0, 0.0) ( 280.0, 0.0) ( 380.0, 0.0)

5 ( 100.0, 0.0) ( 200.0, 0.0) ( 300.0, 0.0) ( 400.0, 0.0)