480 Appendix A
Additional Lab Exercises
General Programming Techniques
n MovingAvg(x, numPts): Use this object located in the Function &
Object Browser
, Data Filtering category to smooth the input data
using the average of a specified number of data points preceding the
point of interest to calculate the smoothed data point.
Using Masks
Mask Test, Step 1
Create a 50 Hz sine wave with an adjustable amount of noise. Test the
noisy sine wave to be certain that it stays below the following limits:
(0,0.5)
(2.2m, 1.2)
(7.2m, 1.2)
(10.2m, 0.5)
(20m, 0.5)
If the sine wave exceeds the limits, mark the failing points with a red
diamond.
Hints
You can change the format of the displays from lines to dots to diamonds.
(In
Properties, choose the Traces tab for each trace input, the line type
can be solid, dashed, points only, etc. Also the
Point Type can be just a
point, a diamond, box, or other shapes.) You may find the
Comparator
object helpful.