Agilent Technologies 8590 TV Converter Box User Manual


 
840
!calculate
the percent distortion:
850
Prcnt,distort=SQR(Summ,sqr)/Fund~amptd,v*lOO
860
GOSUB
Clearscreen
!clear
the alpha screen:
870
!Output,data:
880
!send
data to the screen of the computer:
890 OUTPUT CRT USING
"7/,lX,K"; "HARMONIC DISTORTION RESULTS"
900 OUTPUT CRT USING
"llX,K,DDDD.D,K";"FREQ
=
";Fundamental;"
MHz"
910 OUTPUT CRT USING
"llX,K,DDDD.D,K";"AMP
=
";Fund-amptd-dbm;"
dBm"
920 OUTPUT CRT USING
"llX,K,DDD.D,K";"2nd
HARMONIC =
-";Harmonic_dbc(2);"
dBc"
930 OUTPUT CRT USING
',llX,K,DDD.D,K";"3rd
HARMONIC =
-";Harmonic,dbc(3);"
dBc"
940 FOR
I=4
TO Max-harmonic
950 OUTPUT CRT USING
"lOX,DD,K,DDD.D,K";I;"th
HARMONIC =
-";Harmonic,dbc(I)
dBc"
960 NEXT I
970 OUTPUT CRT USING
"llX,K,DDD.D,K";"TOTAL
DISTORTION =
";Prcnt,distort;"
%"
980 !
990 LOCAL 7
1000 STOP
1010 !
1020 Clearscreen:
!alpha
clear subroutine
1030 !the statement below presses the
"CLR
SCR"
key on
1040 !the keyboard:
1050 OUTPUT KBD USING
"#
B"*255
75
3"
1060 RETURN
1070 END
The program
prompts the user to connect a source to the spectrum analyzer
INPUT
and enter
the source frequency. It sets the spectrum analyzer center frequency to the value of the
source, or fundamental, frequency. It measures and records the frequency and amplitude of
the fundamental, then measures and records the amplitude of the second, third, and fourth
harmonics. These values are used to compute percent of harmonic distortion. The result of the
harmonic distortion percentage computation, plus harmonic amplitudes in
dBc
(decibels relative
to the carrier), are displayed on the computer display. Extensive annotation has been added
(after the exclamation points) to help clarify the program.
If necessary, change the number of harmonics in line 80.
Programming Topics 3-17