signals systems lab 2

5
1 Experiment 2: LTI Systems Prepared by : Shahram Shahbazpanahi I. OBJECTIVES In this experiment, you will learn how to verify whether a system is LTI or not? You also learn how to build an analog lter by using simple blocks such as integrator, adder, subtractors, and gain modules. II. PRE -L AB  ASSIGNMENTS In this section, you learn how the linearity and time-invariance properties of a system can be veried by applying different inputs to the system. 1) Consider a continuous-ti me system whose input- output relat ionship is given by the fol- lowing equation y(t) =  e x(t) (1) where where  x(t)  and  y(t)  are, respectively, the input and the output of the system. Use Simulink to obtain and plot the output  y (t)  for two cases; i)  x(t) = 2u(t), ii)  x(t) = 4u(t). Based on these plots, what can you say about the linearity of this system? 2) For the system whose input -out put rela tio nshi p is give n by (1), use Simul ink to nd the output  y(t)  for two cases i)  x(t) =  u(t), ii)  x(t) =  u(t 2). Based on these plots, what can you say about the time-invariance of this system? 3) Consider a system whose input-out put relatio nship is given by the followin g different ial equation dy dt  + 3y(t) =  x(t)  (2) where  x(t)  and  y(t)  are, respectively, the input and the output of the system. Assume that the system is at initial rest, i.e., if  x(t) = 0  for  t t 0 , then  y(t) = 0  for  t t 0 . a) Use your knowled ge on differenti al equatio ns to obtain  y(t)  for  t 0  when  x(t) = u(t). Plot the so-obtained  y(t)  for  0 t 10. October 10, 2009 DRAFT

Upload: ahmadatouseef

Post on 08-Jul-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Signals Systems Lab 2

8/19/2019 Signals Systems Lab 2

http://slidepdf.com/reader/full/signals-systems-lab-2 1/5

1

Experiment 2: LTI Systems

Prepared by : Shahram Shahbazpanahi

I. OBJECTIVES

In this experiment, you will learn how to verify whether a system is LTI or not? You also

learn how to build an analog filter by using simple blocks such as integrator, adder, subtractors,

and gain modules.

II. PRE-L AB   ASSIGNMENTS

In this section, you learn how the linearity and time-invariance properties of a system can be

verified by applying different inputs to the system.

1) Consider a continuous-time system whose input-output relationship is given by the fol-

lowing equation

y(t) =  ex(t) (1)

where where   x(t)   and   y(t)   are, respectively, the input and the output of the system. Use

Simulink to obtain and plot the output  y (t) for two cases; i)  x(t) = 2u(t), ii) x(t) = 4u(t).

Based on these plots, what can you say about the linearity of this system?

2) For the system whose input-output relationship is given by (1), use Simulink to find the

output   y(t)   for two cases i)   x(t) =  u(t), ii)   x(t) =  u(t − 2). Based on these plots, what

can you say about the time-invariance of this system?

3) Consider a system whose input-output relationship is given by the following differential

equationdy

dt  + 3y(t) =  x(t)   (2)

where  x(t)  and  y(t)  are, respectively, the input and the output of the system. Assume that

the system is at initial rest, i.e., if  x(t) = 0   for   t ≤ t0, then  y(t) = 0   for   t ≤ t0.

a) Use your knowledge on differential equations to obtain   y(t)   for   t ≥ 0  when   x(t) =

u(t). Plot the so-obtained  y(t)   for  0 ≤ t ≤ 10.

October 10, 2009 DRAFT

Page 2: Signals Systems Lab 2

8/19/2019 Signals Systems Lab 2

http://slidepdf.com/reader/full/signals-systems-lab-2 2/5

2

b) You can use function lsim to obtain the output of an LTI system to any input. Simply

use   lsim(a, b, x, t) where   b   and   a  are two vectors containing, respectively,

the coefficients of the left-hand side and right-hand side, of the differential equation

which describes the relationship between the input and the output of the system.  x  is

a vector containing the values of the input signal on a time grid define by vector   t.

Make yourself familiar with function  lsim and then use this function to analytically

obtain the step response of the system in (2).

c) Compare the results you obtained in parts a and b.

d) Make yourself familiar with function  step  and then use this function to obtain the

step response of the system in (2).

e) Make yourself familiar with function  impulse  and then use this function to obtain

the impulse response of the system in (2).

III. LAB  ACTIVITIES

In this section, you will learn how to verify the linearity of system (block box) by means of 

applying different inputs to the system.

 A. System Property Verification

1) In the following activities,  p(t)  is defined as

 p(t) =

1,   for  0 ≤ t ≤ 1

0,   for   t > 1   or   t < 0

(3)

