Trailing-Edge
-
PDP-10 Archives
-
decus_20tap2_198111
-
decus/20-0026/forif.doc
There are 2 other files named forif.doc in the archive. Click here to see a list.
SUBROUTINE FORIF
PURPOSE
FOURIER ANALYSIS OF A GIVEN PERIODIC FUNCTION IN THE
RANGE 0-2PI
COMPUTES THE COEFFICIENTS OF THE DESIRED NUMBER OF TERMS
IN THE FOURIER SERIES F(X)=A(0)+SUM(A(K)COS KX+B(K)SIN KX)
WHERE K=1,2,...,M TO APPROXIMATE THE COMPUTED VALUES OF A
GIVEN FUNCTION SUBPROGRAM
USAGE
CALL FORIF(FUN,N,M,A,B,IER)
DESCRIPTION OF PARAMETERS
FUN-NAME OF FUNCTION SUBPROGRAM TO BE USED FOR COMPUTING
DATA POINTS
N -DEFINES THE INTERVAL SUCH THAT 2N+1 POINTS ARE TAKEN
OVER THE INTERVAL (0,2PI). THE SPACING IS THUS 2PI/2N+1
M -THE MAXIMUM ORDER OF THE HARMONICS TO BE FITTED
A -RESULTANT VECTOR OF FOURIER COSINE COEFFICIENTS OF
LENGTH M+1
A SUB 0, A SUB 1,..., A SUB M
B -RESULTANT VECTOR OF FOURIER SINE COEFFICIENTS OF
LENGTH M+1
B SUB 0, B SUB 1,..., B SUB M
IER-RESULTANT ERROR CODE WHERE
IER=0 NO ERROR
IER=1 N NOT GREATER OR EQUAL TO M
IER=2 M LESS THAN 0
REMARKS
M MUST BE GREATER THAN OR EQUAL TO ZERO
N MUST BE GREATER THAN OR EQUAL TO M
THE FIRST ELEMENT IN VECTOR B IS ZERO IN ALL CASES
SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED
FUN-NAME OF USER FUNCTION SUBPROGRAM USED FOR COMPUTING
DATA POINTS
CALLING PROGRAM MUST HAVE FORTRAN EXTERNAL STATEMENT
CONTAINING NAMES OF FUNCTION SUBPROGRAMS LISTED IN CALL TO
FORIF
METHOD
USES RECURSIVE TECHNIQUE DESCRIBED IN A. RALSTON, H. WILF,
'MATHEMATICAL METHODS FOR DIGITAL COMPUTERS', JOHN WILEY
AND SONS, NEW YORK, 1960, CHAPTER 24. THE METHOD OF
INDEXING THROUGH THE PROCEDURE HAS BEEN MODIFIED TO
SIMPLIFY THE COMPUTATION.