Appendix 2

Program List for Fourier Analysis [81, Chapter 2]

This appendix contains the program list to compute the Fourier coefficient of a periodic nonsinusoidal function. An output example is given for a rectangular wave.

A2.1 Fourier analysis program list

Following is the program list (in FORTRAN) to compute the Fourier terms (DC offset, even and odd harmonics) of a periodic nonsinusoidal function:

CPROGRAM ANAFOR
Ctest, square wave
COMMON NW,DEG(361),RAD(361),XV(361),YVALUE(361)
COMMON NPTS,NPS,INT,INC,NH,GA,PI,WW,OM,NC,RF,ER,EL
COMMON ERR,ITMAX
DIMENSION Y(30,365),SCALE(30),YMAX(30),X(365)
DIMENSION CURVT(100),CURVC(100),CURVS(100),CURVP(100)
DIMENSION AMP(30,100), ANG(30,100)
CREAD DATA FROM DATA FILE.
OPEN(5,FILE=’INDUCTOR.DAT’,STATUS=’OLD’, ...

Get Power Quality in Power Systems and Electrical Machines, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.