Archived:Demonstrating Nyquist Theorem and Quantization Error Concepts in NI LabVIEW SignalExpress

Updated Nov 13, 2020

National Instruments does not actively maintain this document.

This content provides support for older products and technology, so you may notice outdated links or obsolete information about operating systems or other relevant products.

Environment

Software

  • SignalExpress

The following two exercises will help you demonstrate the Nyquist Theorem and Quantization Error concepts. Please follow the steps below to recreate the demo featured in the above video and learn more about these concepts.

Nyquist Theorem Exercise

  1. Download and install the NI LabVIEW SignalExpress evaluation software if you do not already have it installed on your computer.
  2. Create an analog signal by selecting Add Step»Create Signals»Create Analog Signal.
  3. Under Signal Calculation Setup, specify the signal frequency to be 10 kHz and starting sampling rate at 1MHz – 100 times greater then the signal frequency.

Figure 1. Create an Analog Signal in NI LabVIEW SignalExpress.
 
  1. Click on the Data View tab.  Drag and drop your sine wave from the Project View into the Data View.
  2. Create 10 KHz signal sampled at 50 KHz – 5 times the signal frequency, by repeating steps 2 and 3.
  3. Graph the new sine wave by choosing Add Display in the Data View.   Drag and drop the new sine wave from the Project View into the Data View.  Zoom in on the display by clicking on the magnifying glass in the graph palette.
  4. Create another analog 10 KHz signal, which will be sampled at rate 20 KHz - two times larger then the signal frequency by following steps 2 and 3.
  5. Repeat step 6 to add a display and zoom in on it.

Figure 2. Sampling at rates below one-half of signal frequency results in aliased signals.
 
  1. Note that at lower sampling rates we still get the proper frequency of the signal, but the shape is distorted.
  2. Sampling a signal at the same rate as the signal frequency will produce a straight DC signal. NI LabVIEW SignalExpress takes into consideration the Nyquist theorem and will not allow you to sample at frequencies lower than twice the signal frequency.

Quantization Error Exercise

  1. Create a new SignalExpress project by choosing File»New.
  2. Create an analog signal by selecting Add Step»Create Signals»Create Analog Signal.
  3. Under Signal Calculation Setup, specify the signal frequency to be 1 kHz and sampling rate to be 100kHz.
  4. Select Add Step»Processing»Analog Signals»Convert Analog to Digital.
  5. In the Configuration tab, change the resolution to 3 bits.

Figure 3. Use LabVIEW SignalExpress to convert an analog signal to digital.
 
  1. In order to see how accurately you have represented the original sine curve, convert this 3-bit digitized signal back to analog. Do this by selecting Add Step»Processing»Digital Signals»Convert Digital to Analog.
  2. Click on the Data View tab.  Drag and drop the sine wave created in steps 2 and 3 into the Data View.
  3. In the Data View, select Add Display»Time Graph.  Drag and drop the analog waveform created in steps 4 and 5 into the new time graph.  Note the difference between the two analog signals due to the low resolution of the digitized signal.
  4. Repeat steps 4 and 5, but digitize the original signal with a 5 bit resolution.  Ensure that the original sine wave is chosen on the Input tab of the Convert Analog to Digital step.
  5. Repeat step 6 to convert the new digital signal back to analog.  
  6. In the Data View, select Add Display»Time Graph.  Drag and drop the newly created analog signal created in step 10 into the new time graph.  Note that the 5 bit analog waveform more close resembles the original signal than the 3 bit analog waveform.

Figure 4. Low-resolution measurements increase quantization error.

 

Challenge

Analyze the optimal bit resolution for various curves at different frequencies and sampling rates.