Computes the real periodic sequence from its Fourier coefficients.
N — Length of the sequence to be transformed. (Input)
COEF — Array of length N containing the Fourier coefficients. (Input)
SEQ — Array of length N containing the periodic sequence. (Output)
Generic: CALL FFTRB (N, COEF, SEQ [,…])
Specific: The specific interface names are S_FFTRB and D_FFTRB.
Single: CALL FFTRB (N, COEF, SEQ)
Double: The double precision name is DFFTRB.
The routine FFTRB is the unnormalized inverse of the routine FFTRF. This routine computes the discrete inverse Fourier transform of a real vector of size N. The method used is a variant of the Cooley-Tukey algorithm, which is most efficient when N is a product of small prime factors. If N satisfies this condition, then the computational effort is proportional to N log N.
Specifically, given an N-vector c = COEF, FFTRB returns in s = SEQ, if N is even:
The routine FFTRB is based on the inverse real FFT in FFTPACK. The package FFTPACK was developed by Paul Swarztrauber at the National Center for Atmospheric Research.
1. Workspace may be explicitly provided, if desired, by use of F2TRB/DF2TRB. The reference is:
CALL F2TRB (N, COEF, SEQ, WFFTR)
WFFTR —
Array of length 2N + 15 initialized by FFTRI. (Input)
The
initialization depends on N.
2. The routine FFTRB is most efficient when N is the product of small primes.
3. The arrays COEF and SEQ may be the same.
4. If FFTRF/FFTRB is used repeatedly with the same value of N, then call FFTRI followed by repeated calls to F2TRF/F2TRB. This is more efficient than repeated calls to FFTRF/FFTRB.
We compute the forward real FFT followed by the inverse operation. In this example, we first compute the Fourier transform
of the vector x, where xj = (-1)j for j = 1 to N. This vector
is now input into FFTRB with the resulting output s = Nx, that is, sj = (-1)j N for j = 1 to N.
REAL COEF(N), FLOAT, SEQ(N), TWOPI, X(N)
! Compute the forward transform of X
99994 FORMAT (9X, 'Result after forward transform')
99995 FORMAT (9X, 'INDEX', 5X, 'X', 8X, 'COEF')
WRITE (NOUT,99996) (I, X(I), COEF(I), I=1,N)
99996 FORMAT (1X, I11, 5X, F5.2, 5X, F5.2)
! Compute the backward transform of
99997 FORMAT (/, 9X, 'Result after backward transform')
99998 FORMAT (9X, 'INDEX', 4X, 'COEF', 6X, 'SEQ')
WRITE (NOUT,99999) (I, COEF(I), SEQ(I), I=1,N)
99999 FORMAT (1X, I11, 5X, F5.2, 5X, F5.2)
Result after forward
transform
INDEX
X COEF
1 -1.00 -1.00
2 1.00 -1.00
3 -1.00 -0.48
4 1.00 -1.00
5 -1.00 -1.25
6 1.00 -1.00
7 -1.00 -4.38
Result
after backward transform
INDEX
COEF SEQ
1
-1.00 -7.00
2
-1.00 7.00
3
-0.48 -7.00
4
-1.00 7.00
5
-1.25 -7.00
6
-1.00 7.00
7
-4.38 -7.00
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |