Matlab Z Transform
Matlab Z Transform
Matlab Z Transform
The statement [z,p,k]= tf2zp (num,den) determines the zeros, poles and gain constants of a rational z-transform expressed as ratio of polynomials in descending powers of z. Input arguments are the row vectors num and den containing the coefficients of the numerator and the denominator polynomials in descending powers of z. The statement [num,den]= zp2tf (z,p,k) is used to reverse the process. Given the zeros, poles and gains it computes the coefficients of the numerator and denominator polynomials. From the zero-pole description the factored form of the transfer function can be obtained using the function below: sos = zp2sos(z,p,k) This function computes the coefficients of each second-order factor given as an L6 matrix
b01 b11 b21 a01 a11 a21 b b12 b22 a02 a12 a22 02 sos = M M M M M M b0 L b1L b2 L a0 L a1L a2 L where kth row contains the coefficients of the numerator and denominator of the kth second order factor of the z-transform.
The pole-zero plot of a rational z-transform can also be plotted using the m-file function zplane. zplane(zeros, poles) zplane(num,den) note: need to enter values as column vectors note: input arguments need to be entered as row vectors.
Example :
Express the following z-transform in factored form, plot its poles and zeros and then determine the ROC. G[z ] = 2 z 4 + 16 z 3 + 44 z 2 + 56 z + 32 3 z 4 + 3 z 3 15 z 2 + 18 z 12
we can use a matlab program like the one below: num = input(`Type in the numerator coefficients =`) den = input(`Type in the denominator coefficients =`) [z,p,k]=tf2pz(num,den) m = abs(p) % to find distance from origin of poles disp(`Zeros are at`); disp(z); disp(`poles are at`); disp(p); disp(`gain constant`); disp(k); disp(`Radius of poles`); disp(m); sos= zp2sos(z,p,k); disp(Second order sections);disp(real(sos)); zplane(num,den)
>> sos= zp2sos(z,p,k); >> sos sos = 0.6667 1.0000 4.0000 2.0000 5.3333 2.0000 1.0000 2.0000 -4.0000 1.0000 -1.0000 1.0000
Now we can use the above information to write the factored form of the z-transform as :
(0.0667 + 0.4 z + 0.5333z )(10.0 + 20.0 z + 20 z ) G[z ] = (1.0 + 2.0 z 4.0 z )(1.0 1.0 z + 1.0 z ) (1 + 6 z + 8z )(1 + 2 z + 2 z ) = (0.667) (1 + 2 z 4 z )(1 z + z )
1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2
by observing each quantity we can fnd the ROCs ROC regions has to be bounded by the poles
R1 : R2 : R3 : R4 : z > 3.2361 3.2361 > z > 1.2361 1.2361 > z > 1 1> z 0