Tektronix AWG710 Ventilation Hood User Manual


 
Programming Examples
3-214 AWG710&AWG710B Arbitrary Waveform Generator User Manual
The waveforms generated by the previous equation file are composed of 0 and 1.
It is convenient to use the waveform editor in table mode to look at the results.
Refer to Code Conversion on page F-7 for the input patterns, output patterns and
code conversion tables.
Example 7
The following example applies a 7–point smoothing operation to a noise
waveform. This equation uses the extract(), integ() and join() functions, and also
for and if control statements. Although you do not have any other method to
perform smoothing with the instrument, this is not a preferable way to apply a
smoothing operation. Refer to this example for learning how to use these functions
and control statements.
You can change the number of smoothing points by changing the value of the
variable nump. The greater the value of nump, the faster the instrument can finish
the compile. However, this kind of program frequently accesses the hard disk and
takes more than 20 minutes to complete.
' Simple smoothing (7 points)
nump = 7
extp = nump - 1
nsht = extp / 2
size = 960
"NOISE.WFM" = noise()
"NOISE.WFM" = norm("NOISE.WFM")
cc = 1
for i = nsht to (size - nsht -1) step 1
sp = i - nsht
ep = i + nsht
"TEMP1.WFM" = extract("NOISE.WFM", sp, ep)
"TEMP1.WFM" = integ("TEMP1.WFM")
"TEMP2.WFM" = extract("TEMP1.WFM", extp, extp)
"TEMP2.WFM" = "TEMP2.WFM" / nump
if cc = 1 then
"SMOOTH.WFM" = "TEMP2.WFM"
else
"SMOOTH.WFM" = join("SMOOTH.WFM", "TEMP2.WFM")
endif
cc = cc + 1
next
delete("TEMP1.WFM")
delete("TEMP2.WFM")