2
SUBROUTINE EZFFTB (N, R, AZERO, A, B, WSAVE)
3
C***BEGIN PROLOGUE EZFFTB
4
C***PURPOSE A simplified real, periodic, backward fast Fourier
6
C***LIBRARY SLATEC (FFTPACK)
8
C***TYPE SINGLE PRECISION (EZFFTB-S)
9
C***KEYWORDS FFTPACK, FOURIER TRANSFORM
10
C***AUTHOR Swarztrauber, P. N., (NCAR)
13
C Subroutine EZFFTB computes a real periodic sequence from its
14
C Fourier coefficients (Fourier synthesis). The transform is
15
C defined below at Output Parameter R. EZFFTB is a simplified
16
C but slower version of RFFTB.
20
C N the length of the output array R. The method is most
21
C efficient when N is the product of small primes.
23
C AZERO the constant Fourier coefficient
25
C A,B arrays which contain the remaining Fourier coefficients.
26
C These arrays are not destroyed.
28
C The length of these arrays depends on whether N is even or
31
C If N is even, N/2 locations are required.
32
C If N is odd, (N-1)/2 locations are required
34
C WSAVE a work array which must be dimensioned at least 3*N+15
35
C in the program that calls EZFFTB. The WSAVE array must be
36
C initialized by calling subroutine EZFFTI(N,WSAVE), and a
37
C different WSAVE array must be used for each different
38
C value of N. This initialization does not have to be
39
C repeated so long as N remains unchanged. Thus subsequent
40
C transforms can be obtained faster than the first.
41
C The same WSAVE array can be used by EZFFTF and EZFFTB.
45
C R if N is even, define KMAX=N/2
46
C if N is odd, define KMAX=(N-1)/2
50
C R(I)=AZERO plus the sum from K=1 to K=KMAX of
52
C A(K)*COS(K*(I-1)*2*PI/N)+B(K)*SIN(K*(I-1)*2*PI/N)
54
C ********************* Complex Notation **************************
58
C R(J) equals the sum from K=-KMAX to K=KMAX of
60
C C(K)*EXP(I*K*(J-1)*2*PI/N)
64
C C(K) = .5*CMPLX(A(K),-B(K)) for K=1,...,KMAX
72
C *************** Amplitude - Phase Notation ***********************
76
C R(I) equals AZERO plus the sum from K=1 to K=KMAX of
78
C ALPHA(K)*COS(K*(I-1)*2*PI/N+BETA(K))
82
C ALPHA(K) = SQRT(A(K)*A(K)+B(K)*B(K))
84
C COS(BETA(K))=A(K)/ALPHA(K)
86
C SIN(BETA(K))=-B(K)/ALPHA(K)
88
C***REFERENCES P. N. Swarztrauber, Vectorizing the FFTs, in Parallel
89
C Computations (G. Rodrigue, ed.), Academic Press,
91
C***ROUTINES CALLED RFFTB
92
C***REVISION HISTORY (YYMMDD)
94
C 830401 Modified to use SLATEC library source file format.
95
C 860115 Modified by Ron Boisvert to adhere to Fortran 77 by
96
C changing dummy array size declarations (1) to (*)
97
C 861211 REVISION DATE from Version 3.2
98
C 881128 Modified by Dick Valent to meet prologue standards.
99
C 891214 Prologue converted to Version 4.0 format. (BAB)
100
C 920501 Reformatted the REFERENCES section. (WRB)
101
C***END PROLOGUE EZFFTB
102
DIMENSION R(*), A(*), B(*), WSAVE(*)
103
C***FIRST EXECUTABLE STATEMENT EZFFTB
107
102 R(1) = AZERO+A(1)
116
IF (MOD(N,2) .EQ. 0) R(N) = A(NS2+1)
117
CALL RFFTB (N,R,WSAVE(N+1))