and  T   = 10s.

a) Find out a way to model the following four systems

•   System A: described by the following differential equation

dy

dt  + y(t) =  x(t)   + Initial rest (4)

•   System B: Described by  y(t) = x(t) cos(200πt)

•   System C: Described by  y(t) = cos(x(t))

•   System D: Described by  y(t) =  x2(t)(cos(200πt)

October 10, 2009 DRAFT

Page 3: Signals Systems Lab 2

8/19/2019 Signals Systems Lab 2

http://slidepdf.com/reader/full/signals-systems-lab-2 3/5

3

b) Apply  x(t) = p(t)  to system A and record the output. Apply  x(t) = p(t) + p(t− T )

to system A and record the output. Compare these two outputs and comment on the

time-invariance of the system.

c) Apply  x(t) = p(t)   to system A and record the output. Apply  x(t) = 2 p(t)  to system

A and record the output. Compare these two outputs and comment on linearity of 

the system.

d) Apply  x(t) = p(t)  to system B and record the output. Apply  x(t) = p(t) + p(t− 2)

to system B and record the output. Compare these two outputs and comment on the

time-invariance of the system.

e) Apply  x(t) = p(t)  to system B and record the output. Apply  x(t) = 2 p(t)   to system

B and record the output. Compare these two outputs and comment on linearity of 

the system.

f) Apply  x(t) = p(t)  to system C and record the output. Apply  x(t) = p(t) + p(t− T )

to system C and record the output. Compare these two outputs and comment on the

time-invariance of the system.

g) Apply  x(t) = p(t)  to system C and record the output. Apply  x(t) = 2 p(t)   to system

C and record the output. Compare these two outputs and comment on linearity of 

the system.

h) Apply  x(t) = p(t)  to system D and record the output. Apply  x(t) = p(t) + p(t− 2)to system D and record the output. Compare these two outputs and comment on the

time-invariance of the system.

i) Apply  x(t) = p(t)   to system D and record the output. Apply  x(t) = 2 p(t)  to system

D and record the output. Compare these two outputs and comment on linearity of 

the system.

 B. Convolution Integral

a) Consider an LTI system whose impulse response is given by   h(t) =   e−4t cos(2t).

Write an M-file to calculate the convolution integral

y(t) =   +∞−∞

x(τ )h(t− τ )dτ    (5)

October 10, 2009 DRAFT

Page 4: Signals Systems Lab 2

8/19/2019 Signals Systems Lab 2

http://slidepdf.com/reader/full/signals-systems-lab-2 4/5

4

for any input   x(t). You may need to define   x(t)  as symbolic function and use that

as an input to M-file. Then use this M-file to obtain the output of the system to

x(t) = sin(3t)u(t).

b) Use   int  function in the Symbolic Toolbox to calculate the convolution integral for

x(t) = sin(3t)u(t).

c) Compare the results obtained above and comment on them.

C. Convolution Sum

In this section. you will learn how to obtain the output of a discrete-time LTI system.

a) Make yourself familiar with   conv   function.

b) Consider the finite-length signal

x[n] =

1,   0 ≤ n ≤ 5

0,   otherwise.(6)

Analytically determine   y[n] = x[n] ∗ x[n].

c) Use   conv   to compute the non-zero samples of   y[n] =   x[n] ∗ x[n]   and store these

samples in the vector   y   and plot   y[n]   using   stem   function. Make sure that the

horizontal axis of your plot corresponds to the correct indices of the non-zero samples

of  y[n].

d) Consider the finite-length signal

h[n] =

n,   0 ≤ n ≤ 10

0,   otherwise.(7)

Analytically determine   y[n] = h[n] ∗ x[n].

e) Use   conv   to compute the non-zero samples of   y[n] =   h[n] ∗ x[n]   and store these

samples in the vector   y   and plot   y[n]   using   stem   function. Make sure that the

horizontal axis of your plot corresponds to the correct indices of the non-zero samples

of  y[n].

IV. DESIGN  ACTIVITIES

1) Use Simulink to design and simulate a model file that represents the system in (2). Verify

your result by comparing impulse response of this system with what you obtained during

part 3.e of the pre-lab activities.

October 10, 2009 DRAFT

Page 5: Signals Systems Lab 2

8/19/2019 Signals Systems Lab 2

http://slidepdf.com/reader/full/signals-systems-lab-2 5/5

5

2) Consider a system with the following input-output relationship

d2y

dt2  + 3

dy

dt  + 2y(t) = 3

dx(t)

dt  + x(t)   (8)

Using integrators, differentiators, adders, subtractors and gain modules, design this system.

Record the step response of this system and compare that with the analytical solution and

comment on that.

October 10, 2009 DRAFT