Professional Documents
Culture Documents
Name:__________________________________
Date Performed: _________________________
Rating:__________________________
Date Submitted: __________________
Page 1
Page 2
Page 3
In the BD, insert Simulate Signal Express VI (Functions Palette > Express > Signal Analysis >
Simulate Signal). The Configure Simulate Signal window appears.
In this window, set the Frequency (Hz) to 200, Amplitude to 100, Samples per second (Hz) to
8000, uncheck the Automatic checkbox under the Number of Samples category and set it to 128.
This generates a signal whose amplitude is between 100 to -100, frequency of 200 Hz. The timing
Page 4
information enables one to see clearly the signal by setting the sampling rate (Samples per
second) and the number of samples correctly. Click OK.
Place a Scaling and Mapping Express VI (Functions Palette > Express > Arithmetic &
Comparison > Scale and Map). The Configure Scaling and Mapping window appears.
In this configuration window, choose Linear and set the Slope (m) to 5. This will scale the
amplitude (or amplify) the input 5 times. Click OK.
Wire the Sine output of the Simulate Signal Express VI to the Signal input of the Scaling and
Mapping Express VI. Note: The wire used for connecting the Express VI together is for a dynamic
data type, that is, it carries dynamic data or data that change over time.
Switch to FP. Insert a Waveform Graph (Controls Palette > Express > Graph Indicator >
Waveform Graph). Right-click on the Waveform Graph, choose X Scale and uncheck the Loose
Fit option and Ignore Time Stamp.
Right-click on the Waveform Graph then choose Properties. On the Display Format tab, under
the Default Editing Mode, set the Time (X-Axis) axis data Type to Floating point. Then choose
Digits of Precision as the Precision Type. Set the Digits to 2.
Switch back to BD. The terminal icon for the Waveform Graph should have appeared. Connect
the outputs of the Scaling and Mapping and Simulate Signal Express VIs to the Waveform
Graph. On the process, the Merge Signals node appears automatically.
Enclose the diagram with a While-Loop structure to make the program run continuously.
Page 5
Note: To aid in configuring this VI, open the Context Help for this VI. Click Help and select Show Context
Help (or press Ctrl+H). The Context Help window appears. The terminals for selected VIs will be shown
Page 6
Insert a Basic Function Generator VI (Functions Palette > Programming > Waveform >
Analog Waveform > Waveform Generation > Basic FuncGen). The parameters of this function
generator will be configured using constants and controls.
Right-click on the Signal Type terminal and choose Create > Constant. An Enum (enumerated)
type constant appears, the default being Sine Wave. Note: An Enum data type is one in which a
string value is associated with a numeric value, from zero to n 1, n being the number of
choices.The Enum constant for the Signal Type input includes Sine Wave (value is 0, the default
value), Triangle Wave (value is 1), Square Wave (value is 2) and Sawtooth Wave (value is 3).
Right-click on the Frequency terminal and create a constant whose value is 200 (the default unit of
this terminal is hertz). Right-click on the Amplitude terminal and create a constant whose value is
100. Right-click on the Sampling Info terminal and create a constant in this terminal. There are
two constants to be defined. Put 8000 in the Sampling Rate (Fs) and 128 in the Number of
Samples (#s). Note: These are the values we have set in the previous activity.
Insert a Multiply function. Wire the Signal Out of the Basic Function Generator VI to one of the
inputs of the Multiply function, while on the other one, create a constant with a value of 5.
Insert a Build Array (Functions Palette > Programming > Array > Build Array) node. Drag
down another element of the node so that two arrays can be appended. Wire the output of the
Basic Function Generator VI on the first input terminal and the output of the Multiply node on the
second input terminal.
Switch to FP. Insert a Waveform Graph. Right-click on the graph and disable the Loose Fit option
in the X Scale and the Autoscale Y in the Y Scale options of the graph. Change the limits of the yaxis of the graph by clicking on the maximum and minimum values and changing it to 600 and -600
respectively.
Right-click on the Waveform Graph then choose Properties. On the Display Format tab, under
the Default Editing Mode, set the Time (X-Axis) axis data Type to Floating point. Then choose
Digits of Precision as the Precision Type. Set the Digits to 2.
Switch back to BD. Enclose the entire VI inside a While-Loop structure. Insert a Wait (ms)
(Functions Palette > Programming > Timing > Wait (ms)). Right-click on the milliseconds to
wait terminal of the Wait (ms) node and enter 200. This will delay the execution of the While-Loop
by 200 ms per iteration.
Page 7
Page 8
2. Modify act02-03.vi to make it interactive. The frequency, gain and the signal type of the input signal
must be user-defined. Refer to the FP below as an example. Design a more appealing and functional FP.
Name the VI for this case study as macpro02-02.vi.
VI. REFERENCE
Kehtarnavaz, N. & Kim, N. (2005). Digital Signal Processing System-Level Design Using LabVIEW. Oxford,
United Kingdom: Elsevier, Inc.
Page 9