Вы находитесь на странице: 1из 13

DIGITAL SIGNAL PROCESSING

LAB REPORT 05
6TH SEMESTER (SPRING 2019)

Submitted to: Engr. Komal Munir

Submitted by: __________________________________

__________________________________

Data presentation (0-5) Data Analysis and interpretation (0-5)

DEPARTMENT OF ELECTRICAL ENGINEERING

UNIVERSITY OF ENGINEERING AND TECHNOLOGY

TAXILA
LAB No. 05

Transient and Steady-State Response of the System

Objective:

 To understand how to determine the transient and steady repose and how can check the
transient and steady response in MATLAB

Introduction:

Theory:

NAME:SYEDA UME RUBAB REG #:16-EE-03


NAME:SYEDA UME RUBAB REG #:16-EE-03
Lab Tasks:

1. A system is characterized by the difference equation:

𝑦(𝑛) = 𝑎 𝑦(𝑛 − 1) + 𝑥(𝑛) with 𝑎 = 0.5

𝜋𝑛
Let the input signal be: 𝑥(𝑛) = 10 cos ( 4 ) 𝑢(𝑛). The system is initially at rest (i.e., it

is relaxed).

a) Determine the transient and steady-state responses of the system.

b) Plot the signals 𝑦𝑛𝑟 (𝑛) and 𝑦𝑓𝑟 (𝑛).


c) Plot the zero-state response 𝑦𝑧𝑠 (𝑛) of the system using y = filter(b,a,x).
d) Plot the impulse response of the system using impz().
e) Superimpose the plots of 𝑦𝑧𝑠 (𝑛) and 𝑦𝑓𝑟 (𝑛) and compare with the system’s
impulse response.
f) Repeat all the steps with 𝑎 = 0.9.

Code:

N=20; n=0:N; a=0.5;


%part b
%Ynr(natural response)
for i=1:N
Ynr(i)=6.3*(a)^i;
end
Ynr=[6.3*(a)^0,Ynr(1:end)]; %to add 0th index value
subplot(211);

NAME:SYEDA UME RUBAB REG #:16-EE-03


stem(n,Ynr,'filled'); title('Natural Response')
%Yfr forced response
Yfr=13.56*cos((pi/4)*n-degtorad(28.7));
subplot(212)
stem(n,Yfr,'filled'); title('Forced response')

%part c
B=10.*[1-(1/sqrt(2))];
A=poly([a exp(j*pi/4) exp(-(j*pi/4))]);
Yzs=filter(B,A,[1,zeros(1,N)]);
figure;
stem(n,Yzs,'filled')
title('Zero-state response Y_z_s(n)')

%part d
[H,T]=impz(B,A);
figure;
subplot(211)
stem(T(1:N),H(1:N),'filled')
title('Impulse response of system')

%part e
subplot(212)
stem(n,Yzs)
hold on
stem(n,Yfr,'x')
legend('Y_z_s','Y_f_s')
title('Superposition of Y_r_s and Y_f_r')

For a=0.5

NAME:SYEDA UME RUBAB REG #:16-EE-03


For a=0.9

N=20; n=0:N; a=0.5;


%part b

NAME:SYEDA UME RUBAB REG #:16-EE-03


%Ynr(natural response)
for i=1:N
Ynr(i)=6.3*(a)^i;
end
Ynr=[6.3*(a)^0,Ynr(1:end)]; %to add 0th index value
subplot(211);
stem(n,Ynr,'filled'); title('Natural Response')
%Yfr forced response
Yfr=13.56*cos((pi/4)*n-degtorad(28.7));
subplot(212)
stem(n,Yfr,'filled'); title('Forced response')

%part c
B=10.*[1-(1/sqrt(2))];
A=poly([a exp(j*pi/4) exp(-(j*pi/4))]);
Yzs=filter(B,A,[1,zeros(1,N)]);
figure;
stem(n,Yzs,'filled')
title('Zero-state response Y_z_s(n)')

NAME:SYEDA UME RUBAB REG #:16-EE-03


%part d
[H,T]=impz(B,A);
figure;
subplot(211)
stem(T(1:N),H(1:N),'filled')
title('Impulse response of system')

%part e
subplot(212)
stem(n,Yzs)
hold on
stem(n,Yfr,'x')
legend('Y_z_s','Y_f_s')
title('Superposition of Y_r_s and Y_f_r')

NAME:SYEDA UME RUBAB REG #:16-EE-03


2. Consider a causal and stable system described by the impulse response ℎ(𝑛) =
0.8𝑛 𝑢(𝑛). Let the input signal be: 𝑥(𝑛) = cos(0.05𝜋𝑛) 𝑢(𝑛). The system is initially at
rest (i.e., it is relaxed).
a) Determine the transient and steady-state responses of the system.
b) Plot the signals 𝑦𝑛𝑟 (𝑛) and 𝑦𝑓𝑟 (𝑛).
c) Plot the zero-state response 𝑦𝑧𝑠 (𝑛) of the system using y = filter(b,a,x).
d) Plot the impulse response of the system using impz().
e) Superimpose the plots of 𝑦𝑧𝑠 (𝑛) and 𝑦𝑓𝑟 (𝑛) and compare with the system’s
impulse response.

Code

N=40; n=0:N;
%part b
%Ynr(natural response)
for i=1:N
Ynr(i)=2.5*(0.8)^i;
end
Ynr=[2.5*(0.8)^0,Ynr(1:end)]; %to add 0th index value

NAME:SYEDA UME RUBAB REG #:16-EE-03


subplot(211);
stem(n,Ynr,'filled'); title('Natural Response')
%Yfr forced response
Yfr=4.2*cos(9*n-degtorad(30.8));
subplot(212)
stem(n,Yfr,'filled'); title('Forced response')

%part c
B=[1 -0.9877];
A=poly([0.8 0.9877+0.1564*j 0.9877-0.1564*j]);
Yzs=filter(B,A,[1,zeros(1,N)]);
figure;
stem(n,Yzs,'filled')
title('Zero-state response Y_z_s(n)')

%part d
[H,T]=impz(B,A);
figure;
subplot(211)
stem(T(1:N),H(1:N),'filled')
title('Impulse response of system')

%part e
subplot(212)
stem(n,Yzs)
hold on
stem(n,Yfr,'x')
legend('Y_z_s','Y_f_s')
title('Superposition of Y_r_s and Y_f_r')

NAME:SYEDA UME RUBAB REG #:16-EE-03


NAME:SYEDA UME RUBAB REG #:16-EE-03
After Lab Questions:

1. What is the source of transient response?

2. How long transients stays?

3. What is the rate of decay of 𝑦𝑛𝑟 (𝑛)?

4. What is the required condition for a system to sustain a steady-state output for 𝑛 ≥ 0?

5. Can you decide about the system’s stability from ℎ(𝑛)?

NAME:SYEDA UME RUBAB REG #:16-EE-03


Discussion/ Conclusion:

NAME:SYEDA UME RUBAB REG #:16-EE-03

Вам также может понравиться