Appendix E High Resolution Digitizing With the 3458A 357
The subprogram is one of the most powerful elements available in any
programming language. Each subprogram has its own context or state as distinct
from the main program. This means that every subprogram has its own set of
variables and its own line labels.
Starter Main
Program
Every program using the library subprogram requires a main program. Many of
the data arrays discussed in this part must be dimensioned in each main program.
Additionally, the COM statements used by many of the library subprograms are
needed in most main programs. Included with the Wave form Analysis Library is
a starter main program that can form the beginning of all main programs as shown
here.
10 ! Main
20 ! Core main program programming aid
30 !** COMMON
40 COM/Hp3458/@Recorder,Xist_plotter,Prt,Bus,Xist
50 !** Real Arrays
60 REAL Scal(0:4),Yamp(0:7)
70 !
** STRINGS
80 DIM Source$[50],Destin$[50],Titles$[30]
90 !** INTEGER ARRAYS
100 INTEGERWavf(1:16384),Redg(0:30),Fedg(0:30),Bandwf(0:163)
110 DISP ! Clear display line
120 OUTPUT I USING "@" ! Clear CRT
130 !
140 CALL Init58 ! Wake up the bus
150 !
160 GINIT ! Initialize graphics
170 !
180 ! Insert user main program here
250 ! to here
260 END
Returning to the original problem, the subprograms needed to analyze the AM
modulated signal are:
Setup_dig, Wfdgtz, Wfmove, Fft, and Fft_plot.
In other words the following would be inserted as the main program:
190 CALL Setup_dig(2,20E-6,512)
200 CALL Wfdgtz (1)
210 CALL Wfmove("1","98",Scal(*),Wavf(*),Clip)
220 CALL Fft (512,1,Hanning,Wavf(*),Real_dat(*),Imag_dat(*),Magn_dat(*))
240 CALL Fft_plot(Magn_data(*),Smpl_intvl,Dyn_range,F_start,F_stop,Title$)
250 END
The results of this program are shown in Figure 59.