Download the Step-by-Step Procedure PDF
Before starting this procedure, you need to complete the exercise and use the solution in the Taking a Measurement module. You can also create a numeric control to simulate the data acquisition input.
Note: This exercise works best when a variable frequency sine wave generator is connected to the ai0 terminals of your device.
-
Right-click the block diagram, select Express»Signal Analysis»Filter, and left-click to place the Filter Express VI to the right of the DAQ Assistant
-
Select Lowpass for Filtering Type
-
Enter 500 for the Cutoff Frequency (Hz)
-
Increase the Order of the filter to 5
-
Select OK to apply the configuration
-
Wire the Data output terminal of the DAQ Assistant to the Signal input terminal of the Filter Express VI
-
Wire the Error Out output terminal of the DAQ Assistant to the Error In input terminal of the Filter Express VI
-
Right-click the block diagram, select Express»Signal Analysis»Spectral Measurements, and left-click to place the Spectral Measurements Express VI to the right of the Filter Express VI
-
Select Power Spectrum for Selected Measurement
-
Select Linear for the Result
-
Select OK to apply the configuration
-
Wire the Filtered Signals output terminal of the Filter Express VI to the Signals input terminal of the Spectral Measurements Express VI
-
Wire the Error Out output terminal of the Filter Express VI to the Error In input terminal of the Spectral Measurements Express VI
-
Create graphical indicators for the filtered time and frequency spectrum signals
-
Delete the existing graph indicator
-
Right-click the Filtered Signals output wire of the Filter Express VI and select Create»Graph Indicator
-
Right-click the Power Spectrum output terminal of the Spectral Measurements Express VI and select Create»Graph Indicator
-
Unwire the input to the Unbundle by Name function and then wire the Error Out output terminal of the Spectral Measurements Express VI
-
Ensure Status is selected to be unbundled
-
Run the VI to visualize the results
-
Vary the frequency of the sine wave input to see when the filter begins to attenuate the input signal
You can convert your DAQ Assistant Express VIs into low-level NI-DAQmx functions by right-clicking the DAQ Assistant and selecting Generate NI-DAQmx Code. The low-level NI-DAQmx API exposes more functionality and customization options for programming.