09.12.2012 Views

HP 8590 E & L Series Spectrum Analyzers and HP 8591C Cable TV ...

HP 8590 E & L Series Spectrum Analyzers and HP 8591C Cable TV ...

HP 8590 E & L Series Spectrum Analyzers and HP 8591C Cable TV ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

840 !calculate the percent distortion:<br />

850 Prcnt,distort=SQR(Summ,sqr)/Fund~amptd,v*lOO<br />

860 GOSUB Clearscreen !clear the alpha screen:<br />

870 !Output,data:<br />

880 !send data to the screen of the computer:<br />

890 OUTPUT CRT USING "7/,lX,K"; "HARMONIC DISTORTION RESULTS"<br />

900 OUTPUT CRT USING "llX,K,DDDD.D,K";"FREQ = ";Fundamental;" MHz"<br />

910 OUTPUT CRT USING "llX,K,DDDD.D,K";"AMP = ";Fund-amptd-dbm;" dBm"<br />

920 OUTPUT CRT USING "llX,K,DDD.D,K";"2nd HARMONIC = -";Harmonic_dbc(2);" dBc"<br />

930 OUTPUT CRT USING ',llX,K,DDD.D,K";"3rd HARMONIC = -";Harmonic,dbc(3);" dBc"<br />

940 FOR I=4 TO Max-harmonic<br />

950 OUTPUT CRT USING "lOX,DD,K,DDD.D,K";I;"th HARMONIC = -";Harmonic,dbc(I) dBc"<br />

960 NEXT I<br />

970 OUTPUT CRT USING "llX,K,DDD.D,K";"TOTAL DISTORTION = ";Prcnt,distort;" %"<br />

980 !<br />

990 LOCAL 7<br />

1000 STOP<br />

1010 !<br />

1020 Clearscreen: !alpha clear subroutine<br />

1030 !the statement below presses the "CLR SCR" key on<br />

1040 !the keyboard:<br />

1050 OUTPUT KBD USING "# 3" B"*255 75<br />

1060 RETURN<br />

1070 END<br />

The program prompts the user to connect a source to the spectrum analyzer INPUT <strong>and</strong> enter<br />

the source frequency. It sets the spectrum analyzer center frequency to the value of the<br />

source, or fundamental, frequency. It measures <strong>and</strong> records the frequency <strong>and</strong> amplitude of<br />

the fundamental, then measures <strong>and</strong> records the amplitude of the second, third, <strong>and</strong> fourth<br />

harmonics. These values are used to compute percent of harmonic distortion. The result of the<br />

harmonic distortion percentage computation, plus harmonic amplitudes in dBc (decibels relative<br />

to the carrier), are displayed on the computer display. Extensive annotation has been added<br />

(after the exclamation points) to help clarify the program.<br />

If necessary, change the number of harmonics in line 80.<br />

Programming Topics 3-17

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!