Lab 6
Lab 6
THEORY:-
(1+2.686z^-1+0.7051z^-2)
H2(Z)= (1+2z^-1+z^-2)
(1-0.9044z^-1+0.2155z^-2)
CODE:
clear all
num=[0.007338 0.007338*2 0.007338]
dem=[1 -1.2686 0.7051]
w=0:0.01:2*pi
[h,ph]=freqz(num,dem,w)
subplot(3,1,1)
plot(ph,abs(h))
ylabel('magnitude')
subplot(3,1,2)
plot(ph,angle(h))
ylabel('phase in radian')
1
title('System response of IIR ')
subplot(3,1,3)
[z,p]=tf2zp(num,dem)
zplane(z,p)
title('ZERO POLE plot')
0.2
magnitude
0.1
0
0 1 2 3 4 5 6 7
System response of IIR
5
phase in radian
-5
0 1 2 3 4 5 6 7
ZERO POLE plot
1
Imaginary Part
2
0
-1
-5 0 5
Real Part
For H2(Z)
CODE: clear all
num=[1 2 1 ]
dem=[1 -0.9044 0.2155]
w=0:0.01:4*pi
[h,ph]=freqz(num,dem,w)
figure(1)
plot(ph,abs(h))
ylabel('magnitude')
figure(2)
plot(ph,angle(h))
ylabel('phase in radian')
title('System response of IIR ')
figure(3)
[z,p]=tf2zp(num,dem)
zplane(z,p)
title('ZERO POLE plot')
2
14
12
10
8
magnitude
0
0 2 4 6 8 10 12 14
Fig1-magnitude response.
System response of IIR
4
1
phase in radian
-1
-2
-3
-4
0 2 4 6 8 10 12 14
3
ZERO POLE plot
0.8
0.6
0.4
Imaginary Part
0.2
2
0
-0.2
-0.4
-0.6
-0.8
-1
-1 -0.5 0 0.5 1
Real Part
FOR H1(Z)
Code:
Clear all
figure(1)
[z,p]=sos2zp([0.007378 0.007378*2 0.007378,1 -1.268 0.7051])
zplane(z,p)
4
cascade
0.8
0.6
0.4
Imaginary Part
0.2
2
0
-0.2
-0.4
-0.6
-0.8
-1
-1 -0.5 0 0.5 1
Real Part
Fig-cascade system.
FOR H2(Z).
Code:
figure(1)
[z,p]=sos2zp([1 2 1,1 -0.9044 0.2155])
zplane(z,p)
title('cascade')
5
cascade
0.8
0.6
0.4
Imaginary Part
0.2
2
0
-0.2
-0.4
-0.6
-0.8
-1
-1 -0.5 0 0.5 1
Real Part
Fig-cascade system.
a)H(Z)=(1+2.5z^-1+1.12z^-2+0.7z^-3-0.456z^-4)
Code:
num=[1 2.5 1.12 0.7-0.456]
dem=[1]
k=tf2latc(num,dem)
k =
1.5352
0.5423
0.2440
6
b) H(Z)= 1/(1-1.268z^-1+0.751z^-2)
code:
num=[1]
dem=[1 -1.268 0.751]
[k,c]=tf2latc(num,dem)
k=
-0.7242
0.7510
c=
1
0
0
7
c) H(Z)= 1+2z^-1+z^-2
1-0.75z^-1+0.125z^-2
Code:
num=[1 2 1]
dem=[1 -0.75 0.125]
[k,c]=tf2latc(num,dem)
k =
-0.6667
0.1250
c =
2.7083
2.7500
1.0000
8
Q.3 Conversion lattice to direct form.
FIR
K1=0.345
K2=0.2653
K3=-0.967
CODE:
k=[0.345 0.2653 -0.967]
[num]=latc2tf(k,'fir')
num =
9
IIR
K1=0.25 C1=0.8281
K2=0.3 C2=1.4583
K3=-0.6 C3=1
Code:
num =
dem =
CONCLUSION- We observed and plot lattice structure and lattice ladder structure of FIR
and IIR system and conversion lattice to direct structure.
10
11