Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

LABORATORY 11

ANALYSIS OF DIGITAL FILTERS

OBJECTIVES:

 Practice to generate a transfer function that makes the system stable, marginally stable and unstable.
 Try to generate pole-zero map in z-plane for each system.
 Practice plotting the impulse response of each system.
 Try to compare the results of pole-zero map and impulse responses for each system individually.
 Solution of difference equations for system response by using initial conditions.
 Realization of digital filters by using SIMULINK.

EXERCISE:

Task #1:Generate transfer functions so that the system become stable, marginally stable and unstable and
plot their response in z-plane.By using subplot command, show the results of each transfer
function on the same plot and then analyze the results on the basis of stability criteria. Also
generates the impulse response of all the systems on the same plot and interpret its result.

A)
SOURCE CODE:
n=[1];
d=[1 0.5];
c=tf(n,d,1);
subplot(2,1,1);
pzmap(c);
subplot(2,1,2);
impulse(c);

OUTPUT:
B)
SOURCE CODE:
n=[1];
d=[1 1];
c=tf(n,d,1);
subplot(2,1,1);
pzmap(c);
subplot(2,1,2);
impulse(c);

OUTPUT:
C)
SOURCE CODE:
n=[1];
d=[1 2];
c=tf(n,d,1);
subplot(2,1,1);
pzmap(c);
subplot(2,1,2);
impulse(c);

OUTPUT:
Task #2:Given a filter
H(z) = 1 + 2z-1 + z-2
______________________________ freq

1 – 0.5z-1 + 0.25z-2
a) Use MATLAB to plot its magnitude frequency response.
b) Write a program to plot its phase response.
SOURCE CODE:
n=[1 2 1];
d=[1 -0.5 0.25];
c=tf(n,d,1);
freqz(n,d);

OUTPUT:
Task #3:Given the difference equations:
i) y(n) = x(n-1) – 0.75y(n-1) – 0.125y(n-2)
a) Use the MATLAB function filter() and filtic() to calculate the system response y(n) for n =
0,1,2,3,4 with the input of x(n) = (0.5)n u(n) and initial conditions: x(-1) = -1, y(-2) = 2, and
y(-1) = 1.
b) Use the MATLAB function filter() to calculate the system response y(n) for n = 0,1,2,3,4
with the input of x(n) = (0.5)n u(n) and initial conditions: x(-1) = 0, y(-2) = 0, and y(-1) = 0.
SOURCE CODE:
n=0:10;
x=0.5.^n;
b=[0 1 0];
a=[1 -0.75 -0.125];
x1=[-1 0];
y1=[1 2];
z=filtic(b,a,x1,y1)
c=filter(b,a,x,z)

OUTPUT:
ii) y(n) = 2x(n) – 25x(n-2) – 11y(n-1) – 28y(n-2)
a) Use the MATLAB function filter() and filtic() to calculate the system response y(n) for n =
0,1,2,3,4 with the input of x(n) = (0.75) n u(n) and initial conditions: x(-2) = -10, y(-2) = 2.5,
and y(-1) = 5.
b) Use the MATLAB function filter() to calculate the system response y(n) for n = 0,1,2,3,4
with the input of x(n) = (0.5)n u(n) and initial conditions: x(-2) = 0, y(-2) = 0, and y(-1) = 0.
SOURCE CODE:
n=0:20;
x=0.75.^n;
b=[2 0 -25];
a=[1 0 -28];
x1=[-1 0];
y1=[1 2];
z=filtic(b,a,x1,y1)
c=filter(b,a,x,z)

OUTPUT:
Task #4:Given a filter
i) H(z) = z
___________

z-0.5

SOURCE CODE:
n=[1];
d=[1 0.5];
freqz(n,d)

OUTPUT:
ii) H(z) = 1 –0.5z-1
SOURCE CODE:
n=[1 -0.5];
d=[1];
freqz(n,d)

OUTPUT:
iii) H(z) = 0.5z2– 0.32
__________________________

z2– 0.5z +0.25


SOURCE CODE:
n=[0.5 0 -0.32];
d=[1 -0.5 0.25];
freqz(n,d)

OUTPUT:

iv) H(z) = 1 –0.9z-1 +0.81z-2


_____________________
1 – 0.6z-1 + 0.36z-2

SOURCE CODE:
n=[1 -0.9 0.81];
d=[1 -0.6 0.36];
freqz(n,d)

OUTPUT:

You might also like