Computes parameters needed by FFTRF and FFTRB.
N — Length of the sequence to be transformed. (Input)
WFFTR — Array of length 2N + 15 containing parameters needed by FFTRF and FFTRB. (Output)
Generic: CALL FFTRI (N, WFFTR)
Specific: The specific interface names are S_FFTRI and D_FFTRI.
Double: The double precision name is DFFTRI.
The routine FFTRI initializes the routines FFTRF and FFTRB. An efficient way to make multiple calls for the same N to routine FFTRF or FFTRB, is to use routine FFTRI for initialization. (In this case, replace FFTRF or FFTRB with F2TRF or F2TRB, respectively.) The routine FFTRI is based on the routine RFFTI in FFTPACK. The package FFTPACK was developed by Paul Swarztrauber at the National Center for Atmospheric Research.
Different WFFTR arrays are needed for different values of N.
In this example, we compute three distinct real FFTs by calling FFTRI once and then calling F2TRF three times.
REAL COEF(N), COS, FLOAT, TWOPI, WFFTR(29), SEQ(N)
! This loop fills out the data vector
! with a pure exponential signal
SEQ(I) = COS(FLOAT(K*(I-1))*TWOPI/FLOAT(N))
! Compute the Fourier transform of SEQ
CALL F2TRF (N, SEQ, COEF, WFFTR)
99998 FORMAT (/, 9X, 'INDEX', 5X, 'SEQ', 6X, 'COEF')
WRITE (NOUT,99999) (I, SEQ(I), COEF(I), I=1,N)
99999 FORMAT (1X, I11, 5X, F5.2, 5X, F5.2)
INDEX
SEQ COEF
1
1.00 0.00
2 0.62
3.50
3 -0.22
0.00
4 -0.90
0.00
5 -0.90
0.00
6 -0.22
0.00
7
0.62 0.00
INDEX
SEQ COEF
1
1.00 0.00
2
-0.22 0.00
3
-0.90 0.00
4 0.62
3.50
5
0.62 0.00
6
-0.90 0.00
7
-0.22
0.00
INDEX SEQ
COEF
1 1.00
0.00
2 -0.90
0.00
3 0.62
0.00
4 -0.22
0.00
5 -0.22
0.00
6 0.62
3.50
7 -0.90 0.00
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |