Sunteți pe pagina 1din 10

NATIONAL INSTITUTE OF TECHNOLOGY CALICUT

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

EC4091 DIGITAL SIGNAL PROCESSING LAB

EXPERIMENT NO: 4

STUDY OF Z TRANSFORMS AND IMPLEMENTATION IN MATLAB

SUBMITTED BY
P SAI BHARATH REDDY
B140549EC
Date -20/08/2017
AIM:
1.a. Write a MATLAB program to compute and display the poles and zeros, to compute and display the
factored form and to generate the pole-zero plot of a z-transform that is a ratio of two polynomials in z-1
. Using this program, analyze the z-transform
2 5 z 1 9 z 2 5 z 3 3z 4
G( z )
5 45z 1 2 z 2 z 3 z 4
b. From the pole-zero plot generated in part (a), determine the possible ROCs? Can you tell from the
pole-zero plot whether or not the DTFT exists? Is the filter stable if it is causal?

c. Using zp2tf, determine the rational form of a z transform whose zeros are at s1 = 0.3, s2 = 2.5, s3 =
0.2+j 0.4, and s4 = 0.2j 0.4; the poles are at p1 = 0.5, p2 = 0.75, p3=0.6 + j 0.7, and p4 = 0.6 j 0.7;
and the gain constant k is 3.9.
z 1
X ( z)
d. Using impz() determine the first 10 samples of the inverse Z transform of 3 4 z 1 z 2
Using residuez obtain the partial fraction expansion of X(z). From the partial fraction expansion, write
down the closed form expression of the inverse Z transform (assuming causal). Evaluate the first 10
samples of the closed form expression for x[n] using MATLAB and compare with the result obtained
using impz
e. Using residuez convert back the partial fraction expression for X(z) in part d. to the rational function
form

THEORY:

Z TRANSFORM:

Definition

For a given sequence x[n], we can define the z-transform X(z) as such:

it is important to note that z is a continuous complex variable defined as such:

z=exp(j)

It is important to note that the z-transform rarely needs to be computed manually, because
many common results have already been tabulated extensively in tables, and control system
software includes it (MatLab,Octave,SciLab).
Partial Fraction Expansion
For z-transforms that are rational functions of z,

Inverse Z Transform:

A simple and straightforward approach to find the inverse z-transform is to perform a partial
fraction expansion of X(z). Assuming that p > q, and that all of the roots in the denominator are
simple, i k for i k, X(z) may be expanded as follows:

Eq(3)

For some constants Ak for k = 1,2, . . . , p. The coefficients Ak may be found by multiplying both
sides of Eq. (3) by (1 - k z1) and setting z = k. The result is

Region of convergence:

The region of convergence (ROC) is the set of points in the complex plane for which the Z-
transform summation converges.



ROC z : x[n]z n

n
OBSERVATIONS:

Problem1: 1a) Pole Zero plot

Figure1a: Pole Zero plot

Factored form of the given equation:

h =((z - 2^(1/2)*1i + 1)*(z + 1 + 2^(1/2)*1i)*(z - (7^(1/2)*1i)/4 + 1/4)*(z +


(7^(1/2)*1i)/4+1/4))/(z*(z - 1)*(z + 8)*(z - 1 - 1i))

INFERENCE: 1) Pole Zero plot of the given function is plotted using zplane command that is inbuilt
in Matlab
2) Factored form is generated and displayed in command window.
1b) Region Of Convergence:
Zeros are at
0.4393 + 1.1546i
0.4393 - 1.1546i
-0.4393 + 0.2296i
-0.4393 - 0.2296i

Poles are at
0.3711 + 0.9581i
0.3711 - 0.9581i
-0.5378 + 0.5851i
-0.5378 - 0.5851i

Gain Constant
0.8889

Radius of the poles


1.0274
1.0274
0.7947
0.7947

Second Order Sections


0.8889 0.7810 0.2184 1.0000
1.0755 0.6315
1.0000 -0.8786 1.5262 1.0000 -
0.7422 1.0556
INFERENCE:

1) The system DTFT exists only when the system is stable thus the given system is unstable
and hence dtft doesnt exists.
1c) Rational form for given poles, zeros and gain constant

Figure 1C) Pole Zero plot of the system with given poles and gain constant

h_z =

-(234/(25*z) + 663/(1000*z^2) + 507/(500*z^3) - 117/(200*z^4) - 39/10)/(7/(40*z^2) - 19/(20*z) +


53/(80*z^3) - 51/(160*z^4) + 1)

INFERENCE:

1) The rational form of the system with given poles, zeros and gain constant is obtained on
command window.
1d) Inverse z transform & 1e) Rational form

Figure 1d: First 10 samples of inverse z transform

constants are at
0.5000
-0.1667

roots are at
1.0000
0.3333

INFERENCE:

1) First 10 samples of inverse z transform are obtained and plotted


2) NUM and DEN are the coefficients of numerator and denominator in the rational form.
APPENDIX:
1A)
%1. (a)
b=[8 0 8 9 3];
a=[9 3 8 6 6];
zeros=roots(b)
poles=roots(a);
zplane(zeros,poles);
title('displaying pole zero plot');

1B) MAIN CODE:


%1.(b)
clear all
close all
num=[8 0 8 9 3];
den=[9 3 8 6 6];
[z,p,k]=tf2zp(num,den);
disp('Zeros are at');disp(z);
disp('Poles are at');disp(p);
disp('Gain Constant');disp(k);
radius=abs(p);
disp('Radius of the poles');disp(radius);
%zplane(num,den) ;
sos=zp2sos(z,p,k) ;
disp('Second Order Sections');disp(sos);

1C)
% TO DETERMINE THE RATIONAL FORM OF THE SYSTEM WITH GIVEN POLES AND ZEROS
clear all
close all
z=[.3; 2.5 ;-.2+j*.4 ;-0.2-j*.4]; p=[.5 -0.75 .6+j*.7 0.6-
j*.7];
k=3.9;
[b,a]=zp2tf(z,p,k);
zplane(b,a);
disp('Zeros coeff');disp(b);
disp('poles coeff');disp(a);
1d &1e)
% TO DETERMINE THE FIRST 10 SAMPLES OF INVERSE Z TRANSFORM AND TO FIND THE RATIONAL FORM FROM
THE SAMPLES
clear all
close all
b=[1 0];
a=[3 -4 1];zplane(b,a);figure;
L=10;
[g,n]=impz(b,a,L);
stem(g);figure;
[r,p,k] = residuez(b,a);
[b,a] = residuez(r,p,k);
disp('constants are at');disp(r);
disp('roots are at');disp(p);
disp('Gain Constant');disp(k);
zplane(b,a);figure;
n=1:10;
f=.5*(1-((1/3).^n));
stem(n,f)

MATLAB FUNCTIONS USED:

zplane
This function displays the poles and zeros of discrete-time systems.
zplane(z,p) plots the zeros specified in column vector z and the poles specified in column vector p in the
current figure window. The symbol 'o' represents a zero and the symbol 'x'represents a pole. The plot
includes the unit circle for reference. If z and p are arrays, zplane plots the poles and zeros in the
columns of z and p in different colors.

Zp2sos

zp2sos converts a discrete-time zero-pole-gain representation of a given digital filter to an equivalent


second-order section representation.
[sos,g] = zp2sos(z,p,k) creates a matrix sos in second-order section form with gain g equivalent to the
discrete-time zero-pole-gain filter represented by input arguments z, p, and k. Vectors z and p contain
the zeros and poles of the filter's transfer function H(z), not necessarily in any particular order.

L
b0 k b1k z 1 b2 k z 2
if H ( z ) g 1
k 1 1 a1k z a2k z 2
where n and m are the lengths of z and p, respectively, and k is a scalar gain. The zeros and poles must
be real or complex conjugate pairs. sos is an L-by-6 matrix
then

b01 b11 b21 1 a11 a 12


b b b 1 a a
sos 02 12 22 12 22


b0 L b1L b2 L 1 a1L a 2 L

zp2tf:
"zp2tf" forms transfer function polynomials from zeros , poles and gains of a system in factored form.
[b,a]=zp2tf(z,p,k) finds a rational transfer function of the form
B( z ) b1 z n1 bn1 z 1 bn

A( z ) a1 z m1 a m1 z 1 a m
impz:

impz returns the impulse response based on current filter coefficients .


[h,t]=impz(hfilt,n) returns the impulse response evaluated at floor(n) 1-second intervals.
residuez:
residuez converts a discrete time system expressed as the ratio of two polynomials, to partial fraction
expansion, or residue form.
[r,p,k]=residuez(b,a) finds the residues, poles and direct terms of a partial terms expansion of the ratio
of two polynomials

S-ar putea să vă placă și