Previous Next Contents Generated Index Doc Set Home



Sine Quarter-Wave Synthesis

The subroutines described in this section synthesize a Fourier sequence from its representation in terms of a sine series with odd wave numbers. The transform is defined as:

For i=1,...,n


Note - 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.

Calling Sequence

CALL SINQB 
(N, RX, RWSAVE)
CALL DSINQB 
(N, DX, DWSAVE)
CALL VSINQB 
(M, N, RX, RXT, MDIMX, RWSAVE)
CALL VDSINQB 
(M, N, DX, DXT, MDIMX, DWSAVE)






void sinqb 
(int n, float *rx, float *rwsave)
void dsinqb 
(int n, double *dx, double *dwsave)
void vsinqb 
(int m, int n, float *rx, int mdimx, float *rwsave)
void vdsinqb 
(int m, int n, double *dx, int mdimx, double *dwsave)

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 × 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 × 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






Previous Next Contents Generated Index Doc Set Home