ylabel'Phase in radians';Project 3.2 DTFT Properties Answers: Q3.6 The modified Program P3_2 created by adding appropriate comment statements, and adding program statements for labeling
Trang 1Laboratory Exercise 3 DISCRETE-TIME SIGNALS: FREQUENCY-DOMAIN REPRESENTATIONS
ylabel('Amplitude');
pausesubplot(2,1,1)plot(w/pi,abs(h));gridtitle('Magnitude Spectrum |H(e^{j\omega})|')
xlabel('\omega /\pi');
ylabel('Amplitude');
subplot(2,1,2)plot(w/pi,angle(h));gridtitle('Phase Spectrum arg[H(e^{j\omega})]')xlabel('\omega /\pi');
The function of the pause command is – Dùng để dừng chương trình
Q3.2 The plots generated by running Program P3_1 are shown below:
The DTFT is a 2+e−jw
function of ω
Trang 2Its period is - 2
The types of symmetries exhibited by the four plots are as follows:
Q3.3 The required modifications to Program P3_1 to evaluate the given DTFT of Q3.3
are given below:
xlabel('\omega /\pi');
ylabel('Amplitude');
subplot(2,1,2)plot(w/pi,angle(h));gridtitle('Phase Spectrum arg[H(e^{j\omega})]')xlabel('\omega /\pi');
ylabel('Phase in radians');
The plots generated by running the modified Program P3_1 are shown below:
Trang 3The DTFT is a _ function of ω
Its period is -
The jump in the phase spectrum is caused by -
The phase spectrum evaluated with the jump removed by the command unwrap is
ylabel('Amplitude');
subplot(2,1,2)plot(w/pi,imag(h));gridtitle('Imaginary part of
Trang 4e e
2
2
56
.04
23
Its period is -
The jump in the phase spectrum is caused by -
Q3.5 The required modifications to Program P3_1 to plot the phase in degrees are
ylabel('Amplitude');
subplot(2,1,2)plot(w,imag(h));grid
Trang 5ylabel('Phase in radians');
Project 3.2 DTFT Properties
Answers:
Q3.6 The modified Program P3_2 created by adding appropriate comment statements,
and adding program statements for labeling the two axes of each plot beinggenerated by the program is given below:
xlabel('time');
ylabel('Amplitude');
subplot(2,2,4)plot(w/pi,angle(h2));gridtitle('Phase Spectrum of Time-ShiftedSequence')
xlabel('time');
ylabel('Amplitude');
The parameter controlling the amount
of time-shift is – D=10
Q3.7 The plots generated by running the
modified program are given below:
Trang 6observations:Phổ pha dịch sát lại nhau
Q3.8 Program P3_2 was run for the
following
value of the timeshift
-The plots generated by running the modified
program are given below:
Q3.9 Program P3_2 was run for the following
values of the time-shift and for thefollowing values of length for thesequence - The plots generated byrunning the modified program are givenbelow:
Trang 7From these plots we make the following observations:Tần số càng lớn,D càng lớn phổ
pha càng dịch ra xa
Q3.10 The modified Program P3_3 created by adding appropriate comment statements,
and adding program statements for labeling the two axes of each plot beinggenerated by the program is given below:
ylabel('Amplitude');
subplot(2,2,3)plot(w/pi,angle(h1));gridtitle('Phase Spectrum of Original Sequence')
xlabel('Frequency');
ylabel('Amplitude');
subplot(2,2,4)plot(w/pi,angle(h2));gridtitle('Phase Spectrum of Frequency-Shifted Sequence')
xlabel('Frequency-Shifted');
ylabel('Amplitude');
The parameter controlling the amount of frequency-shift is - wo = 0.4*pi;
Q3.11 The plots generated by running the modified program are given below:
Trang 8From these plots we make the following observations:Phổ biên độ bị dịch
Q3.12 Program P3_3 was run for the following value of the frequency-shift - wo
= 0.9*pi
The plots generated by running the modified program are given below:
From these plots we make the following observations:Phổ biên độ bị dịch theo w0
Q3.13 Program P3_3 was run for the following values of the frequency-shift and
for the following values of length for the sequence –
wo = 0.9*pi;
num1 = [1 3 5 7 9 11 13 15 17 8 9 1 7];
The plots generated by running the modified program are given below:
Trang 9From these plots we make the following observations: Phổ biên độ bị dịch theo w0
Q3.14 The modified Program P3_4 created by adding appropriate comment statements,
and adding program statements for labeling the two axes of each plot beinggenerated by the program is given below:
xlabel('Time index');
ylabel('Amplitude');
subplot(2,2,3)plot(w/pi,angle(hp));gridtitle('Sum of Phase Spectra')xlabel('Time index');
ylabel('Amplitude');
subplot(2,2,4)plot(w/pi,angle(h3));gridtitle('Phase Spectrum of Convolved Sequence')
xlabel('Time index');
ylabel('Amplitude');
Q3.15 The plots generated by running the modified program are given below:
Trang 10From these plots we make the following observations:
Q3.16 Program P3_4 was run for the following two different sets of
sequences of varying lengths –
x1 = [1 3 5 7 9 11 8 -7 5 3];
x2 = [1 -2 3 -2 1 5 9 2];
The plots generated by running the modified program are given below:
From these plots we make the following observations:Phổ biên độ và pha không khác
biệt với tín hiệu gốc
Trang 11Q3.17 The modified Program P3_5 created by adding appropriate comment statements,
and adding program statements for labeling the two axes of each plot beinggenerated by the program is given below:
xlabel('Time index');
ylabel('Amplitude');
subplot(3,1,3)plot(w/pi,abs(h3));gridtitle('Magnitude Spectrum of ProductSequence')
xlabel('Time index');
ylabel('Amplitude');
Q3.18 The plots generated by running the modified program are given below:
From these plots we make the following observations: Phổ biên độ giảm khi nhân 2 tín hiệu
Q3.19 Program P3_5 was run for the following two different sets of sequences of
Trang 12From these plots we make the following observations: Phổ biên độ giảm khi nhân 2 tín hiệu
Q3.20 The modified Program P3_6 created by adding appropriate comment statements,
and adding program statements for labeling the two axes of each plot beinggenerated by the program is given below:
xlabel('Time index');
ylabel('Amplitude');
subplot(2,2,4)plot(w/pi,angle(h3));gridtitle('Phase Spectrum of Time-Reversed Sequence')
Trang 13From these plots we make the following observations:
Q3.22 Program P3_6 was run for the following two different sets of sequences of
varying lengths - num = [1 2 3 4 5 6 7];
The plots generated by running the modified program are given below:
From these plots we make the following observations: Đảo phổ pha
Project 3.3 DFT and IDFT Computations
Answers:
Q3.23 The MATLAB program to compute and plot the L-point DFT X[k] of a length-N
sequence x[n] with L ≥ N and then to compute and plot the IDFT of X[k] isgiven below:
Trang 14From these plots we make the following observations:
Q3.24 The MATLAB program to compute the N-point DFT of two length-N real
sequences using a single N-point DFT and compare the result by computingdirectly the two N-point DFTs is given below:
< Insert program code here Copy from m-file(s) and paste >
The DFTs generated by running the program for sequences of different lengths
N are shown below:
< Insert MATLAB figure(s) here Copy from figure window(s) andpaste >
From these plots we make the following observations:
Q3.25 The MATLAB program to compute the 2N-point DFT of a length-2N real
sequence using a single N-point DFT and compare the result by computingdirectly the 2N-point DFT is shown below:
< Insert program code here Copy from m-file(s) and paste >
Trang 15The DFTs generated by running the program for sequences of different lengths2N are shown below:
< Insert MATLAB figure(s) here Copy from figure window(s) andpaste >
From these plots we make the following observations:
Project 3.4 DFT Properties
Answers:
Q3.26 The purpose of the command rem in the function circshift is –Lấy phần dư sau
khi chia M cho length(x)
Q3.27 The function circshift operates as follows: Dịch vòng
Q3.28 The purpose of the operator ~= in the function circonv is –Không bằng,L1 khác
L2
Q3.29 The function circonv operates as follows: Tổng chập vòng
Q3.30 The modified Program P3_7 created by adding appropriate comment statements,
and adding program statements for labeling each plot being generated by theprogram is given below:
xlabel('Time index');
ylabel('Amplitude');
The parameter determining the amount of time-shifting is - M=6
If the amount of time-shift is greater than the sequence length then – Vẫn dịch
theo vòng
Q3.31 The plots generated by running the modified program are given below:
Trang 16From these plots we make the following observations:
Q3.32 The modified Program P3_8 created by adding appropriate comment statements,
and adding program statements for labeling each plot being generated by theprogram is given below:
xlabel('Time index');
ylabel('Amplitude');
subplot(2,2,3)stem(n,angle(XF));gridtitle('Phase of DFT of Original Sequence');
xlabel('Time index');
ylabel('Amplitude');
subplot(2,2,4)stem(n,angle(YF));gridtitle('Phase of DFT of Circularly Shifted Sequence');
xlabel('Time index');
ylabel('Amplitude');
The amount of time-shift is - 5
Q3.33 The plots generated by running the modified program are given below:
Trang 17From these plots we make the following observations:
Q3.34 The plots generated by running the modified program for the following two
different amounts of time-shifts, with the amount of shift indicated, are shownbelow:
From these plots we make the following observations:
Q3.35 The plots generated by running the modified program for the following two
different sequences of different lengths, with the lengths indicated, are shownbelow:
Trang 18From these plots we make the following observations:
Q3.36 A copy of Program P3_9 is given below along with the plots generated by
running this program:
Result of circular convolution = 12 28 14 0 16 14
Result of IDFT of the DFT products = 12 28 14 0 16 14
From these plots we make the following observations: Hai kết quả giống nhau
Q3.37 Program P3_9 was run again for the following two different sets of equal-length
sequences:
Trang 19The plots generated are shown below:
Result of circular convolution = 58 86 74 54 34 22 50 54
Result of IDFT of the DFT products = 58 86 74 54 34 22 50 54
From these plots we make the following observations: Hai kết quả giống nhau
Q3.38 A copy of Program P3_10 is given below along with the plots generated by
running this program:
Linear convolution via circular convolution = 2 6 10 15 21 15 7 9 5Direct linear convolution = 2 6 10 15 21 15 7 9 5
From these plots we make the following observations: Hai kết quả giống nhau
Q3.39 Program P3_10 was run again for the following two different sets of sequences of
unequal lengths:
Linear convolution via circular convolution = 3 8 15 22 30 39 48 57 39
27 13 15 8
Direct linear convolution = 3 8 15 22 30 39 48 57 39 27 13 15 8
From these plots we make the following observations: Hai kết quả khác nhau
Q3.40 The MATLAB program to develop the linear convolution of two sequences via
the DFT of each is given below:
< Insert program code here Copy from m-file(s) and paste >
The plots generated by running this program for the sequences of Q3.38 areshown below:
< Insert MATLAB figure(s) here Copy from figure window(s) andpaste >
From these plots we make the following observations:
The plots generated by running this program for the sequences of Q3.39 areshown below:
< Insert MATLAB figure(s) here Copy from figure window(s) andpaste >
From these plots we make the following observations:
Trang 20Q3.41 A copy of Program P3_11 is given below:
title('Re(DFT\{x_{e}[n]\})');
subplot(2,2,4);
plot(k/128,imag(XEF)); grid;
xlabel('Time index n');ylabel('Amplitude');
title('Im(DFT\{x_{e}[n]\})');
The relation between the sequence x1[n] and x[n] is -
Q3.42 The plots generated by running Program P3_11 are given below:
The imaginary part of XEF is/is not equal to zero This result can beexplained as follows:
Q3.43 The required modifications to Program P3_11 to verify the relation between the
DFT of the periodic odd part and the imaginary part of XEF are given below along with the plots generated by running this program:
Trang 21< Insert program code here Copy from m-file(s) and paste >
< Insert MATLAB figure(s) here Copy from figure window(s) andpaste >
From these plots we make the following observations:
Q3.44 A copy of Program P3_12 is given below:
Trang 22Q3.47 The MATLAB program to compute and display the poles and zeros, to compute
and display the factored form, and to generate the pole-zero plot of a rational transform is given below:
Q3.48 From the pole-zero plot generated in Question Q3.47, the number of regions of
convergence (ROC) of G(z) are –2
All possible ROCs of this z-transform are sketched below: 0.5≤ |z|≤0.7
Trang 23From the pole-zero plot it can be seen that the DTFT -
Q3.49 The MATLAB program to compute and display the rational z-transform from its
zeros, poles and gain constant is given below:
b = [2 1];
a = [1 -0.6 ];
[b,a] = eqtflength(b,a);% Make lengths equal
[z,p,k] = tf2zp(b,a) The rational form of a z-transform with the given poles, zeros, and gain is found
Q3.50 The MATLAB program to compute the first L samples of the inverse of a rational
z-transform is given below:
L=input('sample of the inverse','L');
num=[2 5 9 5 3];
den=[5 45 2 1 1];
impz(num,den,L)The plot of the first 50 samples of the inverse of G(z) of Q3.46 obtained using thisprogram is sketched below:
num=[2 5 9 5 3];
den=[5 45 2 1 1];
impz(num,den,50)
Q3.51 The MATLAB program to determine the partial-fraction expansion of a rational
z-transform is given below:
Trang 24From the above partial-fraction expansion we arrive at the inverse z-transformg[n] as shown below: