sinqb(3P)
NAME
sinqb - synthesize a Fourier sequence from its representation in terms of a sine series with odd wave numbers. The xSINQ operations are unnormalized inverses of themselves, so a call to xSINQF followed by a call to xSINQB will multiply the input sequence by 4 ∗ N. The VxSINQ operations are normalized, so a call of VxSINQF followed by a call of VxSINQB will return the original sequence.
SYNOPSIS
SUBROUTINE SINQB (N, RX, RWSAVE)
SUBROUTINE DSINQB (N, DX, DWSAVE)
SUBROUTINE VSINQB (M, N, RX, RXT, MDIMX, RWSAVE)
SUBROUTINE VDSINQB (M, N, DX, DXT, MDIMX, DWSAVE)
#include <sunperf.h>
void sinqb (int n, float ∗sx, float ∗wsave) ;
void dsinqb (int n, double ∗dx, double ∗wsave) ;
void vsinqb(int m, int n, float ∗sx, int mdimx, float ∗wsave) ;
void vdsinqb(int m, int n, double ∗dx, int mdimx, double ∗wsave) ;
ARGUMENTS
M (For vector operations only.)
The number of sequences to be transformed. M >= 0.
N Length of the sequence to be transformed. These subroutines are most efficient when N is a product of small primes. N >= 0.
xX On entry, an array of length N containing the sequence to be transformed. For VxSINQB, a real two- dimensional array with dimensions of (MDIMX x N) whose rows contain the sequences to be transformed. On exit, the quarter-wave sine synthesis of the input.
xXT (For vector operations only.)
A real two-dimensional work array with dimensions of (MDIMX x N).
MDIMX (For vector operations only.)
Leading dimension of the arrays xX and xXT as specified in a dimension or type statement. MDIMX >= M.
xWSAVE On entry, an array with dimension of at least (3 ∗ N + 15) for scalar subroutines or (2 ∗ N + 15) for vector subroutines, initialized by xSINQI or VxSINQI.
SAMPLE PROGRAM
PROGRAM TEST
IMPLICIT NONE
C
INTEGER M, N
PARAMETER (M = 1)
PARAMETER (N = 6)
C
INTEGER I
REAL PI, WSAVE(N + 15), X(M, N), XT(M, N)
C
EXTERNAL VSINQB, VSINQF, VSINQI
INTRINSIC ACOS, SIN
C
C Initialize the first row of the array to a real odd
C quarter-wave sequence, that is, it can be expanded in
C terms of a cosine series with only odd wave numbers.
C
PI = ACOS (-1.0)
DO 100, I=1, N
X(M,I) = 40.0 ∗ SIN ((I ∗ PI / (2.0 ∗ N)))
100 CONTINUE
C
CALL VSINQI (N, WSAVE)
PRINT 1000
PRINT 1010, (X(M, I), I = 1, N)
CALL VSINQF (M, N, X, XT, M, WSAVE)
PRINT 1020
PRINT 1010, (X(M, I), I = 1, N)
CALL VSINQB (M, N, X, XT, M, WSAVE)
PRINT 1030
PRINT 1010, (X(M, I), I = 1, N)
C
1000 FORMAT (1X, ’Original Sequence: ’)
1010 FORMAT (1X, 100(F5.1, 1X))
1020 FORMAT (1X, ’Transformed Sequence: ’)
1030 FORMAT (1X, ’Recovered Sequence: ’)
C
END
SAMPLE OUTPUT
Original Sequence:
10.4 20.0 28.3 34.6 38.6 40.0
Transformed Sequence:
49.0 0.0 0.0 0.0 0.0 0.0
Recovered Sequence:
10.4 20.0 28.3 34.6 38.6 40.0
SunOS WorkShop_5.0 — Last change: 10 Dec 1998