NAME sinqf - compute the Fourier coefficients in a sine series representation with only odd wave numbers. The xSINQ opera- tions 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 SINQF (N, RX, RWSAVE) SUBROUTINE DSINQF (N, DX, DWSAVE) SUBROUTINE VSINQF (M, N, RX, RXT, MDIMX, RWSAVE) SUBROUTINE VDSINQF (M, N, DX, DXT, MDIMX, DWSAVE) #include <sunperf.h> void sinqf (int n, float *sx, float *wsave) ; void dsinqf (int n, double *dx, double *wsave) ; void vsinqf(int m, int n, float *sx, int mdimx, float *wsave) ; void vdsinqf(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 VxSINQF, 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 transform 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 = 4) PARAMETER (N = 6) C INTEGER I, J REAL PI, WSAVE(N + 15), X(M, N+1), XT(M, N + 1) C EXTERNAL VSINQB, VSINQF, VSINQI INTRINSIC ACOS, SIN C C Initialize the array to m real odd quarter-wave sequence, C that is, they can be expanded in terms of a cosine series C with only odd wave numbers. C PI = ACOS (-1.0) DO 110, J=1, M DO 100, I=1, N X(J,I) = 40.0 * J * SIN (I * PI / (2.0 * N)) 100 CONTINUE 110 CONTINUE C CALL VSINQI (N, WSAVE) PRINT 1000 DO 120, J=1, M PRINT 1010, J, (X(J, I), I = 1, N) 120 CONTINUE CALL VSINQF (M, N, X, XT, M, WSAVE) PRINT 1000 DO 130, J=1, M PRINT 1010, J, (X(J, I), I = 1, N) 130 CONTINUE CALL VSINQB (M, N, X, XT, M, WSAVE) PRINT 1000 DO 140, J=1, M PRINT 1010, J, (X(J, I), I = 1, N) 140 CONTINUE C 1000 FORMAT (1X, 'Original Sequence: ') 1010 FORMAT (1X, 'Sequence', I2, ': ', 100(F5.1, 1X)) 1020 FORMAT (1X, 'Transformed Sequence: ') 1030 FORMAT (1X, 'Recovered Sequence: ') C END SAMPLE OUTPUT Original Sequence: Sequence 1: 10.4 20.0 28.3 34.6 38.6 40.0 Sequence 2: 20.7 40.0 56.6 69.3 77.3 80.0 Sequence 3: 31.1 60.0 84.9 103.9 115.9 120.0 Sequence 4: 41.4 80.0 113.1 138.6 154.5 160.0 Original Sequence: Sequence 1: 49.0 0.0 0.0 0.0 0.0 0.0 Sequence 2: 98.0 0.0 0.0 0.0 0.0 0.0 Sequence 3: 147.0 0.0 0.0 0.0 0.0 0.0 Sequence 4: 196.0 0.0 0.0 0.0 0.0 0.0 Original Sequence: Sequence 1: 10.4 20.0 28.3 34.6 38.6 40.0 Sequence 2: 20.7 40.0 56.6 69.3 77.3 80.0 Sequence 3: 31.1 60.0 84.9 103.9 115.9 120.0 Sequence 4: 41.4 80.0 113.1 138.6 154.5 160.0
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |