Computes parameters needed by FSINT.
N — Length of the sequence to be transformed. N must be greater than 1. (Input)
WFSIN — Array of length INT(2.5 * N + 15) containing parameters needed by FSINT. (Output)
Generic: CALL FSINI (N, WFSIN)
Specific: The specific interface names are S_FSINI and D_FSINI.
Double: The double precision name is DFSINI.
The routine FSINI initializes the routine FSINT. An efficient way to make multiple calls for the same N to IMSL routine FSINT, is to use routine FSINI for initialization. (In this case, replace FSINT with F2INT.) The routine FSINI is based on the routine SINTI in FFTPACK. The package FFTPACK was developed by Paul Swarztrauber at the National Center for Atmospheric Research.
Different WFSIN arrays are needed for different values of N.
In this example, we compute three distinct sine FFTs by calling FSINI once and then calling F2INT three times.
REAL COEF(N+1), FLOAT, PI, SIN, WFSIN(32), SEQ(N)
! Initialize the work vector WFSIN
! Different frequencies of the same
SEQ(I) = SIN(FLOAT(K*I)*PI/FLOAT(N+1))
! Compute the transform of SEQ
CALL F2INT (N, SEQ, COEF, WFSIN)
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.38
8.00
2
0.71
0.00
3
0.92 0.00
4 1.00
0.00
5
0.92 0.00
6 0.71
0.00
7
0.38
0.00
INDEX
SEQ COEF
1 0.71
0.00
2
1.00 8.00
3 0.71
0.00
4
0.00 0.00
5 -0.71
0.00
6
-1.00 0.00
7 -0.71
0.00
INDEX
SEQ COEF
1 0.92
0.00
2
0.71 0.00
3 -0.38
8.00
4
-1.00 0.00
5 -0.38
0.00
6
0.71 0.00
7 0.92
0.00
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |