📄 homework.txt
字号:
HOMEWORK PROBLEMS FOR CHAPTERS 2-13 OF:
"THE SCIENTIST AND ENGINEER'S GUIDE TO DIGITAL SIGNAL PROCESSING"
COMMENTS AND SUGGESTIONS ON THESE PROBLEMS ARE WELCOME!
SEND THEM TO THE AUTHOR AT: SMITH@DSPGUIDE.COM
CHAPTER 2: STATISTICS, PROBABILITY AND NOISE
1. A signal contains 100,000 samples, and each sample is represented by 10
bits. Assume that addition and subtraction require 1 microsecond,
multiplication and division require 3 microseconds, the square-root requires
10 microseconds, and other programming actions (such as array indexing and
loop control) are negligible. Find the time required to calculate the mean
and standard deviation of the signal using:
a. The direct method, as shown in Table 2-1.
b. Running statistics, as shown in Table 2-2.
(You will need to modify the program in Table 2-2 to calculate the mean and
standard deviation only of the entire signal, not after each point. That
is, move the NEXT I% in line 320 to line 250).
c. The histogram method, as shown in Table 2-3.
d. Repeat (c) for the case that each sample is represented by 32 bits. How
much memory is required to hold the histogram for this calculation, assuming
each bin requires two bytes?
2. You are asked to evaluate a new device for detecting cancer in humans.
When a healthy person is tested, the device produces a number that follows a
normal distribution with a mean of 100 and a standard deviation of 10. When
a person with cancer is examined, the resulting number is normally
distributed with a mean of 120 and a standard deviation of 8. When the
device is used on a person of unknown health, a threshold of 110 is used to
make the diagnosis: if the reading is < 110, the person is classified as
healthy; if the reading is > 110, the person is considered to have cancer.
a. Sketch the two pdfs, and indicate on your sketch the location of the
threshold.
b. For the healthy distribution, how many standard deviations above the mean
is the threshold?
c. For the sick distribution, how many standard deviations below the mean is
the threshold?
d. If a healthy person is tested with the system, what is the probability
that the reading produced will be less than 110? Greater than 110?
e. If a sick person is tested with the system, what is the probability that
the reading produced will be less than 110? Greater than 110?
f. What percentage of sick patients are incorrectly classified as healthy?
g. What percentage of healthy patients are incorrectly classified as sick.
3. Using the same cancer detection system as in problem 2, where should the
threshold be set to insure that 99% of all sick persons being examined are
reported as sick? At this threshold, what fraction of healthy persons are
incorrectly reported as being sick?
4. Twelve financial experts are asked to predict the stock market price 30
days in advance. The values they provide are: 996, 868, 855, 956, 867, 933,
866, 887, 936, 901, 818, 956. In 30 days, the true stock market price is
found to be 876.
a. What is the mean of the predictions?
b. What is the standard deviation of the predictions?
c. What is the accuracy of the experts' prediction?
d. What is the precision of an experts' prediction?
5. An astronomer measures the brightness of a star on 30 consecutive nights.
Due to atmospheric turbulence and other random errors, the measurements have
a coefficient-of-variation of 3.0%. One of the measurements is found to be
6.9% higher than the average.
a. What is the signal-to-noise ratio of the 30 sample signal?
b. What is the probability that any one measurement will be at least 6.9%
higher than the mean from random error?
c. Can the astronomer conclude that the 6.9% reading is a result of the star
changing in brightness? Explain.
d. Repeat (b) and (c) for the high measurement being 10.2% above the mean.
6. When two or more random signals are added, the resulting signal has a
mean equal to the sum of the means of the component signals. Likewise, the
variance of the resulting signal is equal to the sum of the variances of the
component signals. Derive an equation showing how the standard deviation of
the resulting signal is related to the standard deviations of the component
signals. (This is often called "adding in quadrature").
7. Find the mean and SD of the signal that results from adding the random
signals indicated.
a. 1 volt mean, 20 mV SD; 1 volt mean, 20 mV SD.
b. 1 volt mean, 20 mV SD; 1 volt mean, 2 mV SD.
c. 1 volt mean, 20 mV SD; 1 volt mean, 0.2 mV SD.
d. 3 volt mean, 10 mV SD; 5 volt mean, 15 mV SD.
e. 10 volt mean, 10 mV SD; 5 volt mean, 15 mV SD; 0.2 Volt mean, 100 mV SD.
8. Electronic systems contain many noise sources; however, the total noise
of a system is usually dominated by only one of these noise sources. Based
on your answers in the last two problems, explain why this is so.
CHAPTER 3: ADC AND DAC
1. Specify how many bits are needed to appropriately digitize each of the
following signals. Choose from: 6 bits, 8 bits, 10 bits, 12 bits, 14 bits,
or 16 bits.
a. A signal where the maximum amplitude is 1 volt and the rms noise is 1.5
millivolts.
b. A signal with a signal-to-noise ratio of 900 to 1.
c. A signal with a coefficient-of-variation of 0.4%.
d. A high-fidelity audio system (hint: a jack-hammer is about 50,000 times
louder than a pin drop).
e. A black and white digital image (hint: under the best conditions, the
human eye can differentiate about 200 shades of gray between pure black and
pure white).
2. A scientist evaluates two different digital thermometers. Each has a
digital read-out to the nearest one degree, and updates once each second.
When the temperature is held constant, the digital display of thermometer A
does not change, but the display of thermometer B randomly toggles between
three to four adjacent readings (i.e., +/- 2 degrees). For the questions
below, assume that the temperature is held constant.
a. What is the largest possible error in an individual reading from A?
b. What is the largest possible error in an individual reading from B?
c. In a single reading, which provides the "best" information? Explain.
d. If 1000 readings are taken with A, what is the standard deviation?
e. If 1000 readings are taken with B, what is the approximate standard
deviation? (choose from 0.1, 0.5, 2.0 and 4.0).
f. If 1000 readings are taken with thermometer B, what is the "typical error
between the mean of the readings, and the mean of the underlying process?
g. If 1000 readings are taken with each thermometer, which data set provides
the "best" information? Explain.
h. How many readings must be taken with thermometer A to reliably detect a
temperature change of 0.15 degrees? (choose from 10, 100, 1000, 1 million,
1 billion, or "it cannot be done"). Explain.
i. Repeat (h) for thermometer B.
3. An engineer designs a microprocessor controlled ADC board that can
acquire an 8 bit sample every 10 microseconds. His boss walks in and says:
"You'll get a raise if the system can be modified to acquire a 12 bit sample
every 100 milliseconds- but it needs to be done by tomorrow!" The first
thing the engineer does is to measure the noise on the analog signal
entering the ADC chip. He then smiles, and plans how to spend the extra
money. In detail, explain what the engineer was looking for in the noise
measurement, and how he can make the modification.
4. An analog electronic signal is composed of three sine waves: 1 kHz @ 1
volt amplitude, 3 kHz @ 2 volts amplitude, and 4 kHz @ 5 volts amplitude
(all voltage readings are peak-to-peak). The signal is digitized with 12
bits, spread over the range of -5 volts to +5 volts. For each sampling rate
below, describe the frequency components that exist in the digital signal.
Be sure to specify three things for each component: its digital frequency (a
number between 0 and 0.5), its amplitude (in digital numbers, peak-to-peak),
and its phase relative to the original analog signal (either 0 degrees or
180 degrees).
a. Sampling rate = 100 kHz.
b. Sampling rate = 10 kHz.
c. Sampling rate = 7.5 kHz.
d. Sampling rate = 5.5 kHz.
e. Sampling rate = 5 kHz.
f. Sampling rate = 1.7 kHz.
5. A high-fidelity audio signal (containing frequencies between 20 Hz and 20
kHz) is contaminated with interference from a nearby switching power supply,
operating at 32 kHz. To eliminate the interference, the analog signal is
passed through an 8 pole Butterworth filter with a cutoff frequency of 24
kHz. The filtered signal is then digitized at 44 kHz.
a. Sketch and label the frequency spectrum of the analog signal, showing:
the audio frequency band, the interfering signal, the frequency response of
the filter, one-half the sampling frequency, and the sampling frequency.
b. What is the approximate attenuation of the filter at the frequency of the
interference?
c. What is the effect of the filter on the audio information?
d. Sketch and label the frequency spectrum of the digital signal, showing:
the audio frequency band, and the interfering signal.
e. At what frequency does the aliased interference appear in the digitized
signal?
f. If an 8 pole Chebyshev filter (6% ripple) were used instead, how would
the amplitude of the aliased interference change?
g. Repeat (a)-(f) with the cutoff frequency of the filter set at 20 kHz.
6. A multirate technique is used to handle the interference in the last
problem. The original analog signal (with interference) is digitized at a
sampling rate of 176 kHz. A low-pass digital filter then removes all
digital frequencies above 0.18 with less than a 0.02% residue, while
passing all frequencies below 0.12 with less than a 0.02% passband ripple
(an easy task for a digital filter). The digital signal is then resampled
at 44 kHz, that is, every three out of four samples are discarded.
a. Sketch and label the frequency spectrum of the digital signal before
filtering, showing: the audio frequency band, the interfering signal, and
the approximate frequency response of the digital filter.
b. Has aliasing occurred during the sampling? Explain.
c. In a fair comparison, should this digital filter be compared against the
analog Butterworth filter, or the analog Chebyshev filter? Explain.
d. How much better is the digital filter performing compared to the analog
filter you indicated in (c)? (It can be difficult to compare analog and
digital filters; make some sort of quantitative comparison, and explain your
method).
e. Sketch and label the frequency spectrum of the digital signal after
resampling, showing: the audio frequency band, and any interfering signals.
7. On television, rotating objects such as wagon wheels and airplane
propellers often appear to be moving very slowly or even backwards. This is
a result of aliasing, caused by the sampling rate of the video (30 frames
per second) being less than twice the frequency of the rotational motion. To
understand this, imagine we paint one of the blades of an airplane propeller
so that we can identify it from the other blades. We will then turn the
propeller at 33 rotations per second, in a clockwise direction. In frame
number 1 of our video sequence, the marked blade happens to be exactly at
the top of the propeller.
a. How many rotations does the marked blade make between two successive
frames?
b. Draw a sketch of how the propeller would appear in frames 1, 2, 3 and 4.
c. How many frames does it take for the marked blade to again appear at the
top?
d. What rotational frequency is (c) in rotations per second?
e. Is this apparent rotation clockwise or counterclockwise?
f. Explain using Fig. 3-4 how the marked blade's actual frequency, the frame
rate, and the marked blade's observed frequency are related.
g. Repeat (a) to (f) when the propeller is turning at 57 rotations per
second.
8. When viewed on television at 30 frames per second, what is the apparent
rotational rate of a 4 blade propeller, turning at 44.7 rotations per
second, if all the blades are identical? Is the apparent rotation clockwise
or counterclockwise?
CHAPTER 4: DSP SOFTWARE
1. The following subroutine is used to calculate the function: y = exp(x),
using an efficient implementation of Eq. 4-3:
y = 1
term = 1
for counter = 1 TO 150
term = term * x / counter
y = y + term
next counter
a. What are the values of "y" and "term" at the end of the first, second,
and third loops?
b. At the end of all 150 loops, how many terms have been included in the
calculation?
2. Calculate the numeric value of the first 14 terms of the series for
exp(x) (Eq. 4-3), where x = 1.3. From this data, how many terms must be used
to achieve an accuracy of one part in one-million?
3. To illustrate the size of quantization levels, imagine representing the
heights of two buildings as digital numbers. Building A is exactly 100
meters in height, while Building B is 100.0001 meters. That is, Building B
is about the thickness of a sheet of paper (0.1 mm) higher than building A.
Indicate whether or not each of the following types of digitized numbers
could show that the two buildings are different in height.
a. Integer (8 bit, unsigned)
b. Integer (16 bit, 2's complement)
c. Single precision floating point
d. Double precision floating point
4. Repeat problem 3 for Building B being one ten-millionth of a meter
higher than Building A (about the diameter of a single atom). If double
precision were used, how much smaller than the diameter of an atom are the
quantization levels?
5. Find the decimal number that corresponds to the following floating point
bit patterns.
a. 10111000101010100000000000000000
b. 10000000000000000000000000000000
c. 01111001111110010000000000000000
d. 01111111100000000000000000000000
6. Convert the following decimal numbers into their IEEE floating point bit
patterns:
a. 1
b. 2
c. 4
d. -5
e. 18
7. Imagine you are trying to represent the number: 4.0000003 in single
precision.
a. What bit pattern corresponds to the number 4?
b. What bit pattern corresponds to the next largest number that can be
represented?
c. What decimal number corresponds to the bit pattern in (b)?
d. Which of the above two binary patterns should be used to represent the
number: 4.0000003? Why?
e. What is the error introduced when this number is stored in single
precision? Express you answer both as an absolute number, and as a fraction
of the number being represented.
8. In an FIR digital filter, each sample in the output signal is found by
multiplying M samples from the input signal by M predetermined coefficients,
and adding the products. The characteristics of these filters (high-pass,
low-pass, etc.) are determined by the coefficients used. For this problem,
assume M = 5000, and that single precision floating point math is used.
a. How many math operations (the number of multiplications plus the number
of additions) need to be conducted to calculate each point in the output
signal?
b. If the output signal has an average amplitude of about one-hundred, what
is the expected error on an individual output sample. Assume that the
round-off errors combine by addition. Give your answer both as an absolute
number, and as a fraction of the number being represented.
c. Repeat (b) for the case that the round-off errors combine randomly.
CHAPTER 5: LINEAR SYSTEMS
1. Two discrete waveforms, x[n] and y[n], are each eight samples long, given
by:
x[n]: 1, 2, 3, 4,-4,-3,-2,-1
y[n]: 0,-1, 0, 1, 0,-1, 0, 1
For this problem, you can add additional samples with a value of zero on
either side of the signals, as needed. Calculate, sketch and label the
following signals:
a. x[n]
b. y[n]
c. 5x[n]
d. -7y[n]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -