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

Poles and zeros plot

I. Z Transform
Q1) Draw the structure of the digital filter that has the difference equation:
y(n) = x(n) - 2x(n-1) + x(n-2) + 1.4y(n-1) - 0.48y(n-2)
1. Write a MATLAB program that plots the frequency and phase responses of this
digital filter. Name this program as P3_2.m. Hint use the freqz MATLAB command.
>> num = [1;-2;1];
>> den = [1;-1.4;0.48];
>> freqz(num, den)





2. Write a MATLAB program that calculates the poles and zeros of this digital filter.
Name this program as P3_3.m. Hint use the tf2zp MATLAB command.
>> num = [1;-2;1];
>> den = [1;-1.4;0.48];
>> [num,den] = eqtflength(num,den);
>> [z,p,k] = tf2zp(num,den)
z =
1
1
p =
0.8000
0.6000
k =
1

3. Write a MATLAB program that plots the poles and zeros of this digital filter. Name
this program as P3_4.m. Hint use the zplane MATLAB command.
>> z =[1;1];
>> p =[0.8000;0.6000];
>> k = 1;
>> [b,a] = zp2tf(z,p,k);
>> zplane(b,a)


4. Write a MATLAB program that calculates the transfer function of the digital filter
that has the following poles and zeros. Name this program as P3_5.m. Hint use the
zp2tf MATLAB command. Let the gain of this digital filter k = 1.
z1 = +1 z2 = -1 z3 = 1 + i z4 = 1 i
p1 = 0.5 p2 = -0.5 p3 = 0.1 + 0.2i p4 = 0.1 - 0.2i

>> p = [ 0.5; -0.5; 0.1 + 0.2i ;0.1 - 0.2i ];
>> z = [ 1 ;-1 ; 1 + 1i; 1 - 1i ];
>> k = 1;
>> [b,a] = zp2tf(z,p,k)
b =
1 -2 1 2 -2
a =
1.0000 -0.2000 -0.2000 0.0500 -0.0125

5. Write a MATLAB program that plots the poles and zeros of the digital filter in step 4.
Name this program as P3_6.m.
>> p = [ 0.5; -0.5; 0.1 + 0.2i; 0.1 - 0.2i ];
>> z = [ 1 ;-1 ; 1 + 1i; 1 - 1i ];
>> k = 1;
>> [b,a] = zp2tf(z,p,k);
>> zplane(b,a)


6. Write a MATLAB program that calculates the poles and zeros of the accumulator
circuit whose difference equation is y[n] = x[n] + y[n -1] . Name this program as
P3_7.m
>> num = [1;0];
>> den = [1;-1];
>> [num,den] = eqtflength(num,den);
>> [z,p,k] = tf2zp(num,den)
z =
0
p =
1
k =
1
7. Write a MATLAB program that factorised the 4th order digital filter in step 4 into two
cascade 2nd order digital filters. Name this program as P3_8.m. Hint use the zp2sos
MATLAB command. The resultant transfer function is


>> p = [ 0.5; -0.5; 0.1 + 0.2i ;0.1 - 0.2i ];
>> z = [ 1 ;-1 ; 1 + 1i; 1 - 1i ];
>> k = 1;
>> [sos,g] = zp2sos(z,p,k)
sos =
1.0000 0 -1.0000 1.0000 0 -0.2500
1.0000 -2.0000 2.0000 1.0000 -0.2000 0.0500
g =
1
8. Write a MATLAB program that calculates the same for another 4th order digital filter
that has the following poles and zeros. Name this program as P3_9.m.
z1 = +2 z2 = -2 z3 = 1 +2 I z4 = 1 2 i
p1 = 1 p2 = -1 p3 = 1+ i p4 = 1 i


>> z = [+2;-2 ;1+2i ; 1 - 2i ];
>> p = [1;-1 ; 1+ 1i ;1 - 1i ];
>> k = 1;
>> [sos,g] = zp2sos(z,p,k)
sos =
1 0 -4 1 0 -1
1 -2 5 1 -2 2
g =
1

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