Unformatted text preview:

20.309: Biological Instrumentation and Measurement Laboratory Fall 2006 Lab Exercise: Sampling, Aliasing, and Digital Data Contents 1 Objectives 1 2 Lab Procedures 1 2.1 The LabVIEW Spectrum Analyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2.2 RC Filters Redux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2.3 Sampling and Aliasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2.4 LabVIEW to MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3 Completion Requirements 3 1 Objectives 1. Gain a deeper understanding of how a computer records and analyzes signals. 2. Experiment with observing power spectra with the LabVIEW Spectrum Analyzer. 3. Understand how sampling affects the frequency-domain description of a signal. 2 Lab Procedures 2.1 The LabVIEW Spectrum Analyzer Use this section to familiarize yourself with how a spectrum analyzer works. (A) Open the Spectrum Analyzer VI (SpectrumAnalyzer.vi) which you will find on the PC desktop. Plug the output of your function generator into ch1 of your scope and into ach0 of the DAQ board. (B) Once the VI is open, press the arrow button at the top left of the toolbar to run it, or choose “Run” (Ctrl-R) from the Operate menu. To stop it, use the “stop” button in the VI, or the Red “Stop Sign” button on the toolbar (refer to Figure ??). (C) As a starting point, use a sampling rate of 100kHz, and leave the other parameters at their defaults. Look at the spectra for several waveform types (no offset) at a few kHz. Compare the spectra for a sinusoid, a triangle wave, and a square wave. (D) As your lab instructor if you’d like to discuss some issues of digital sampling and features of the spectrum analyzer. 120.309: Biological Instrumentation and Measurement Laboratory Fall 2006 2.2 RC Filters Redux Use the spectrum analyzer to look further at filter transfer functions, similarly to HW1. Note that the spectrum analyzer discards phase information. This stems from the way that a computer esti-mates power spectra, using Discrete Fourier Tranform (DFT) and Fast Fourier Transform (FFT) algorithms. (A) Instead of using the function generator as a signal source, we’ll use an AM502 differential amplifier to generate white noise. Leave both the amp’s inputs unconnected and ground-coupled (to get the noise output spectrum to be white), and connect the output to the scope and DAQ board. Turn up the gain of the “noise source” to 10K or 20K until the noise amplitude is about 0.5V. You should see a flat spectral response on the sp ectrum analyzer plot. (B) Use this noise generator as the input to another AM502 amp with unity gain (gain knob at 100, with ÷100 pushed in). Turn on the low-pass filter for this second amp and set the cutoff frequency fc where you’ll see it on the Spectrum Analyzer. The output spectrum should look familiar. What’s the slope of the roll-off? Experiment with changing the cutoff frequency fc. (C) As configured, this filter has a single pole. Add a second pole at the same frequency and verify that the roll-off becomes twice as steep. (Remember, you can put more than one AM502 into your rack). (D) Now switch to the high-pass configuration – turn off the low-pass filters, and turn up the high-pass knob. Does the spectrum look as you would expect? Use the oscilloscope to verify that the filter actually does attenuate slowly varying signals. What’s going on here? Why isn’t the spectrum analyzer giving you an accurate representation? (The next section will help answer this). 2.3 Sampling and Aliasing We’ll now see how digital sampling affects a signal. Because sampling takes “snapshots” of a signal, spaced apart at certain time intervals, some of the information in the signal may not be captured. However, understanding the limitations allows for powerful computer-based analysis. (A) Set your function generator to output a 10kHz triangle wave. Set the LabVIEW sampling frequency to 100kHz. What is the Nyquist frequency at this sampling rate? Explain what is happening to the spectrum of the triangle wave under these conditions? See what happens to the spectrum (specifically to the aliased peaks) if you shift the triangle wave’s frequency up and down. Generally one of two things can be done to cope with aliasing. If the capability exists, increasing the bandwidth of the spectrum will fit more data on the upper end of the frequency range. If that isn’t possible, we can at least remove the aliased components from the visible spectral region, so they are not interfering with data in the spectral region you can see. (B) Keeping the base triangle-wave frequency at 10kHz, what can you do with your spectrum analyzer parameters (i.e. in software) to increase the bandwidth? (C) You can also improve the aliasing situation with hardware by using an anti-aliasing filter. The purpose is to block the signal components that are too high in frequency to be correctly sampled. Pass your triangle-wave signal through a diff. amp. set to unity gain and with a 220.309: Biological Instrumentation and Measurement Laboratory Fall 2006 low-pass filter, choosing a cutoff which will attenuate frequencies above the Nyquist frequency. As always, you can use multiple filters to improve roll-off. (D) Anti-aliasing filters turn out to be especially important when taking low-frequency noise mea-surements. Let’s examine the low-frequency characteristics of the FG503 generator. Generate a 1kHz triangle wave, but set your Spectrum Analyzer software parameters such that you see only the frequencies from 0.1Hz to 100Hz. Notice what a difference the anti-aliasing filter makes in this case. Save your data for both cases. Are there any drawbacks to using the anti-aliasing filter (take a look at the triangle wave on the scope once you’ve applied the filter to it)? Can you think of a situation in which aliasing might be useful, and how it could be used to the advantage of a measurement. (E) Go back to using an AM502 amp as a white noise source. Run its output through another AM502 amp with unity gain, and a high-pass filter with a low-frequency cutoff at 100Hz. Observe the output on the spectrum analyzer. Now you should be able to


View Full Document

MIT 20 309 - Study Guide

Download Study Guide
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Guide and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Guide 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?