QSINB

Computes a sequence from its sine Fourier coefficients with only odd wave numbers.

Required Arguments

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)

FORTRAN 90 Interface

Generic: CALL QSINB (N, COEF, SEQ)

Specific: The specific interface names are S_QSINB and D_QSINB.

FORTRAN 77 Interface

Single: CALL QSINB (N, COEF, SEQ)

Double: The double precision name is DQSINB.

Description

The routine QSINB computes the discrete (unnormalized) inverse Fourier quarter sine 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, QSINB returns in s = SEQ

Furthermore, a vector x of length N that is first transformed by QSINF and then by QSINB will be returned by QSINB as 4Nx. The routine QSINB is based on the inverse quarter sine FFT in FFTPACK which was developed by Paul Swarztrauber at the National Center for Atmospheric Research.

Comments

1. Workspace may be explicitly provided, if desired, by use of Q2INB/DQ2INB. The reference is:

CALL Q2INB (N, SEQ, COEF, WQSIN)

The additional argument is:

WQSIN — array of length 3 * N + 15 initialized by QSINI. The initialization depends on N.(Input)

2. The routine QSINB is most efficient when N is the product of small primes.

3. The arrays COEF and SEQ may be the same.

4. If QSINF/QSINB is used repeatedly with the same value of N, then call QSINI followed by repeated calls to Q2INF/Q2INB. This is more efficient than repeated calls to QSINF/QSINB.

Example

In this example, we first compute the quarter wave sine 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.

USE QSINB_INT

USE QSINF_INT

USE UMACH_INT

IMPLICIT NONE

INTEGER N

PARAMETER (N=7)

!

INTEGER I, NOUT

REAL FLOAT, SEQ(N), COEF(N), X(N)

INTRINSIC FLOAT

! Get output unit number

CALL UMACH (2, NOUT)

! Fill the data vector X

! with X(I) = I, I=1,N

DO 10 I=1, N

X(I) = FLOAT(I)

10 CONTINUE

! Compute the forward transform of X

CALL QSINF (N, X, COEF)

! Compute the backward transform of W

CALL QSINB (N, COEF, SEQ)

!C Print results

WRITE (NOUT,99998)

WRITE (NOUT,99999) (X(I), COEF(I), SEQ(I), I=1,N)

99998 FORMAT (5X, 'INPUT', 5X, 'FORWARD TRANSFORM', 3X, 'BACKWARD ', &

'TRANSFORM')

99999 FORMAT (3X, F6.2, 10X, F6.2, 15X, F6.2)

END

Output

INPUT FORWARD TRANSFORM BACKWARD TRANSFORM

1.00 39.88 28.00

2.00 -4.58 56.00

3.00 1.77 84.00

4.00 -1.00 112.00

5.00 0.70 140.00

6.00 -0.56 168.00

7.00 0.51 196.00