Agilent Technologies 8590 TV Converter Box User Manual


 
Measuring Harmonic Distortion
The harmonic distortion program presented here illustrates how the spectrum analyzer can
be directed by a computer to make a complete measurement. Measuring the percent of total
harmonic distortion is tedious when performed manually: it involves tuning to the fundamental
and to each harmonic of interest, recording the amplitude of each signal, converting these
amplitudes to linear units (volts), and calculating the result using a formula. The following
program measures percent of total harmonic distortion automatically, quickly, and accurately.
The program operates as if we were making the measurement manually.
Note
This program is designed to measure harmonics of a signal that is greater than
20MHz.
Program Example for the HP-IB Interface
10
!FILE:
“THD-TEST”
20 ASSIGN
QSa
TO 718
! assign IO
path to spectrum analyzer
30 Variables: ! define variables:
40 REAL Fundamental,Fund-amptd-v,Fund-amptd-dbm
50 REAL
Prcnt,distort,Sum-sqr
60 INTEGER Max-harmonic,I,Number
70 !allow
user to change the number of harmonics:
80
Max-harmonic=4
90 ALLOCATE REAL
Harmonic-v(2:Max-harmonic)
100 ALLOCATE REAL
Harmonic-dbc(2:Max,harmonic)
110
GOSUB
Clearscreen
! clear the alpha screen
120
!ask for the frequency of the fundamental:
130
OUTPUT CRT USING
“4/,lOX,K,3/“;
"***HARMONIC DISTORTION***"
140 OUTPUT CRT USING
"lOX,K";"CONNECT
SOURCE TO INPUT"
150
OUTPUT CRT USING “10X ,K”
;
ENTER FUNDAMENTAL FREQUENCY IN MHz”
160 OUTPUT CRT USING “10X
,K”;
“WHEN READY, PRESS ENTER
170 INPUT Fundamental
180
GOSUB
Clearscreen ! clear the alpha screen
190 Fundamental: ! write message on screen:
200 DISP “MEASURING FUNDAMENTAL”
210
!preset
the spectrum analyzer, set single sweep mode, and
220 !take
sweep:
230 OUTPUT
@Sa;“IP;
SNGLS; TS;”
240
!tune
the spectrum analyzer to the fundamental freq and set
250 ! 20
MHz span:
260 OUTPUT
OSa-
“CF
‘I
;
Fundamental;
“MZ;
270 OUTPUT
BISai
“SP
20MZ; TS;
‘I
280 !put a marker on signal peak, move marker to
290 !reference
level:
300 OUTPUT
%a;
“MKPK
HI
;
MKRL; TS;
310 !find
signal peak,
activate signal track, and
320
!narrow
span:
Programming Topics 3-15