📄 compexer.txt
字号:
scaled version of the noise from step 2. For this problem, we will define
the SNR to be equal to the peak amplitude of the target waveform (which is
one), divided by the standard deviation of the noise. Plot these four test
signals.
4. Calculate and plot the first difference of the four test signals.
5. Calculate and plot the correlation of each of the four signals with the
60 point target signal. (Check your program by making sure that the peaks
have the proper symmetry).
6. Based on your results, estimate the minimum SNR that the signal must have
in order to reliably detect the target by:
a. a visual inspection of the waveform
b. thresholding the first difference
c. thresholding the correlation signal
CHAPTER 8: THE DISCRETE FOURIER TRANSFORM
1. Generate and plot a 512 point test signal:
x[n] = (sin(2 pi n 0.08) + 2 sin(2 pi n 0.3)) exp(-(n-200)^2 / 60^2)
This signal is composed of two sinusoids, with frequencies of 0.08 and 0.3,
multiplied by a Gaussian, with a standard deviation of 60. Each sinusoid
produces a peak in the frequency domain, while the Gaussian makes these
peaks wider and more uniform (more about this in Chapter 9).
2. Take the DFT of this signal. Plot the real and imaginary parts. These
plots contain the same information that is contained in the time domain. Is
the information in a form that humans can easily understand? Explain, using
these plots as an example.
3. Convert the frequency spectrum into polar form. Plot the magnitude on a
linear amplitude scale. Is this information in a form that humans can easily
understand? Explain.
4. Plot the magnitude on a log amplitude scale. Do the samples between the
two peaks have a value of zero? Explain.
5. Plot the phase signal. Identify those sections of the phase that are
meaningful, and those sections that are nothing more than meaningless noise.
6. Unwrap the phase in the meaningful sections, and plot. Does this
unwrapping make the phase easier to understand? Explain.
7. Convert the polar frequency spectrum back into rectangular notation, and
then take the Inverse DFT. Compare the resulting time domain signal with
the original? Are they identical? Plot the difference between the two
signals, and explain why it is not entirely zero.
CHAPTER 9: APPLICATIONS OF THE DFT
1. Create a 600 sample test signal: x[n] = cos(2 pi n 8 / 600) exp(n/200).
Add random noise to this signal, with mean = 0 and SD = 1. Plot this signal.
2. Create a 9 point impulse response, h[n]: 1/25, 2/25, 3/25, 4/25, 5/25,
4/25, 3/25, 2/25, 1/25. Plot this signal. What kind of filter is this?
3. Calculate and plot the convolution of x[n] and h[n]. How has this
convolution improved the signal?
4. Pad x[n] with zeros to form a 1024 sample signal, calculate the spectrum,
and plot the magnitude.
5. In the spectrum of x[n], identify the portion that is mostly signal, and
the portion that is mostly noise. What characteristic of the noise
generated in step 1 insures that the noise is white? Why does the noise
appear irregular in this spectrum, instead of perfectly flat? How could you
make the noise appear flatter?
6. Pad h[n] with zeros to form a 1024 sample signal, calculate the frequency
response, and plot the magnitude. Identify the frequencies that are passed
through the filter (> 90% amplitude), those that are partially passed, and
those that are mostly blocked (< 10% amplitude).
7. Multiply the frequency spectrum by the frequency response (see Eq. 9-1),
and take the inverse DFT. Is this signal identical to that obtained by
direct convolution? Test this by subtracting the two signals, and plotting
the result. Explain the result.
CHAPTER 10: PROPERTIES OF THE DFT
Time domain shifting, time domain aliasing.
1. Generate and plot a 512 sample signal containing a Gaussian curve:
x[n] = exp(-(n-200)^2/900)
2. Calculate the DFT, convert to polar form, and plot the magnitude and
phase.
3. Modify the frequency spectrum such that the time domain signal will be
shifted by 270 samples to the right.
4. Take the Inverse DFT of the modified spectrum. Plot the resulting time
domain signal. Has the signal shifted as expected? Has aliasing occurred?
Explain.
Modulation and frequency domain aliasing.
For each of the following steps, plot the time domain signal, calculate the
DFT, and plot the magnitude.
5. Generate and plot the following 512 sample signal, calculate the DFT, and
plot the magnitude.
x[n] = exp(-(n-200)^2/900) sin(2 pi n 0.027) + 0.08
6. Generate and plot the following 512 sample signal, calculate the DFT, and
plot the magnitude.
x[n] = sin(2 pi n 0.3125)
7. Multiply the time domain signals created in steps 5 and 6, plot,
calculate the DFT, and plot the magnitude. On your plot, identify the upper
sideband, the lower sideband, and the carrier wave. Has aliasing occurred?
8. Repeat (6), except using a frequency of 0.4922 for the sinusoid (instead
of 0.3125). Has aliasing occurred? Why are their two peaks to the left of
the carrier wave, instead of only one? Explain.
CHAPTER 11: FOURIER TRANSFORM PAIRS
1. Generate the following waveforms, each 512 samples long, centered on
sample 200. Normalize the amplitude of each waveform to give it unity area.
a. Rectangular pulse, 45 samples wide (i.e., 45 nonzero values)
b. Triangular pulse, 45 samples wide (i.e., 43 nonzero values)
c. Gaussian, standard deviation = 13.5
e. Hamming window, M = 66 (see Eq. 16-1 and Fig. 16-2a)
2. Calculate the DFT of each waveform and convert to polar form.
3. To allow a fair comparison of the four magnitudes, each of these signals
has a "cutoff frequency" equal to 0.01. That is, the width of each time
domain waveform is selected to make the magnitude have a value of 0.707 at
sample 5 (i.e., 5/512 = 0.01). However, one of these four signals is
incorrect, it does not have a cutoff frequency of 0.01. Identify which of
the four is incorrect, and modify it so that it does have a cutoff frequency
of 0.01. Explain your modification.
4. Plot each of the four time domain waveforms (the correct versions), each
of the four magnitudes, and each of the four magnitudes on a logarithmic
amplitude scale.
5. Suppose that these four waveforms were being used as filter kernels. The
goal is to pass a signal at frequency 0.005, while blocking noise in the
frequency band of 0.03 to 0.4. Answer the following.
a. Why must the four time domain waveforms be normalized to have the same
area in this comparison? What would be the affect on the magnitudes if they
were allowed to have different areas?
b. Are any of these four filters better or worse than the others in how well
the signal is passed? Explain.
c. Are any of these four filters better or worse than the others in how well
the noise is blocked? Explain.
d. Which of these four filters is the best for this application?
e. Which of these four filters is the worst for this application?
CHAPTER 12: THE FAST FOURIER TRANSFORM
1. Write (or copy) an FFT and an IFFT subroutine.
2. Test that the subroutines are operating correctly:
a. Generate two random signals, each containing 256 samples, and place them
in the real and imaginary parts of the time domain. Take the FFT and then
the IFFT. Calculate the difference between the original signals, and the
reconstructed signals. Is the difference zero? Explain. Make a plot of
the difference for the real part.
b. Place a random signal into the real part of the time domain, and zeros
into the imaginary part. Take the FFT and convert to polar form. Plot the
real & imaginary parts. (To make the frequency spectra easier to graph, you
will probably want to use random numbers that have a mean of zero). Does
the frequency domain have the proper symmetry? Explain
3. Use the FFT in a spectral analysis problem:
a. Generate a 1,024,000 sample signal containing normally distributed random
noise with zero mean and a standard deviation of one, plus a sine wave with
amplitude 0.1, and a frequency of 0.2.
b. Plot 1024 samples from this signal. Is the sine wave visible?
c. Take the FFT of these 1024 samples and plot the magnitude. Is the sine
wave visible?
d. Use the method of Chapter 9 to calculate the average frequency spectrum
of the 1,024,000 point signal (break the signal into 1024 sample segments,
calculate the FFTs, and average the magnitudes). Is the sine wave visible in
the averaged spectrum?
4. Answer the following questions.
a. If the DFT by correlation were used in step 2a instead of the FFT,
approximately how much larger in amplitude would the difference signal be?
b. In step 2b, why will the frequency spectra be easier to plot if the time
domain signals have a mean of zero?
c. In step 2b, if the random signal were placed in the imaginary part, and
all zeros placed in the real part, how would the frequency domain be changed?
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -