UC Microcomputer Interfacing Lab: Final Exam Solutions for EECS, Exams of Microcomputers

The solutions to the final exam of the microcomputer interfacing lab course offered by the electrical engineering and computer sciences department at the university of california. Topics such as aliasing, spectral leakage, fourier transforms, and data acquisition systems.

Typology: Exams

2012/2013

Uploaded on 03/22/2013

sarup
sarup 🇮🇳

30 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
145M Final Exam Solutions page 1 May 19, 2000 S. Derenzo
UNIVERSITY OF CALIFORNIA
College of Engineering
Electrical Engineering and Computer Sciences Department
145M Microcomputer Interfacing Lab
Final Exam Solutions May 19, 2000
1a Aliasing occurs if the waveform contains frequencies above one-half the sampling frequency.
1b The Fourier Frequency Convolution Theorem states that multiplication in the time domain is
equivalent to convolution in the frequency domain. Sampling a waveform h(t) at frequency fs
is equivalent to multiplication by a sum of delta functions with a time spacing 1/fs. This in turn
is equivalent to convolving the full frequency spectrum of h(t) by a sum of delta functions
with a frequency spacing fs. So if h(t) is not bandwidth limited between –fs/2 and +fs/2,
sampling at 1/fs will cause overlap in the frequency domain. This causes the frequency band
between –fs/2 and +fs/2 to be contaminated by higher frequencies.
[5 points off for only stating the theorem] [5 points off for only stating that h(t) is multiplied
by a sum of delta functions.]
1c (1) Increase fs to be twice the highest frequency present in the signal. This spreads out the
delta functions that are convolved with the Fourier transform of h(t) and eliminates the overlap
in the frequency domain.
(2) Use a low pass filter to eliminate all frequencies above fs/2. This removes the higher
frequencies that would otherwise overlap lower frequencies.
2a Spectral leakage occurs in a Fourier transform when any frequency component is not sampled
for an integer number of cycles.
2b Sampling a waveform h(t) from time –T/2 to time +T/2 is the same as multiplying by a
rectangular time window r(t) that has value one between –T/2 and +T/2 and value zero
elsewhere. The Fourier transform of the product h(t) x r(t) is the Fourier transform of h(t)
convolved with the Fourier transform of the rectangle r(t). Since for Fourier transform of a
rectangle falls off slowly with frequency [sin(πTf)/(πTf)], the Fourier transform of h(t) x r(t)
is a smeared version of the Fourier transform of h(t).
2c Multiply the sampled waveform h(t) by a Hanning window w(t). Since the Fourier transform
of w(t) has a small amplitude away from f = 0, the Fourier transform of h(t) x w(t) has little
spectral leakage.
3a The frequency index extends from n = 0 to n = 220 = 1049k. The highest frequency has index
524k and corresponds to the Nyquist limit of 5 kHz. The amplitude spectrum (below) has
three major components
(1) The harmonics of the data signal appear at n = k 100 (where k is the harmonic number),
because the fundamental has 100 cycles in the 100 s sampling window. [4 points off if
omitted]
(2) A white noise background that adds equally into all Fourier amplitudes. (Actually, the FFT
of white noise is itself noisy, but we ignore that complication.) [4 points off if omitted]
pf3
pf4

Partial preview of the text

Download UC Microcomputer Interfacing Lab: Final Exam Solutions for EECS and more Exams Microcomputers in PDF only on Docsity!

UNIVERSITY OF CALIFORNIA

College of Engineering Electrical Engineering and Computer Sciences Department 145M Microcomputer Interfacing Lab Final Exam Solutions May 19, 2000

1a Aliasing occurs if the waveform contains frequencies above one-half the sampling frequency.

1b The Fourier Frequency Convolution Theorem states that multiplication in the time domain is equivalent to convolution in the frequency domain. Sampling a waveform h(t) at frequency fs is equivalent to multiplication by a sum of delta functions with a time spacing 1/fs. This in turn is equivalent to convolving the full frequency spectrum of h(t) by a sum of delta functions with a frequency spacing fs. So if h(t) is not bandwidth limited between –fs/2 and +fs/2, sampling at 1/fs will cause overlap in the frequency domain. This causes the frequency band between –fs/2 and +fs/2 to be contaminated by higher frequencies. [5 points off for only stating the theorem] [5 points off for only stating that h(t) is multiplied by a sum of delta functions.]

1c (1) Increase fs to be twice the highest frequency present in the signal. This spreads out the delta functions that are convolved with the Fourier transform of h(t) and eliminates the overlap in the frequency domain. (2) Use a low pass filter to eliminate all frequencies above fs/2. This removes the higher frequencies that would otherwise overlap lower frequencies.

2a Spectral leakage occurs in a Fourier transform when any frequency component is not sampled for an integer number of cycles.

2b Sampling a waveform h(t) from time –T/2 to time +T/2 is the same as multiplying by a rectangular time window r(t) that has value one between –T/2 and +T/2 and value zero elsewhere. The Fourier transform of the product h(t) x r(t) is the Fourier transform of h(t) convolved with the Fourier transform of the rectangle r(t). Since for Fourier transform of a rectangle falls off slowly with frequency [sin(πTf)/(πTf)], the Fourier transform of h(t) x r(t) is a smeared version of the Fourier transform of h(t).

2c Multiply the sampled waveform h(t) by a Hanning window w(t). Since the Fourier transform of w(t) has a small amplitude away from f = 0, the Fourier transform of h(t) x w(t) has little spectral leakage.

3a The frequency index extends from n = 0 to n = 2^20 = 1049k. The highest frequency has index 524k and corresponds to the Nyquist limit of 5 kHz. The amplitude spectrum (below) has three major components (1) The harmonics of the data signal appear at n = k 100 (where k is the harmonic number), because the fundamental has 100 cycles in the 100 s sampling window. [4 points off if omitted] (2) A white noise background that adds equally into all Fourier amplitudes. (Actually, the FFT of white noise is itself noisy, but we ignore that complication.) [4 points off if omitted]

(3) The effect of the low pass filter, which decreases all Fourier amplitudes sharply from 2,000 Hz (the maximum frequency of interest) to 5 kHz (the Nyquist limit). [4 points off if omitted]

Fourier frequency index n Frequency fn

Background noise

(^0) 524k (^) 1049k 0 Hz 5.24 kHz

Data signal harmonics every 1 Hz (∆n = 100) (exact amplitudes depend on signal)

Effect of low-pass filter

3 kHz

10.49 kHz

3b The first Fourier magnitude Fn corresponds to fn = n/100 s = n (0.01 Hz).

3c Design requirements: Gain > G 1 = 0.99 for f < f 1 = 3,000 Hz; Gain < G 2 = 0.001 for all frequencies that could alias to 3,000 Hz. Choose n = 8; from table f1/fc = 0.784; fc = 3,000 Hz/0.784 = 3,827 Hz; f2/fc = 2.371; f2 = 9,074 Hz; since f2 aliases to fs – f2 = f1, then fs > f1 + f2 = 12,074 Hz, which exceeds our sampling frequency of 10,486 Hz. Choose n = 10; from table f1/fc = 0.823; fc = 3 kHz/0.823 = 3.645 kHz; f2/fc = 1.995; f2 = 7.272 kHz; since f2 aliases to fs – f2 = f1, then fs > f1 + f2 = 10.272 kHz, which is just a bit below our sampling frequency of 10,486 Hz. [Both n = 10 and n =12 were accepted]

3d There is no spectral leakage for the data signal, since exactly 100 periods are present. Spectral leakage does not affect the random background noise since there is no structure to its frequency spectrum. Therefore a Hanning window would not help.

3e Program steps:

1 Sample for 100 s at 10,486 Hz (1,048,600 values). 2 take the FFT to compute the complex Fourier amplitudes Fk 3 estimate the background noise frequency amplitude B as the average of amplitudes whose Fourier frequency indices are not a multiple of 100. 4 compute 10,486 new Fourier amplitudes Pk = F100k – B 5 take the inverse FFT of Pk to recover one cycle of the analog data signal 6 demodulate to recover the digital signal [5 points off if background is subtracted from 2^20 Fourier coefficients and only one second of the inverse FFT is used] Note: this problem works out better if the signal were repeated for a number of seconds that is a power of two (e.g. 128 seconds).

5 The central computer uses its parallel input port to read the data from the bus and stores it in a memory location for that sensing station 6 The central computer resets “ready for data” (essential to put the tri-state driver into high impedance mode) 7 Loop back to step 2 to collect data from any other remote sensing stations that heard the gunshot. If enough time has passed to allow all stations to report the gunshot (a second or two at most), go to the next step. 8 Use the recorded times to compute the map coordinates and transmit to police cars 9 Loop back to step 1 to prepare to record the next gunshot

145M Final Exam Grades (15 undergraduate students, no graduate students) :

Problem 1 2 3 4 Total Average 32.3 32.3 58.7 46.9 170. rms 6.7 4.1 5.3 5.0 13. Maximum 40 40 70 50 200

145M Numerical Grades (15 undergraduate students, no graduate students) :

Lab total Lab Partic. Midterm #1 Midterm #2 Final Total Average 426.2 100.0 92.8 78.0 170.2 867. rms 10.6 0.0 4.3 9.6 13.0 2 5. 1 Maximum 450 100 100 100 200 950

145M Letter Grade Distribution

Letter Grade Course Totals (1000 max) A+ 911 A 907, 899 A– 888 B+ 877, 873, 870 B 865, 860, 853 B- 844, 843, 842, 839, 837 C+ C C– D+ D