乐趣区

关于算法:ECE-466-matlab问题求解

ECE 466 – SS 2023 – Homework set #7
Due Date: 11:59pm – April 28, 2023
This homework set is to be done individually. It contains both analytical and MATLAB
problems. Analytical problems can be typed or scanned. If scanned, make sure that your writing
is legible, and crop any unnecessary edges to reduce file size. In addition to code, MATLAB
problems require a report. Your homework should be uploaded on D2L as ONE zip file. The file
should be named as YourLastName_YourFirstName_HW7.zip. Be sure to include the answers
to analytical questions, code you wrote for the MATLAB problems, and the report for the
MATLAB problems. Code should be provided in a separate MATLAB (.m) file(s), and should
execute. If I’m not able to run your code it will receive 0 points. Documentation on MATLAB
functions can be found via the commands >help functionname or >doc functionname. Make
sure to show all your work to get full points.
Problem 1. [15 points]In this problem you will show that the Goertzel algorithm can efficiently
compute the DFT for a frequency ω, but also for ?ω.
When deriving the Goertzel algorithm we used the fact that W?kNN = 1 to derive a
recurrence for computing a specific DFT value X[k] for a finite length sequence x[n], n =
0, . . . , N ? 1.
(a) Using the fact that W kNN = W
nN
N = 1 show that X[N ? k] can be obtained as the
output after N iterations of the difference equation depicted in Fig. 1a. That is,
show that X[N ? k] = yk[N].
(b) Show that X[N ? k] is also equal to the output after N iterations of the difference
equation depicted in Fig. 1b. Note that the system of Fig. 1b has the same poles
as the system for the Goertzel algorithm but the coefficient required to implement
the complex zero is the complex conjugate of the corresponding coefficient of the
Goertzel algorithm.
Problem 2. [15 points]Construct a flow graph for a 16 point decimation-in-time FFT algorithm.
Label all multipliers in terms of powers of W16, and also label any branch transmittances
that are equal to ?1. Label the input and output nodes with the appropriate values of
the input and DFT sequences, respectively. Determine the number of real multiplications
and the number of real additions required to implement the flow graph.
1
(a) System for Problem 1.a (b) System for Problem 1.b
Problem 3. [15 points] Let x[n] = cos(2πn/5) and v[n] be the sequence obtained by applying a
32-point rectangular window to x[n] before computing V (ejω). Sketch |V (ejω)| for ?π ≤
ω ≤ π, labeling the frequencies of all peaks and the first nulls on either side of the peak.
In addition, label the amplitudes of the peaks and the strongest side lobe of each peak.
Problem 4. [20 points] We are interested in estimating the spectra of three very long real-valued
sequences x1[n], x2[n], and x3[n], each consisting of the sum of two sinusoidal components.
However, we only have a 256-point segment of each sequence available for analysis. Let
xˉ1[n], xˉ2[n] and xˉ3[n] denote the 256 point segments of x1[n], x2[n] and x3[n] respectively.
We have some information about the nature of the spectra of the infinitely long sequences
as indicated from the equations below
X1(e
jω) ≈ δ(ω + 17π
64
) + δ(ω +
π
4
) + δ(ω ? π
4
) + δ(ω ? 17π
64
)
X2(e
jω) ≈ 0.017δ(ω + 11π
32
) + δ(ω +
π
4
) + δ(ω ? π
4
) + 0.017δ(ω ? 11π
32
)
X3(e
jω) ≈ 0.01δ(ω + 257π
1024
) + δ(ω +
π
4
) + δ(ω ? π
4
) + 0.01δ(ω ? 257π
1024
)
We want to analyze xˉ1[n], xˉ2[n] and xˉ3[n] by first multiplying them with a window and
then taking the magnitude of the 2048-point DFT of the windowed sequence, i.e. for
i = 1, 2, 3
v[n] = w[n]xˉi[n]
|V [k]| = |V (ejω)|ω=2πk/2048| = |
N?1∑
n=0
v[n]W kn2048|
For each of the three signals xˉ1[n], xˉ2[n] and xˉ3[n] indicate whether w[n] should be a
Rectangular or a Hamming window would be preferable, i.e. which window would enable
us to distinguish the frequency components in the signals? A good justification at mini-
mum will include a quantitative consideration of both resolution and side lobe behavior
of the windows. Note that is is possible that both or neither of the windows will work for
any given sequence. Table 7.2 in your textbook may provide some useful information.
2
Problem 5. [15 points] Sketch the spectrogram obtained by using a 256-point rectangular window
and 256-point DFTs with no overlap (R = 256) on the signal
x[n] = cos
(πn
4

  • 1000 sin
    (πn
    8000
    ))
    for the interval 0 ≤ n ≤ 16000. Explain why the spectrogram takes its shape. (Hint:
    The instantaneous frequency at each n can be determined by taking the derivative of a
    sinusoid with respect to n.)
    3
    The following MATLAB problems require you to write a report, answering questions and in-
    cluding necessary plots.
    In the following problems you will use the MATLAB function spectrogram. It is suggested
    you take some time to fully understand the details of the spectrogram functionm using MAT-
    LAB’s documentation via the doc spectrogram command. Some additional things to note:
    The spectrogram function with no output arguments will plot the results to the current fig-
    ure. For real signals x[n], the spectrogram function only calculates or plots a portion of
    the frequency components (from 0 to π) since the remaining are“redundant”. It is com-
    mon to use a“short”time window and to plot frequency on the y axis. The command
    spectrogram(s1,hamming(256),’yaxis’) produces a spectrogram when the windowing is ef-
    fected by a Hamming window of length 256, and the frequencies are plotted on the y axis.
    Please use the‘yaxis’parameter for all your figures.
    Problem 6. [MATLAB] [10 points] Repeat problem 5 in MATLAB using the spectrogram func-
    tion.
    Problem 7. [MATLAB] [10 points] Consider the continuous-time linear frequency modulated (FM)
    chirp signal
    x(t) = cos(2πμt2).
    (a) Generate a discrete-time linear FM chirp signalk x[n] by using a sampling frequency
    of 5 MHz and letting the chirp rate μ = 4× 109. Assume that the continuous-time
    chirp lasts 200μs. Plot x[n] and include the plot in your report.
    (b) Generate a spectrogram for the signal x[n] of part (a) using the spectrogram com-
    mand with 256 point FFT’s, a 256 point triangular window and an overlap of 255
    samples between sections. The MATLAB function triang can be used to construct
    the triangular window. Include the spectrogram plot in your report.
    (c) Repeat parts (a) and (b) for μ = 1010. Compare the spectrograms. What do you
    observe?
    (d) Notice the distinct ridge in both spectrograms. How is this related to x(t)? (Hint:
    instantaneous frequency)
退出移动版