Demonstrating Nyquist Theorem and Quantization Error concepts using NI SignalExpress Software
Online demonstration
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.
I. Nyquist Theorem Exercise
Ø Download and install the NI SignalExpress® evaluation software from here, if you do not already have it installed on your PC.
Ø First create an analog signal by selecting “Add Step” from the main menu. Select “Analog” and “Create Step”.
Ø 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. Select “Close” step after the initial sine wave configuration is complete.
Ø Graph this analog sine wave by dragging it and dropping in on the display.
Ø Create 10 KHz signal sampled at 50 KHz – 5 times the signal frequency, by repeating the same steps. Select “Analog”, “Create Step”, specify the signal frequency at 10 KHz and sampling rate at 50 KHz.
Ø Graph this analog sine wave by first adding a new display. Select “Add Display” and drag and drop the new signal on the display.
Note: You can modify the resolution on the graphs/displays by double-clicking on the axis and changing the range.
Ø Lastly, create another analog 10 KHz signal, which will be sampled at rate 20 KHz - two times larger then the signal frequency by following the same steps from above. Select “Add Display” and drag and drop the new signal on the display.
Ø Zoom in closely in the signal by selecting the zoom pallet in the bottom left corner of the graph display. You notice that the sine wave appears as a triangle waveform.
Note: It is important to remember that at this sampling rate we still get the proper FREQUENCY of the signal, but you we not get the proper SHAPE of the signal.
Ø Sampling a signal at the same rate as the signal frequency will produce a straight DC signal. SignalExpress takes into consideration the Nyquist theorem and will not allow you to sample at frequencies lower then twice the signal frequency.
II. Quantization Error Exercise
Ø First create an analog signal at 1 KHz frequency using the “Add Step” function. Select “Analog”, “Create Step”, specify the signal frequency at 1 KHz and sampling rate at 100 KHz.
Ø Convert this signal to digital using the 3 bit resolution by creating a new step and selecting Add Step>>Digital >> Processing >> Convert Analog to Digital.
Ø In the Input tab make sure that the input signal source is the analog sine wave you created in previous step
Ø In the Configuration tab specify the resolution to be 3 bits. Select “Close” to after you completed the configuration for the analog-to-digital conversion.
Ø In order to see how accurately you have represented the original sine curve, you need to convert this 3-bit digitized signal back to analog form. Select Digital >> Processing >> Convert Digital to Analog.
Ø In the Input tab make sure that the source for the digital-to-analog conversion is the 3-bit digital curve created in previous step.
Ø To graph the new analog signal, select “Add Display” and simply drag and drop it. As you can see from the graph, due to the low resolution of the ADC, the sine wave you receive is very choppy.
Ø Now, digitize the original sine wave with 5 bit resolution rather then 3 following the same steps from above. Select Digital >> Processing >> Convert Digital to Analog. In the Input tab make sure that the source for the digital-to-analog conversion is the 5-bit digital curve created in previous step.
Ø Convert the 5-bit digitized signal back to analog form. Select Digital >> Processing >> Convert Digital to Analog. Graph the new analog signal by select “Add Display” and dragging and dropping the signal. The new analog graph appears to be much closer to the original sine wave curve.
Note: To better see the signal distortions zoom in closely in the signal by selecting the zoom pallet in the bottom left corner of the graph display.
Ø Finally, follow the same steps from above and use an 8-bit resolution to digitize the analog digital. After the conversion back to Analog form the result sine wave appears with the same accuracy as before it was digitized.
Challenge:
Analyze the optimal bit resolution for various curves at different frequencies and sampling rates.
Related Links:
NI Measurement Fundamentals: Analog Sampling Basics
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).




