Lab Manual EKT230/4 Signals & Systems LABORATORY 6 POLES AND ZEROS, Z-TRANSFORMATION,S-PLANE 1.0 OBJECTIVES: 1.1 Learn the zeros and poles of the LTI object system. 1.2 Determine the transfer function representation of the system; know how to plot the locations of the poles and zeros. 2.0 1.3 Study LTI system characteristics such as stability and causality. 1.4 To analyze discrete-time signals and LTI system that is not stable POLES AND ZEROS The command covered is; r = roots (a) It will finds the roots of a polynomial described by the vector a and thus maybe used to determine the zeros and poles of a Laplace Transform expressed as ratio of polynomials in ‘s’. The elements of the vector are correspond to descending powers of ‘s’. For example, we may find the poles and zeros of the Laplace Transform in example below: X(s) = 4s 2 6 s3 s2 2 Using the following commands: >> Z = roots ( [4, 0, 6 ] ) Z= 0 + 1.2247; 0 – 1.2247; >> P = roots( [1, 1, 0, -2] ) P= - 1.0000 + 1.0000; - 1.0000 – 1.0000; 1.0000 Hence, we identify zeros at s = j 1.2247, a pole at s = 1, and a pair of complex – conjugate poles at s = -1 j. The command poly(r) uses the poles or zeros specified in the vector r to determine the coefficients of the corresponding polynomial. 59 Lab Manual EKT230/4 3.0 Signals & Systems PARTIAL-FRACTION EXPANSIONS The residue command finds the partial-fraction expansion of a ratio of two polynomials. The syntax is [ r, p, k] = residue ( b, a ), where b represents the numerator polynomial, a represent the denominators polynomial, r represents the coefficients or residues of the partial-fraction expansion, p represents the poles, and k is a vector describing any terms in powers of ‘s’. If the order of the numerator is less than that of the denominator, then k is an empty matrix. Example 3.0.1 3s 4 X(s) = s 1s 2 2 3s 4 s 5s 2 8s 4 3 >> [r, p, k] = residue ([3, 4], [1, 5, 8, 4]) r= - 1.000 2.000 1.000 p= - 2.0000 - 2.0000 - 1.0000 k=[ ] Hence the residue r(1) = -1 correspond to the pole at s = -2, given by p(1), the residue r(2) = 2. Corresponds to the double pole at s = -2. Given by p(2), and the residue r(3) = 1. Corresponds to the pole at s = -1 given by p(3). The partial-fraction expansion is therefore X(s) = 4.0 1 2 1 2 s 2 s 2 s 1 Z - TRANSFORMATION (POLES AND ZEROS) The poles and zeros of an LTI system will be determined by applying roots to the respective polynomial. For example, to find the roots of 1+ 4Z-1+3Z-2, we give the command roots([1, 4, 3]).The poles and zeros may be displayed in the z- 60 Lab Manual EKT230/4 Signals & Systems plane by using zplane(b,a). If b and a are row vectors, then zplane finds the roots of the numerator and denominator polynomials represented by b and a, respectively, before finding the poles and zeros and displaying them. If b and a are column vectors, then zplane assumes that b and a contain the locations of the zeros and poles, respectively, and displays them directly. 5.0 RELATING SYSTEM DESCRIPTIONS The command covered in this section are: ss – state space object. H = tf(b,a), creates an LTI object H representing a transfer function with numerator and denominator polynomials defined by the coefficients in b and a, ordered in descending power of s. H = zpk(z,p,k), create an LTI object representing the pole-zero gain form of system description. The zeros and poles are described by the vectors z and p, respectively, and the gain is represented by the scalar k. The command ss, tf and zpk also convert among models when applied to an LTI object of the different form. sysss = ss (syszpk), generates a state-space object sysss representing the same system as syszpk LTI object which representing a system in zero-polegain form. tzero (sys) = find the zero of the LTI object system. pole (sys) = find the pole of the LTI object system. pzmap (sys) = produces a pole-zero plot. freqresp = determine the frequency response. bode = determine the Bode plot step = determine the Step response lsim = Simulates the system output in response to a specified input. Example 5.0.1 Consider a system containing zeros at s = 0 and s = j10 and poles at s = - 0.5 j 5, s = -3, and s = - 4 with gain 2. Determine the transfer function representation of this system, plot the locations of the poles & zeros in the splane, and plot the system’s magnitude response using the MATLAB commands. 61 Lab Manual EKT230/4 Signals & Systems Solution 5.0.1 (i) Set zeros, poles and scalar k (gain) >> Z = [0, j*10, -j*10]; >> P = [-0.5 + j*5, -0.5-j*5, -3, -4]; >> K = 2; >> syszpk = zpk (z, p, k) zero / pole / gain 2ss ^ 2 100 s 4s 3s ^2 5s 25.25 >> systf = tf (syszpk) % Convert to transfer function form transfer function: 2s ^3 200 s ^4 7s ^3 44.25s ^2 188.8s 303 >> pzmap (systf) % generate pole-zero plot >> w = [0:499]*20/500% generate frequencies from 0 to 20 rad/sec >> H = freqresp (systf, w); >> Hmag = abs (squeeze (H)); >> plot (w, Hmag); >> title (‘Pole Zero Map’) >> xaxis (‘Real axis’); yaxis (‘Imaginary axis’); Observe the pole-zero plot you have obtained. Now, the next figure will illustrates the magnitude response of the system for 0 ≤ < 20. Note that magnitude response is zero at frequencies corresponding to location of zeros and the jω – axis at = 0 and = 10. Similarly, the magnitude response is large at the frequency corresponding to location of pole near the jω – axis at = 5. 6.0 INVERSION OF THE Z-TRANSFORM The command: “residue”, computes partial-fraction expansion for Z-transform expressed in the ratio of two polynomials in z-1 , [r,p,k] = residuez(b,a), a & b are vectors representing the numerator and denominator polynomials coefficients. The vector r represents the partial fraction expansion coefficients corresponding to the poles given in p. The vector k contains the coefficients associated with power of z-1 that result from long division when the order of the numerator equals or exceeds that of the denominator. 62 Lab Manual EKT230/4 Signals & Systems Example 6.0.1 X(Z) = Z 3 10Z 2 4Z 4 2Z 2 2Z 4 Solution 6.0.1 Since residuez assume that the numerator and denominator polynomials are expressed in power of Z-1, we first write X(Z) = ZY(Z), where 1 10Z 1 4Z 2 4Z 3 X(Z) = 2 2Z 1 4Z 2 Now we use residuez to find the partial-fraction expansion for Y(Z) as follows : >> [r, p, k] = residuez ( [1, -10, -4, 4] , [2, -2, -4] ) r= - 1.5000 0.5000 p= 2 -1 k= 1.5000 - 1.0000 This implies a partial-fraction expansion of the form X(Z) = 7.0 1.5 0.5 1.5 Z 1 1 1 1 2Z 1 Z TRANSFORM ANALYSIS OF LTI SYSTEMS If b and a contain the coefficients of the Transfer Function numerators and denominator polynomials, respectively, ordered in descending power of Z, then: tf2ss ( b, a ), determines a state-variables description of the system. tf2zp ( b, a ), determines the pole-zero-gain description of the system. zp2ss , convert from pole-zero-gain description to state variable descriptions. zp2tf , convert from pole-zero-gain description to transfer function descriptions. ss2tf, convert from state variable description to transfer function form. ss2zp, convert from state variable description to pole-zero-gain form. freqz, The frequency response of a system described by a difference equation is evaluated from the transfer function . 63 Lab Manual EKT230/4 Signals & Systems Example 7.0.1 Consider an LTI System with the TF H(Z) = 0.094(1 4Z 1 6Z 2 4Z 3 2Z 4 ) 1 0.4860Z 2 0.0177 Z 4 We may depict the poles and zeros of H(Z) in the z-plane and plot the system’s magnitude response with following commands: >> b = 0.094*[1, 4, 6, 4, 2]; >> a = [1, 0, 0.486, 0, 0.0177]; >> zplane ( b,a ); >> [H,w] = freqz (b, a, 250) >> plot (w, abs(H) ) from the figure obtained, please indicates that this system has a zero of multiplicity four at Z = -1 and four poles an the imaginary axis. The magnitude response is depicted in next figure. Note that the zeros at Z = -1 force the magnitude response to be small at higher frequencies. 8.0 COMPUTATIONAL STRUCTURES FOR IMPLEMENTING DISCRETE TIME LTI SYSTEMS. One useful means for implementing a discrete-time LTI system is a cascade of second order sections. The MATLAB Signal Processing Toolbox contains routines for converting a state-variable or pole-zero-gain description system to a cascade connection of second-order sections. This is accomplish by using ss2sos and zp2sos. The syntax for zp2sos is sos = zp2sos (z, p, k). Where z and p are vectors containing zeros and poles, respectively, and k is the gain. The matrix sos is L by 6, where each row contains the coefficients of the transfer function for that section. The three elements of the row contain the numerator coefficient, while the last three elements contain the denominator coefficients. The command sos2zp, sos2ss, and sos2tf convert from a cascade of second order sections to a pole-zero-gain, state variable, and transfer function description. 64 Lab Manual EKT230/4 Signals & Systems Example 8.0.1 Using MATLAB, obtain a representation of the system as a cascade of secondorder sections. The transfer function is given in pole-zero-gain form: H(Z) = (1 jZ 1 )(1 jZ 1 )(1 Z 1 ) (1 12 e j 4 Z 1 )(1 12 e j 4 Z 1 )(1 3 4 e j 8 Z 1 )(1 3 4 e j 8 Z 1 ) The system has zeros at Z = j and Z = -1, while the poles are at Z = and Z = 3 4 1 2 e jπ/4 e jπ/8. We employ zp2sos to convert from pole-zero-gain form to second order section as follows: >> Z = [-j, +j , -1]; >> P = [ 0.5*exp(j*pi/4), 0.5*exp(-j*pi/4), 0.75*exp(j*pi/8), 0.75*exp(-j*pi/8)]; >> K = 1; >> sos = zp2sos(z,p,k) SOS = 0 1.0000 1.0000 0 1.0000 1.0000 1.0000 1.0000 -0.7071 -1.3858 0.2500 0.5625 Hence, the system is described as cascade of second order section given by F1(Z) = Z 1 Z 2 1 0.7071Z 1 0.25Z 2 and F2(Z) = 1 Z 2 1 1.3858Z 1 0.5625Z 2 65 Lab Manual EKT230/4 Signals & Systems TASKS OF THE DAY Q 6.1 Use the MATLAB command ‘roots’, ‘pzmap’ to plot and determine the poles & zeros of the following systems: (a) H(s) = (b) A = s3 1 s 4 2s 2 1 1 2 1 6 C= 0 1 1 B = 2 , , D=0 Q 6.2 Use the MATLAB command freqresp to evaluate and plot the magnitude and phase response for the LTI System having the transfer function. (a) H(s) = s 0.5 s 0.1 5 j s 0.1 5 j Q 6.3 A causal discrete-time LTI System has the transfer function. H(Z)= 0.0976 Z 1 2 Z 12 Z 0.3575 j 0.5889 Z 0.3575 j 0.5889 Z 0.7686 j 0.3338 Z 0.7686 j 0.3338 N = 200, -pi ≤ ω ≤ pi (a) Use pzmap to generate poles and zeros plot. (b) Use the MATLAB commands zp2tf and freqz to evaluate and plot the magnitude and phase response. (c) Use the MATLAB commands zp2sos to obtain a representation of this filter as a cascade of two second-order sections with real-value coefficients. (d) Use the MATLAB commands freq to evaluate and plot the magnitude response of each section in part (c). (e) Use the MATLAB command filter to determine the impulse response of the system by obtaining the output for and input x [n] = δ [n] (f) Use the MATLAB command filter to determine the system output for the input. X [n] = 1 cos 4 n cos 2 n cos3 4 n cosn Plot the first 250 points of the input and output. 66