Programming Examples
Measuring Harmonic Distortion (GPIB )
printf("\t Fundamental Frequency is : %lf MHz \n\n",dFundamental/10e5) ;
/*Relative amplitude of each harmonic in dBc* /
for (lNum=2 ;lNum<=lMaxHarmonic ;lNum++ )
printf("\t Relative amplitude of Harmonic[%d] : %lf dB c
\n\n",1Num,fRelAmptd[1Num]) ;
/*Total harmonic distortion in percent* /
printf("\t Total Harmonic Distortion : %lf percent \n\n", dPrcntDistort) ;
/*Close the session* /
viClose(viESA) ;
viClose(defaultRM) ;
}
Chapter 3
3-77