Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Signal Processing Analysis

Time domain analysis is beneficial when observing data such as temperature. However, some applications require analyzing the frequency components of signals. This allows you to see which frequencies make up a sound signal, similar to an audio equalizer or the vibration frequencies of a motor while running. Use this module to identify and filter out frequencies in NI LabVIEW software.


Step-by-Step Procedure

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.

    1. 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
      1. Select Lowpass for Filtering Type
      2. Enter 500 for the Cutoff Frequency (Hz)
      3. Increase the Order of the filter to 5
      4. Select OK to apply the configuration
    2. Wire the Data output terminal of the DAQ Assistant to the Signal input terminal of the Filter Express VI
    3. Wire the Error Out output terminal of the DAQ Assistant to the Error In input terminal of the Filter Express VI
    4. 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
      1. Select Power Spectrum for Selected Measurement
      2. Select Linear for the Result
      3. Select OK to apply the configuration
    5. Wire the Filtered Signals output terminal of the Filter Express VI to the Signals input terminal of the Spectral Measurements Express VI
    6. Wire the Error Out output terminal of the Filter Express VI to the Error In input terminal of the Spectral Measurements Express VI
    7. Create graphical indicators for the filtered time and frequency spectrum signals
      1. Delete the existing graph indicator
      2. Right-click the Filtered Signals output wire of the Filter Express VI and select Create»Graph Indicator
      3. Right-click the Power Spectrum output terminal of the Spectral Measurements Express VI and select Create»Graph Indicator
    8. Unwire the input to the Unbundle by Name function and then wire the Error Out output terminal of the Spectral Measurements Express VI
      1. Ensure Status is selected to be unbundled
    9. Run the VI to visualize the results
      1. 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.

LabVIEW Example Code

Right-click on the above VI snippetand select Save Image As... Locate the file on your hard disk and click and drag the file icon onto your LabVIEW block diagram. LabVIEW automatically generates the code from the VI snippet. For more information, read VI Snippets.

Module Exercise: Signal Processing Analysis

Download the Module Exercise PDF

Exercise Goal
Use the NI myDAQ device to continuously acquire an audio signal from a sound device such as a microphone, CD player, or MP3 player. Then add a lowpass filter with a front panel control for the frequency so you can change this during run time. Display the resultant signal on a graph indicator in the time and frequency domain. Before starting this exercise, you need to complete the exercise and use the solution in the Taking a Measurement module.

Required Hardware
1- NI myDAQ
1- 3.5 mm audio cable with MP3 or CD player
or
1- computer microphone

Things to Consider

  • Which frequency range of a signal is the bass?
  • Which frequency range of a signal is the mid-range?
  • Which frequency range of a signal considered is the treble?
  • Use a frequency control for the lowpass filter to cover all audible frequencies.
  • Use a ±2 V input for the audio input and output lines.
  • Use both audio input lines to allow for a right and left (stereo) input.
  • Could you output this to the audio output terminals of the NI myDAQ to listen to the results?

View the exercise solution (Don’t cheat!).

Cumulative Exam:
LabVIEW and DAQ

Evaluate your understanding of LabVIEW and the basics of DAQ. This exam is recommended after you complete all of the modules for LabVIEW Basic Concepts and LabVIEW Basic Tasks. There are 26 multiple choice questions on the exam.

Take the exam


Cumulative Project:
LabVIEW and DAQ

Assess your working knowledge of building a complete system by acquiring, processing, and displaying data with LabVIEW and a DAQ device. This project is recommended after you complete all of the modules for LabVIEW Basic Concepts and LabVIEW Basic Tasks.

Start the project