Laboratory Exercise 2: Discrete-Time Systems: Time-Domain Representation
Laboratory Exercise 2: Discrete-Time Systems: Time-Domain Representation
Laboratory Exercise 2: Discrete-Time Systems: Time-Domain Representation
Laboratory Exercise 2
DISCRETE-TIME SYSTEMS: TIME-DOMAIN REPRESENTATION
2.1 SIMULATIO N OF DISCRETE- TIME SYSTEMS T e Mo!in" A!era"e S#$te m
Project 2.1
A copy of Program P2_1 is given below : % Program P2_1 % Simulation of an M-point Moving Average Filter % Generate the input signal n = 0:100 s1 = !os"2#pi#0$0%#n& % A lo'-fre(uen!) sinusoi* s2 = !os"2#pi#0$+,#n& % A high fre(uen!) sinusoi* - = s1.s2 % /mplementation of the moving average filter M = input"01esire* length of the filter = 0& num = ones"12M& ) = filter"num212-&3M % 1ispla) the input an* output signals !lf su4plot"22221& plot"n2 s1& a-is"502 1002 -22 26& -la4el"07ime in*e- n0& )la4el"0Amplitu*e0& title"0Signal 810& su4plot"22222& plot"n2 s2& a-is"502 1002 -22 26& -la4el"07ime in*e- n0& )la4el"0Amplitu*e0& title"0Signal 820& su4plot"22229& plot"n2 -& a-is"502 1002 -22 26& -la4el"07ime in*e- n0& )la4el"0Amplitu*e0& title"0/nput Signal0& su4plot"2222+& plot"n2 )& a-is"502 1002 -22 26& -la4el"07ime in*e- n0& )la4el"0Amplitu*e0& title"0:utput Signal0& a-is An$% er$&
'2.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 .
Signal #1 2 1 0 -1 -2 Amplitude Amplitude 2 1 0 -1 -2 Signal #2
100
100
2 1 0 -1 -2
50 Time index n
100
Program P2_1 is modified to simulate the !T" system y[n] = 0.5(x[n]x[n 1]) and process the input x[n] = s1[n]+s2[n] resulting in the output sequence shown below : # "nsert MAT!A$ figure%s& here' paste' ) (opy from figure window%s& and
The effect of changing the !T" system on the input is '2.( Program P2_1 is run of the fre quencies generated for these *rom these plots we
for the following values of filter length M and following values of the sinusoidal signals s1[n] and s2[n]' The output different values of M and the frequencies are shown below' ma+e the following observations (opy from figure window%s&s and
The required modifications to Program P2_1 by changing the input sequence to a swept frequency sinusoidal signal %length 1,1- minimu m frequency ,- and a ma.imu m frequency ,'/& as the input signal %see Program P1_0& are listed below : # "nsert program code here' (opy from m file%s& and paste' ) The out put signal generated by running this program is plotted below .
The results of 1uestions 12'1 and 12'2 from the response of this system to the swept frequency signal can be e.plained as follows : Project 2.2 *O+tiona, - A Sim+,e Non,inear Di$crete- Time S#$te m
A copy of Program P2_2 is given below : # "nsert program code here' (opy from m file%s& and paste' ) An$% er$& '2.. 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 : # "nsert MAT!A$ figure%s& here' paste' ) (opy from figure window%s& and
The output signals depend on the frequencies of the input signal according to the following rules : This observation can be e.plained mathematically as follows : '2./ The output signal generated by using sinusoidal signals of the form
x[n] = sin(on) + K as the input signal is shown below for the following values of o and K # "nsert MAT!A$ figure%s& here' paste' ) The dependence of the output signal as (opy from figure window%s& and
Project 2.(
A copy of Program P2_4 is given below : # "nsert program code here' (opy from m file%s& and paste' ) An$% er$& '2.1 The outputs y[n]- obtained with weighted input- and yt[n]- ob tained 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 :
# "nsert MAT!A$ figure%s& here' paste' ) The two sequences are The system is '2.2
Program P2_4 was run for the following three different sets of values of the weighting constants- a and b- and the following three different sets of input frequencies : The plots generated for each of the above three cases are shown below : # "nsert MAT!A$ figure%s& here' paste' ) (opy from figure window%s& and
$ased on these plots we can conclude that the system with different weights is '2.3 Program 2_4 was run with the following non 5ero initial conditions The plots generated are shown below
$ased on these plots we can conclude that the system with non5ero initial conditions is '2.14 Program P2_4 was run with non5ero initial conditions and for the following three different sets of values of the weighting constants- a and b- and the following three different sets of input frequencies : The plots generated for each of the above three cases are shown below : # "nsert MAT!A$ figure%s& here' paste' ) (opy from figure window%s& and
$ased on these plots we can conclude that the system with non5ero initial conditions and different weights is '2.11 Program P2_4 was modified to simulate the system :
y[n] = x[n]x[n1]
The output sequences y1[n], y2[n],and y[n]of the above system generated by running the modified program are shown below : # "nsert MAT!A$ figure%s& here' paste' ) (omparing (opy from figure window%s& and
This system is
Project 2.)
A copy of Program P2_6 is given below : # "nsert program code here' (opy from m file%s& and paste' ) An$% er$& '2.12 The output sequences are shown below -
# "nsert MAT!A$ figure%s& here' paste' ) These two sequences are related as follows The system is Q2.13
The output sequences y[n] and yd[n-D] generated by running Program P2_6 for the following values of the delay variable D are shown below
"n each case- these two sequences are related as follows The system is '2.1)
The output sequences y[n] and yd[n-10] generated by running Program P2_6 for the following values of the input frequencies are shown below
"n each case- these two sequences are related as follows The system is '2.1.
The output sequences y[n] and yd[n-10] generated by running Program P2_6 for non 5ero initial conditions are shown below # "nsert MAT!A$ figure%s& here' paste' ) These two sequences are related as follows (opy from figure window%s& and
The output sequences y[n] and yd[n-10] generated by running Program P2_6 for non 5ero initial conditions and following values of the input frequencies are shown below
"n each case- these two sequences are related as follows The system is '2.11
# "nsert MAT!A$ figure%s& here' paste' ) These two sequences are related as follows The system is
'2.12 *o+tiona, - The modified Program P2_4 to test the linearity of the system of 12'17 is shown below : # "nsert program code here' (opy from m file%s& and paste' ) The outputs y[n]and shown below :
# "nsert MAT!A$ figure%s& here' paste' ) The two sequences are The system is
2.2
LINEAR TIME- IN5ARIANT DISCRETE- TIME SYSTEMS Com+6t a ti on o7 Im+6,$e Re$+on$e$ o7 LTI S#$te m$
Project 2..
A copy of Program P2_/ is shown below : # "nsert program code here' (opy from m file%s& and paste' ) An$% er$& '2.13 The first 61 samples of the impulse response of the discrete time system of Pro8ect 2'4 generated by running Program P2_/ is given below9 # "nsert MAT!A$ figure%s& here' paste' ) '2.24 (opy from figure window%s& and
The required modifications to Program P2_/ to generate the impulse response of the following causal !T" system :
The MAT!A$ program to generate the impulse response of a causal !T" system of 12'2, using the filter command is indicated below : # "nsert program code here' (opy from m file%s& and paste' ) The first 6, samples of the impulse response generated by this program are shown below : # "nsert MAT!A$ figure%s& here' paste' ) (opy from figure window%s& and
(omparing the above response with that obtained in 1uestion 12'2, we conclude
'2.22 The MAT!A$ program to generate and plot the step response of a causal !T" system is indicated below : # "nsert program code here' (opy from m file%s& and paste' ) The first 6, samples of the step response of the !T" system of Pro8ect 2'4 are shown below :
Project 2./
A copy of Program P2_: is given below : # "nsert program code here' (opy from m file%s& and paste' ) An$% er$& '2.2( The output sequences y[n], y2[n], and the difference signal by running Program P2_: are indicated below : # "nsert MAT!A$ figure%s& here' paste' ) The relation between '2.2)
d[n] generated
The sequences generated by running Program P2_: with the input changed to a sinusoidal sequence are as follows : # "nsert MAT!A$ figure%s& here' paste' ) The relation between (opy from figure window%s& and
'2.2.
The sequences generated by running Program P2_: with non 5ero initial condition vectors are now as given below : # "nsert MAT!A$ figure%s& here' paste' ) The relation between (opy from figure window%s& and
'2.2/
The modified Program P2_: with the two 2nd order systems in reverse order and with 5ero initial conditions is displayed below : # "nsert program code here' (opy from m file%s& and paste' ) The sequences generated by running the modified program are s+etched below : # "nsert MAT!A$ figure%s& here' paste' ) The relation between (opy from figure window%s& and
'2.21
The sequences generated by running the modified Program P2_: with the two 2nd order systems in reverse order and with non 5ero initial conditions are displayed below :
Project 2.1
Con!o,6tion
A copy of Program P2_0 is reproduced below : # "nsert program code here' (opy from m file%s& and paste' ) An$% er$& '2.22 The sequences below :
# "nsert MAT!A$ figure%s& here' paste' ) The difference between The rea son for using generating y1[n] is '2.23
The modified Program P2_0 to develop the convolution of a length 1/ sequence h[n] with a length 1, sequence x[n]is indicated below : # "nsert program code here' (opy from m file%s& and paste' ) The sequences y[n] and are shown below :
Project 2.2
A copy of Program P2_7 is given below : # "nsert program code here' (opy from m file%s& and paste' ) An$% er$& '2.(4 The purpose of the The purpose of the
'2.(1 '2.(2
The impulse response generated by running Program P2_7 is shown below : # "nsert MAT!A$ figure%s& here' paste' ) The value of ; h(K)| here is (opy from figure window%s& and
*rom this value and the shape of the impulse response we can conclude that the system is $y running Program P2_7 with a larger value of < the new value of ; h(K)| is *rom this value we can conclude that the system is '2.((
The modified Program P2_7 to simulate the discrete time system of 12'44 is given below : # "nsert program code here' (opy from m file%s& and paste' ) The impulse response generated by running the modified Program P2_7 is shown below : # "nsert MAT!A$ figure%s& here' paste' ) The values of (opy from figure window%s& and
*rom this value and the shape of the impulse response we can conclude that the system is -
Project 2.3
A copy of Program P2_= is given below : # "nsert program code here' (opy from m file%s& and paste' ) An$% er$& '2.() The output sequences generated by this program are shown below : # "nsert MAT!A$ figure%s& here' paste' ) (opy from figure window%s& and
The fil ter with better characteristics for the suppression of the high frequency component of the input signal x[n] is -
10
'2.(.
The required modifications to Program P2_= by changing the input sequence to a swept sinusoidal sequence %length 4,1- minimu m frequency ,- and ma.imu m frequency ,'/& are listed below along with the output sequences generated by the modified program : # "nsert program code here' (opy from m file%s& and paste' ) # "nsert MAT!A$ figure%s& here' paste' ) (opy from figure window%s& and
The fil ter with better characteristics for the suppression of the high frequency component of the input signal . [n] is Date : Si"nat6r e
11