Computes a sequence from its cosine Fourier coefficients with only odd wave numbers.
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 sequence. (Output)
Generic: CALL QCOSB (N, COEF, SEQ)
Specific: The specific interface names are S_QCOSB and D_QCOSB.
Single: CALL QCOSB (N, COEF, SEQ)
Double: The double precision name is DQCOSB.
The routine QCOSB computes the discrete (unnormalized) inverse Fourier quarter cosine 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, QCOSB returns in s = SEQ
Furthermore, a vector x of length N that is first transformed by QCOSF and then by QCOSB will be returned by QCOSB as 4Nx. The routine QCOSB is based on the inverse quarter cosine 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 Q2OSB/DQ2OSB. The reference is:
CALL Q2OSB (N, COEF, SEQ, WQCOS)
WQCOS — Array of length 3 * N + 15 initialized by QCOSI. The initialization depends on N. (Input)
2. The routine QCOSB is most efficient when N is the product of small primes.
3. The arrays COEF and SEQ may be the same.
4. If QCOSF/QCOSB is used repeatedly with the same value of N, then call QCOSI followed by repeated calls to Q2OSF/Q2OSB. This is more efficient than repeated calls to QCOSF/QCOSB.
In this example, we first compute the quarter wave cosine Fourier transform c of the vector x, where xn = n for n = 1 to N. We then compute the inverse quarter wave Fourier transform of c which is 4Nx = s.
REAL FLOAT, SEQ(N), COEF(N), X(N)
! Compute the forward transform of X
! Compute the backward transform of
WRITE (NOUT,99999) X(I), COEF(I), SEQ(I)
99998 FORMAT (5X, 'INPUT', 5X, 'FORWARD TRANSFORM', 3X, 'BACKWARD ', &
99999 FORMAT (3X, F6.2, 10X, F6.2, 15X, F6.2)
INPUT FORWARD TRANSFORM
BACKWARD
TRANSFORM
1.00
31.12
28.00
2.00
-27.45
56.00
3.00
10.97
84.00
4.00
-9.00
112.00
5.00
4.33
140.00
6.00
-3.36
168.00
7.00
0.40
196.00
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |