Computes parameters needed by QSINF and QSINB.
N — Length of the sequence to be transformed. (Input)
WQSIN — Array of length 3N + 15 containing parameters needed by QSINF and QSINB. (Output)
Generic: CALL QSINI (N, WQSIN)
Specific: The specific interface names are S_QSINI and D_QSINI.
Double: The double precision name is DQSINI.
The routine QSINI initializes the routines QSINF and QSINB. An efficient way to make multiple calls for the same N to IMSL routine QSINF or QSINB is to use routine QSINI for initialization. (In this case, replace QSINF or QSINB with Q2INF or Q2INB, respectively.) The routine QSINI is based on the routine SINQI in FFTPACK. The package FFTPACK was developed by Paul Swarztrauber at the National Center for Atmospheric Research.
Different WQSIN arrays are needed for different values of N.
In this example, we compute three distinct quarter sine transforms by calling QSINI once and then calling Q2INF three times.
REAL COEF(N), FLOAT, PI, SIN, WQSIN(36), SEQ(N)
! Initialize the work vector WQSIN
! Different frequencies of the same
SEQ(I) = SIN(FLOAT((2*K-1)*I)*(PI/2.0)/FLOAT(N))
! Compute the transform of SEQ
CALL Q2INF (N, SEQ, COEF, WQSIN)
WRITE (NOUT,99999) (I, SEQ(I), COEF(I), I=1,N)
99998 FORMAT (/, 9X, 'INDEX', 6X, 'SEQ', 7X, 'COEF')
99999 FORMAT (1X, I11, 5X, F6.2, 5X, F6.2)
INDEX
SEQ COEF
1 0.22
7.00
2
0.43 0.00
3 0.62
0.00
4
0.78 0.00
5 0.90
0.00
6
0.97 0.00
7 1.00
0.00
INDEX
SEQ COEF
1 0.62
0.00
2
0.97 7.00
3 0.90
0.00
4
0.43 0.00
5 -0.22
0.00
6
-0.78 0.00
7 -1.00
0.00
INDEX
SEQ COEF
1 0.90
0.00
2
0.78 0.00
3 -0.22
7.00
4
-0.97 0.00
5 -0.62
0.00
6
0.43 0.00
7 1.00
0.00
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |