LABEX2 (hoàn chỉnh)
LABEX2 (hoàn chỉnh)
Section:
Laboratory Exercise 2
Answers:
Q2.1 The output sequence generated by running the above program for M = 2 with x[n] = s1[n]+s2[n] as the input is shown below.
The component of the input x[n] suppressed by the discrete-time system simulated by this program is - Signal 2 with higher frequency of 0.47 This filter
is maybe a LPF.
Q2.2 Program P2_1 is modified to simulate the LTI system y[n] = 0.5(x[n]–x[n–1]) and process the input x[n] = s1[n]+s2[n] resulting in the output
s2[n]. The output generated for these different values of M and the frequencies are shown below.
output.
output.
Q2.4 The required modifications to Program P2_1 by changing the input sequence to a swept-frequency sinusoidal signal (length 101, minimum
frequency 0, and a maximum frequency 0.5) as the input signal (see Program P1_7) are listed below:
● Observing the input and output signals of the system we see that the low-frequency parts of the left signal are passed to the filter
output, and the high-frequency parts of the signal are subsequently removed from the output. The frequency increases as n increases, resulting in
● From
arg = 2 2 π ω n
an + bn⇒ ω=(an + bn) '=2 an+b=2. .n ⇒ f = = .
200 2 π 200
In Q2.1 we have the frequency of 0.05 at n = 10 .That’s why the signal 1 is passed in the filter output. Likewise, the frequency of signal 2 is 0.47 at
● The filter in Q2.2 is opposite to Q2.1 when it’s HPF. That’s why the signal s1 with low frequency is removed in the output where as
Q2.5 The sinusoidal signals with the following frequencies as the input signals were used to generate the output signals:
The output signals generated for each of the above input signals are displayed below:
The output signals depend on the frequencies of the input signal according to the following rules:
2
y (n) = cos (2 π fn) — cos [2 π f (n + 1)]. cos [2 π f (n-1)]
This observation can be explained mathematically as follows: By expand the above equation, we can get a conclusion about these previous results.
Q2.6 ω 0n) + K as the input signal is shown below for the following
The output signal generated by using sinusoidal signals of the form x[n] = sin(
values of ω 0 and K -
Q2.7 The outputs y[n], obtained with weighted input, and yt[n], obtained by combining the two outputs y1[n] and y2[n] with the same weights, are
shown below along with the difference between the two signals:
Q2.8 Program P2_3 was run for the following three different sets of values of the weighting constants, a and b, and the following three different
● a = 1; b = 2; f1 = 0.02; f2 = 0.2
The plots generated for each of the above three cases are shown below:
● With a = 1; b = 2; f1 = 0.02; f2 = 0.2
Q2.9 Program 2_3 was run with the following non-zero initial conditions -
ic = [1 10];
Q2.10 Program P2_3 was run with nonzero initial conditions and for the following three different sets of values of the weighting constants, a and b,
● a = 1; b = 2; f1 = 0.02; f2 = 0.2
The plots generated for each of the above three cases are shown below:
y[n] = x[n]x[n–1]
The output sequences y1[n], y2[n],and y[n]of the above system generated by running the modified program are shown below:
Comparing y[n] with yt[n] we conclude that the two sequences are - different.
Q2.12 The output sequences y[n] and yd[n-10] generated by running Program P2_4 are shown below -
These two sequences are related as follows - y (n)= y d (n+ 10)❑
Q2.13 The output sequences y[n] and yd[n-D] generated by running Program P2_4 for the following values of the delay variable D - 5, 12, 15
● With D = 5
● With D = 12
● With D = 15
In each case, these two sequences are related as follows - y (n)= y d (n+ 10)❑
Q2.14 The output sequences y[n] and yd[n-10] generated by running Program P2_4 for the following values of the input frequencies -
● f1 = 0.05 ; f2 = 0.1
● f1 = 0.1 ; f2 = 0.25
● f1 = 0.3 ; f2 = 0.5
Q2.15 The output sequences y[n] and yd[n-10] generated by running Program P2_4 for non-zero initial conditions are shown below - ic = [2 9];
These two sequences are related as follows - y (n)∧ y d (n)are not the shifted versions each other
Q2.16 The output sequences y[n] and yd[n-10] generated by running Program P2_4 for non-zero initial conditions and following values of the input
frequencies -
● f1 = 0.05 ; f2 = 0.1
● f1 = 0.1 ; f2 = 0.25
● f1 = 0.3 ; f2 = 0.5
is given below:
The output sequences y[n] and yd[n-10] generated by running modified Program P2_4 are shown below -
These two sequences are related as follows - In each case, these two sequences are related as follows - y (n)∧ y d (n)
Q2.18 (optional) The modified Program P2_3 to test the linearity of the system of Q2.18 is shown below:
The outputs y[n]and yt[n] obtained by running the modified program P2_3 are shown below:
The two sequences are - Almost similar
Answers:
Q2.19 The first 41 samples of the impulse response of the discrete-time system of Project 2.3 generated by running Program P2_5 is given below:
Q2.20 The required modifications to Program P2_5 to generate the impulse response of the following causal LTI system:
The first 45 samples of the impulse response of this discrete-time system generated by running the modified is given below:
Q2.21 The MATLAB program to generate the impulse response of a causal LTI system of Q2.20 using the filter command is indicated below:
The first 40 samples of the impulse response generated by this program are shown below:
Comparing the above response with that obtained in Question Q2.20 we conclude - That they are similar.
Q2.22 The MATLAB program to generate and plot the step response of a causal LTI system is indicated below:
The first 40 samples of the step response of the LTI system of Project 2.3 are shown below:
Q2.23 The output sequences y[n], y2[n], and the difference signal d[n] generated by running Program P2_6 are indicated below:
The relation between y[n] and y2[n] is - almost similar.
Q2.24 The sequences generated by running Program P2_6 with the input changed to a sinusoidal sequence are as follows:
The relation between y[n] and y2[n] in this case is - almost similar.
Q2.25 The sequences generated by running Program P2_6 with non-zero initial condition vectors are now as given below:
The relation between y[n] and y2[n] in this case is - different.
Q2.26 The modified Program P2_6 with the two 2nd-order systems in reverse order and with zero initial conditions is displayed below:
The sequences generated by running the modified program are sketched below:
The relation between y[n] and y2[n] in this case is - almost similar
Q2.27 The sequences generated by running the modified Program P2_6 with the two 2nd-order systems in reverse order and with non-zero initial
Q2.28 The sequences y[n] and y1[n] generated by running Program P2_7 are shown below:
The reason for using x1[n] as the input, obtained by zero-padding x[n], for generating y1[n] is -
● For two sequences of length N1 and N2, “conv” returns the resulting sequence of length N1+N2-1. (9 + 7 - 1 = 15)
● “Filter” returns the resulting sequence of the same length as the input signal. To have a resulting sequences of length 15, we have to
Q2.29 The modified Program P2_7 to develop the convolution of a length-15 sequence h[n] with a length-10 sequence x[n]is indicated below:
The sequences y[n] and y1[n] generated by running modified Program P2_7 are shown below:
The difference between y[n] and y1[n] is - they are similar.
Q2.30 The purpose of the for command is - used for loop to repeat specified number of times.
The purpose of the end command is - used to terminate block of code, or indicate last array index.
Q2.31 The purpose of the break command is - used to terminate execution of for or while loop
y[n]+1.5y[n-1]+0.9y[n- 2]=x[n]-0.8x[n-1]
From this value and the shape of the impulse response we can conclude that the system is - stable.
By running Program P2_8 with a larger value of N the new value of |h(K)| is - 9.1752e-07
Q2.33 The modified Program P2_8 to simulate the discrete-time system of Q2.33 is given below:
The impulse response generated by running the modified Program P2_8 is shown below:
The values of |h(K)| here are - 2.0321
From this value and the shape of the impulse response we can conclude that the system is - most likely unstable.
Q2.34 The output sequences generated by this program are shown below:
The filter with better characteristics for the suppression of the high frequency component of the input signal x[n] is - System #2.
Q2.35 The required modifications to Program P2_9 by changing the input sequence to a swept sinusoidal sequence (length 301, minimum
frequency 0, and maximum frequency 0.5) are listed below along with the output sequences generated by the modified program:
The filter with better characteristics for the suppression of the high frequency component of the input signal x[n] is - System #2.
Date: Signature: