Define a length-32 signal to be r[n] = 1 + 7 cos(0.2 pi n) for n = 0, 1, ..., 31
ID: 2084983 • Letter: D
Question
Define a length-32 signal to be r[n] = 1 + 7 cos(0.2 pi n) for n = 0, 1, ..., 31. Then form a length-N signal by zero-padding with 48 zeros, and take the N-point DFT of the zero-padded signal to obtain R[k], for k = 0, 1, 2, ..., N - 1. (a) Determine the value of N for the N-point DFT taken after the zero padding. (b) Determine the indices, k_PEAKS, where the two maximum values of |R[k]| are found, and, give both indices where |R[k]| = max_k {|R[k]|}. (c) Determine the maximum value of |R[k]| at the two indices found in part (b).Explanation / Answer
Code:
function dfmax
n = 0:31;
r = 1 + cos(0.2*pi*n);
% after padding of 48 zeros,new length will be N = 32+48=80
N = 80;
R = fft(r,N)
%maximum value and indeces
[Rmax1 K_peak1] = max(R)
[Rmax2 K_peak2] = max(R-R(K_peak1))
end
Result:
R =
Columns 1 through 7
33.8090 + 0.0000i 7.7682 -23.2499i -4.6323 - 3.1286i 5.1342 - 3.2776i -1.7205 - 3.5792i 2.7789 + 1.1511i -0.5072 - 1.9259i
Columns 8 through 14
2.8517 + 9.6631i 18.4635 - 1.0633i 4.1713 -14.5663i -2.3972 - 2.3972i 4.0169 - 3.5261i -1.0633 - 4.1560i 1.7827 - 0.4125i
Columns 15 through 21
1.4589 - 3.8920i -0.3101 - 0.7487i 2.5590 - 1.7205i -0.2038 - 2.2866i 1.4446 - 0.0592i 1.3972 - 2.4410i -0.0000 - 0.4271i
Columns 22 through 28
2.1580 - 0.9684i 0.1518 - 1.6556i 1.2268 + 0.1833i 1.4410 - 1.7205i 0.1109 - 0.2678i 1.9527 - 0.4804i 0.3725 - 1.3052i
Columns 29 through 35
1.0633 + 0.3748i 1.5017 - 1.2402i 0.1611 - 0.1611i 1.8196 - 0.1029i 0.5365 - 1.0633i 0.9261 + 0.5428i 1.5677 - 0.8654i
Columns 36 through 42
0.1842 - 0.0763i 1.7205 + 0.2251i 0.6737 - 0.8719i 0.7999 + 0.7039i 1.6392 - 0.5384i 0.1910 + 0.0000i 1.6392 + 0.5384i
Columns 43 through 49
0.7999 - 0.7039i 0.6737 + 0.8719i 1.7205 - 0.2251i 0.1842 + 0.0763i 1.5677 + 0.8654i 0.9261 - 0.5428i 0.5365 + 1.0633i
Columns 50 through 56
1.8196 + 0.1029i 0.1611 + 0.1611i 1.5017 + 1.2402i 1.0633 - 0.3748i 0.3725 + 1.3052i 1.9527 + 0.4804i 0.1109 + 0.2678i
Columns 57 through 63
1.4410 + 1.7205i 1.2268 - 0.1833i 0.1518 + 1.6556i 2.1580 + 0.9684i -0.0000 + 0.4271i 1.3972 + 2.4410i 1.4446 + 0.0592i
Columns 64 through 70
-0.2038 + 2.2866i 2.5590 + 1.7205i -0.3101 + 0.7487i 1.4589 + 3.8920i 1.7827 + 0.4125i -1.0633 + 4.1560i 4.0169 + 3.5261i
Columns 71 through 77
-2.3972 + 2.3972i 4.1713 +14.5663i 18.4635 + 1.0633i 2.8517 - 9.6631i -0.5072 + 1.9259i 2.7789 - 1.1511i -1.7205 + 3.5792i
Columns 78 through 80
5.1342 + 3.2776i -4.6323 + 3.1286i 7.7682 +23.2499i
Rmax1 =
33.8090
K_peak1 =
1
Rmax2 =
-38.4414 + 3.1286i
K_peak2 =
79
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.