Docsity

EECS145M Microcomputer Interfacing Laboratory Midterm 2 Solutions - Prof. S. E. Derenzo, Exams of Electrical and Electronics Engineering

Toggle sidebar
bg1
Name (Last, First)
Student ID number
EECS145M 2006 Midterm #2 Page 1 Derenzo
UNIVERSITY OF CALIFORNIA
College of Engineering
Electrical Engineering and Computer Sciences Department
EECS 145M: Microcomputer Interfacing Laboratory
Spring Midterm #2 (Closed book- equation sheet provided- calculators OK)
Full credit can only be given if you show your work.
Wednesday, April 12, 2006
PROBLEM 1 (54 points)
You have designed and built a computer system to sample waveforms and perform the FFT.
It has the following characteristics:
• Sampling frequency = 218 Hz = 262,144 Hz
• Number of samples = 216 = 65,536
• Low-pass Butterworth anti-aliasing filter of order 8 and fc = 100,000 Hz
• Hanning (raised cosine) window
Answer the following questions:
1.1 (3 points) For what frequency range does the anti-aliasing filter have gain >0.99?
(Hint: Use the Butterworth gain table on the equation sheet)
1.2 (3 points) For what frequency range does the anti-aliasing filter have gain <0.01?
1.3 (2 points) How long does it take to acquire the samples?
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download EECS145M Microcomputer Interfacing Laboratory Midterm 2 Solutions - Prof. S. E. Derenzo and more Exams Electrical and Electronics Engineering in PDF only on Docsity!

UNIVERSITY OF CALIFORNIA

College of Engineering Electrical Engineering and Computer Sciences Department EECS 145M: Microcomputer Interfacing Laboratory Spring Midterm #2 (Closed book- equation sheet provided- calculators OK) Full credit can only be given if you show your work. Wednesday, April 12, 2006 PROBLEM 1 (54 points) You have designed and built a computer system to sample waveforms and perform the FFT. It has the following characteristics:

  • Sampling frequency = 2^18 Hz = 262,144 Hz
  • Number of samples = 2^16 = 65,
  • Low-pass Butterworth anti-aliasing filter of order 8 and fc = 100,000 Hz
  • Hanning (raised cosine) window Answer the following questions: 1.1 (3 points) For what frequency range does the anti-aliasing filter have gain >0.99? ( Hint: Use the Butterworth gain table on the equation sheet) 1.2 (3 points) For what frequency range does the anti-aliasing filter have gain <0.01? 1.3 (2 points) How long does it take to acquire the samples?

1.4 (3 points) To what frequencies do the FFT coefficients H 0 and H 1 correspond? 1.5 (4 points) What is the FFT coefficient with the highest frequency index and to what frequency does it correspond? 1.6 (4 points) What is the FFT coefficient that corresponds to the highest frequency and what is that frequency? 1.7 (6 points) You sample a 4,000 Hz sinewave with the system and take the FFT. What FFT coefficients should be non-zero?

1.11 (8 points) You sample a sinewave of frequency 218 – 84,000 Hz = 178,144 Hz and take the FFT. What FFT coefficients should be non-zero? How does the magnitude of the largest FFT coefficient compare with that you would get if you sampled an 84,000 Hz sinewave? 1.12 (3 points) How would you change the system to reduce the closeness in problem 1.10 by a factor of two?

PROBLEM 2 (46 points) You have been asked to help design a Doppler ultrasound system for measuring the speed of approaching vehicles on a highway. The system sends a continuous tone of 100 kHz sound waves in a well-defined direction and there is a receiver alongside that receives the Doppler- shifted echo. Your part in the project is to design the sampling and signal processing hardware and software, starting from the echo receiver.

  • The Doppler-shifted frequency is given by f ' = f / [1 – v / c ], where v is the speed of the approaching vehicle and c is the speed of sound in air (assume 300 m/s).
  • To simplify and speed your calculations, use the approximation f' ≈ f [1 + v / c ].
  • Assume that the echo receiver signal is the sum of a 0.1 volt p-p echo from the vehicle plus a 100 kHz 10V p-p echo from stationary objects.
  • The echo circuit has wide-band amplification with white noise, so you decide to use a low-pass Butterworth anti-aliasing filter that you need to design.
  • You do not use a windowing function (like the raised cosine)
  • Your system must be able to determine the speed of an approaching vehicle between 3 m/s and 60 m/s to an accuracy of ±0.3 m/s. 2.1 (5 points) What are the echo frequencies for vehicle speeds of 3 m/s, 30 m/s (67 mph), and 60 m/s (134 mph)? 2.2 (5 points) What is the minimum length of time that you need to sample to sample to clearly detect a change in speed of 0.3 m/s? 2.3 (5 points) Even though you do not use a windowing function, how could you reduce the spectral leakage from the ≈10 volt p-p 100 kHz primary onto the 0.1 v p-p echo frequency?

145M April 12, 2006 page 1 S. Derenzo

Solutions for Midterm #2 - EECS 145M Spring 2006

1.1 Filter gain >0.99 for frequencies <78,400 Hz 1.2 Filter gain <0.01 for frequencies >177,800 Hz 1.3 S = M ∆t = M/fs = 216 /2^18 Hz = 0.25 s 1.4 H 0 corresponds to 0 Hz (d.c.); H 1 corresponds to 1/S = 4 Hz 1.5 The FFT produces coefficients Hn, where n = 0 to M–1. Therefore, the coefficient with the highest index is HM-1 or H65,535, which corresponds to 4 Hz. [2 points off for HM and 0 Hz] [3 points off for HM and 2^18 Hz] 1.6 The FFT coefficient that corresponds to the highest frequency is HM/2 or H32,768. The corresponding frequency is (M/2)/S = 131,072 Hz 1.7 For a 4,000 Hz sinewave, the primary FFT coefficients are H 1000 and HM-1000. Additional neighboring coefficients H 999 , H 1001 , HM-999, and HM-1001 are non-zero (actually half the value of the primary coefficients) due to the side lobes produced by the Hann window. [2 points off for omitting side lobes] [2 points off for omitting HM-999, HM-1000, and HM-1001] 1.8 For a 4,000 Hz symmetric square wave, a sequence of harmonics will appear at odd multiples of the 4,000 Hz fundamental. So Hk1000 and HM-k1000 would be non-zero, and the Hann side lobes would be at Hk1000-1, Hk1000+1, HM-k1000-1, and HM-k1000+1. [1 point off for omitting side lobes] [4 points off for omitting harmonics] 1.9 For a 4,002 Hz sinewave, H 1000 , H 1001 , HM-1000, and HM-1001 would be non-zero and of equal magnitude, and the Hann side lobes would appear at H 999 , H 1002 , HM-999 and HM-1001. [2 points off for omitting side lobes] [2 points off for omitting HM-1000 and HM-1001] [4 points off for stating that all coefficients are non-zero] 1.10 The primary 4,000 Hz sinewave would produce non-zero values at H 999 , H 1000 , and H 1001. A second smaller sinewave of slightly higher frequency 4,000 + 4m Hz would produce non- zero values at H1000+m-1, H1000+m, and H1000+m+1 (there are also complex conjugate coefficients at HM-1000, etc.). For the smaller sinewave to appear as a separate peak, there must be a valley between the coefficient H 1001 and the coefficient at H1000+m, which requires 1000 + m

1002, or m >2. The smallest value of m we can have is 3, which corresponds to a frequency 12 Hz above 4,000 Hz. [4 points off for 4 Hz] [3 points off for 8 Hz] [both 12 Hz and 16 Hz were accepted] 1000 1002 1004 1.11 A sinewave of frequency 4M – 84,000 Hz = 178,144 Hz will produce non-zero coefficients at H 20999 , H 21000 , H 21001 , HM-20999, HM-21000, and HM-21001.

145M April 12, 2006 page 2 S. Derenzo

M = 216 = 65,536. M – 21,000 = 44,536.

A sinewave of frequency 84,000 Hz will produce non-zero coefficients at exactly the same frequency indexes. This is an example of how a higher frequency can alias to a lower frequency. However, the 84,000 Hz sinewave will be only slightly reduced by the anti- aliasing filter (gain >0.90, while the 178,144 Hz sinewave will be greatly reduced (gain ≈0.01). So the coefficients will be about 100 times smaller for the 178,144 Hz sinewave. [3 points off for not stating the non-zero coefficients] [1 point off for omitting H 20999 , H 21001 , HM-20999, and HM-21001] [3 points off for stating that the magnitudes are the same for sampling 178,144 and 84, Hz] 1.12 To reduce the answer to 1.10 by a factor of two (i.e. to 6 Hz), sample for twice as long. [2 points off for doubling the sampling frequency, which increases the number of Fourier coefficients but not the frequency spacing ∆f = 1/S] [2 points off for reducing the sampling frequency] 2.1 v = 3 m/s f = 100 kHz (1 + 3/300) = 101,000 Hz v = 30 m/s f = 100 kHz (1 + 30/300) = 110,000 Hz v = 60 m/s f = 100 kHz (1 + 60/300) = 120,000 Hz The exact calculation gives 101,010; 111,111; 111,235; and 125,000 Hz; both were OK. 2.2 ∆f = 100 Hz, so the minimum length of the sampling window must be S = 1/∆f = 0.01 s 2.3 Sample for a whole number of 100 kHz cycles. Since a windowing function was not used, this completely eliminates spectral leakage for the 100 kHz primary signal. The much smaller echo signal would still have spectral leakage, but the peak would not be obscured. [2 points off for increasing the sampling window S, this helps somewhat, but for a non- integer number of 100 kHz cycles, the spectral leakage will be severe because the primary has 100 times the amplitude of the echo signal] [4 points off for using an anti-aliasing filter since aliasing is only a problem for the white noise] [4 points off for reducing the sampling frequency, which does not reduce spectral leakage] [4 points off for using the Hann window, which was specifically excluded in the problem statement] 2.4 For n = 8 and G 1 = 0.9, f 1 /fc = 0.913. At 60 m/s f 1 = 120 kHz, and fc = 135.4 kHz 2.5 For n = 8 and G 2 = 0.01, f 2 /fc = 1.778, and f 2 = 233.7 kHz The minimum sampling frequency fs = f 1 + f 2 = 353.7 kHz 2.6 The minimum number of samples is the product of the minimum sampling window (S = 0.01 s from part 2.2) and the minimum sampling frequency (fs = 353.7 kHz from part 2.5) = 3537 samples. The next power of two is 4096 samples. 2.7 The echo is 100 times smaller than the 100 kHz tone and the white noise is 10 times smaller than the peak echo. The low pass filter falls off as 1/f^8. [2 points off if no FFT frequency index] [2 points off if no frequency scale in Hz] [2 points off if white noise not shown] [4 points off if primary tone or echo not shown] [3 points off for blank vertical scale] [2 points if vertical scale is not numbered] [2 points off if effect of the low-pass filter not shown]