








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









Name: ______________________________________________ Date of lab: ______________________ Section number: M E 345._______
Precalculations Score (for instructor or TA use only): _____ / 20
Name 1: ___________________________________________________ Section M E 345._______ Name 2: ___________________________________________________ Section M E 345._______ Name 3: ___________________________________________________ Section M E 345._______ [Name 4: ___________________________________________________ Section M E 345._______ ] Date when the lab was performed: ______________________ Group Lab Report Score (For instructor or TA use only) : Lab experiment and results, plots, tables, etc. (^) _____ / 50 Discussion (^) _____ / 30 TOTAL (^) ______ / 80 Lab Participation Grade and Deductions – The instructor or TA reserves the right to deduct points for any of the following, either for all group members or for individual students: Arriving late to lab or leaving before your lab group is finished. Not participating in the work of your lab group (freeloading). Causing distractions, arguing, or not paying attention during lab. Not following the rules about formatting plots and tables. Grammatical errors in your lab report. Sloppy or illegible writing or plots (lack of neatness) in your lab report. Other (at the discretion of the instructor or TA). Name Reason for deduction Points deducted Total grade (out of 80) Comments (for instructor or TA use only) : Lab 5
only about 10% of the dynamic range of the A/D converter is utilized in the above example, but the resolution of the signal is ten times better for the 0 to 1 V case than for the 0 to 10 V case. Another potential problem with digital data acquisition is clipping. If a voltage lies beyond the input range of the A/D converter, the signal is clipped. For example, an A/D converter with an input range of 0 to 10 V is not able to distinguish voltages above 10 V from voltages equal to 10 V – the signal is clipped at 10 V. Similarly, any negative voltages are indistinguishable from a zero volt signal – the signal is clipped at 0 V. Significant measurement errors called aliasing errors are also possible if the waveform is not sampled at high enough frequency. To avoid aliasing, the sampling rate must be at least twice the maximum frequency of the measured signal. This restriction is called the Nyquist criterion. Signal aliasing occurs when waveforms are sampled at frequencies below the Nyquist frequency. Aliased signals appear to have frequencies (and possibly even waveform shapes ) that differ from those of the actual signal. For adequate resolution of the waveform shape, data should be sampled at a much higher frequency – typically at least five times the Nyquist frequency, if possible. Digital PC-based data acquisition will not totally replace oscilloscopes, at least not in the near future. The reason is sampling frequency. The maximum sampling frequency of modern PC A/D systems is typically less than a MHz (megahertz). By comparison, a good digital oscilloscope may sample as high as several GHz (gigahertz)! The Fast Fourier Transform (FFT) The fast Fourier transform ( FFT ) is a computationally efficient form of the more general discrete Fourier transform ( DFT ), which is itself a discretized version of the even more general Fourier transform ( FT ). Like Fourier series analysis, FFT analysis enables us to calculate the frequency content of a signal. Fourier series analysis is useful for continuous, periodic, analog signals of known fundamental frequency. FFT analysis, on the other hand, is useful for discretely sampled ( digital ) data, and can be applied even if the signal is not periodic. With FFT analysis, the fundamental frequency of a periodic signal does not have to be known a priori. Both MATLAB and LabVIEW have built-in FFT features, which are utilized in this lab. For N sampled data points at sampling frequency fs , the most useful output of an FFT calculation is the frequency spectrum or amplitude spectrum , which is a plot of modified FFT amplitude versus frequency. The frequency spectrum shows the relative importance or contribution of discrete frequencies, which range from zero to fs /2. (The factor of two is a direct result of the Nyquist criterion.) The number of discrete frequencies on the frequency spectrum plot is N /2 + 1. This is half of the number of discretely sampled data points in the original signal, plus one extra since we typically plot both extreme values – from zero Hz (DC component) to the folding frequency f folding. Other details about FFTs, along with equations and examples, are provided in the lecture notes. Here, a brief summary is provided of the parameters that are important when using FFTs in a laboratory experiment: N is the number of discrete data points taken. N is an input parameter, chosen by the user. fs is the sampling frequency , in Hz. fs is an input parameter, chosen by the user. All other properties of the FFT, including sampling time, maximum frequency, frequency resolution, etc., are determined solely from these two inputs, N and fs. T is the total sampling time , and is calculated as T = N / fs. To increase the sampling time, we must either increase the number of data points, or decrease the sampling frequency (or both). f folding is the folding frequency , also called f max, the maximum frequency. f folding = fs /2. f folding is the maximum frequency plotted on the frequency spectrum plot, since f folding is the maximum frequency at which reliable information about the signal can be calculated, due to the Nyquist criterion. The only way to increase f folding is to increase the sampling frequency. f is the frequency resolution or frequency increment of the frequency spectrum. f = 1/ T = fs / N. On the frequency spectrum plot, amplitudes of the FFT are plotted at N /2 + 1 discrete frequencies, each separated by f. In other words, the discrete values of f are 0, f , 2 f , 3 f , ... , [( N /2 – 1)] f. [The amplitude at exactly f folding, i.e., at ( N /2) f , is also plotted; this results in a total of ( N /2) + 1 discrete frequencies, counting both f = 0 and f = f folding.] The only way to increase the frequency resolution is to increase sampling time. Here is a summary of some useful techniques and rules to remember when calculating FFTs: To get better frequency resolution for a fixed sampling frequency, increase the number of data points. To get better frequency resolution for a fixed number of data points, decrease the sampling frequency. (But be careful here not to let fs fall below the Nyquist criterion limit.)
To get frequency component information at higher frequencies, increase the sampling frequency. To reduce leakage in the frequency spectrum (see lecture notes for a discussion about leakage), do one or more of the following: o Increase the number of sampled data points N (at the cost of more computer time). o Decrease the sampling frequency fs (but do not sample at such a low frequency that the Nyquist criterion is violated). o Multiply the time signal by a windowing function prior to taking the FFT (at the cost of throwing away a significant portion of the signal, in particular data points near the start and finish of the time trace). A healthy human ear can hear sounds in the range of about 20 Hz to about 20,000 Hz. Therefore, the standard data acquisition rate for digitally recorded music (CD audio and MP3 or MP4) is 44100 Hz – to avoid aliasing at even the very highest frequencies that can be heard. If music were sampled at a significantly lower frequency than this, aliasing would occur, which would distort the sound and lower the quality of the recording. Accelerometers come in a number of different configurations and are used to measure acceleration. The Lego accelerometer can measure two types of acceleration; static and dynamic. Static acceleration is caused by gravitational force. The object may be stationary, but the accelerometer will still detect an acceleration in the direction gravity is acting. For example, if you point the accelerometer down, it will measure –9.8 m/s^2. If you point the accelerometer up, it will measure +9.8 m/s^2. Dynamic acceleration, on the other hand is the acceleration associated with a moving object. In this lab you will use an accelerometer to measure the motion of a mechanism you will design, and then you will use the acceleration data to estimate the rotational velocity of a motor. A picture of a Lego accelerometer and a Lego motor can be seen in Figures 1 and 2. The program you will be given will log acceleration data in the x direction indicated in Figure 1. Figure 1 : Lego accelerometer with positive x direction shown Figure 2 : Lego motor. Note that the entire orange piece rotates with the motor. You will also be using the Lego Mindstorms brick, known as the NXT, a labeled image of which is shown in Figure
Procedure
Introduction to aliasing using MATLAB, the computer sound card, and music
Data acquisition using MATLAB Note : In the previous section, you used the computer’s sound card to acquire data. Here we use the USB data acquisition system (DAQ) in the lab.
Data acquisition and spectral analysis using MATLAB
Discussion Questions