Experiment # 10 Z-TRANSFORM In mathematics and signal processing, the Z-transform converts a discrete time-domain signal, which is a sequence of real or complex numbers, into a complex frequency-domain representation. It can be considered as a discrete equivalent of the Laplace transform. The Z-transform, like many integral transforms, can be defined as either a one-sided or two-sided transform. Bilateral Z-transform The bilateral or two-sided Z-transform of a discrete-time signal x[n] is the function X(z) defined as where n is an integer and z is, in general, a complex number. Unilateral Z-transform Alternatively, in cases where x[n] is defined only for n ≥ 0, the single-sided or unilateral Ztransform is defined as Inverse Z-transform The inverse Z-transform is where is a counterclockwise closed path encircling the origin and entirely in the region of convergence (ROC). The contour or path, , must encircle all of the poles of . Commands in Matlab: ZTRANS(f): is the Z-transform of the scalar sym f with default independent variable n. The default return is a function of z. IZTRANS(F): is the inverse Z-transform of the scalar sym F with default independent variable z. The default return is a function of n. Lab Work: 1. Find the z-transform of : 𝒖[𝒏] 𝒏 𝒖[𝒏] 𝒆−𝒂𝒏𝑻 𝒖[𝒏] 𝒄𝒐𝒔𝜷𝒏 𝒖[𝒏] a=sym('1'); y=ztrans(a) y= z/(z-1) ////////////////////////////////////// syms n y=ztrans(n) y= z/(z-1)^2 ////////////////////////////////////// syms n y=ztrans(n^2) y= z*(z+1)/(z-1)^3 //////////////////////////////////// syms n a T y=ztrans(exp(-a*n*T)) y= z/exp(-a*T)/(z/exp(-a*T)-1) ////////////////////////////////////// syms n b y=ztrans(cos(b*n) y= (z-cos(b))*z/(z^2-2*z*cos(b)+1) 2. Find the inverse z-transform of: 𝑧 𝑧−𝑎 𝑧(2𝑧−1) (𝑧−1)(𝑧+0.5) syms z y=iztrans(z*(2*z-1)/((z-1).*(z+.5))) y= 4/3*(-1/2)^n+2/3 //////////////////////////////////////// syms z a y=iztrans(z/(z-a)) y= a^n Other useful commands: 1. ZPK(Z,P,K,Ts): creates a discrete-time ZPK model with sample time Ts. 2. TF(NUM,DEN,TS): creates a discrete-time transfer function with sample time TS. 3. C2D(SYSC,Ts) converts the continuous-time LTI model SYSC to a discretetime model SYSD with sample time Ts. 4. D2C(SYSD) produces a continuous-time model SYSC that is equivalent to the discrete-time LTI model SYSD. n=[1 -.5]; d=[1 -0.5 -.5]; sys=tf(n,d,.1) Transfer function: z - 0.5 ----------------z^2 - 0.5 z - 0.5 Sampling time: 0.1 sys1=zpk(sys) Zero/pole/gain: (z-0.5) ------------(z-1) (z+0.5) Sampling time: 0.1 //////////////////////////////////// z=0.5; p=[-0.5 1]; k=1; zpk(z,p,k,0.1) Zero/pole/gain: (z-0.5) ------------(z+0.5) (z-1) Sampling time: 0.1 Finding response of a system: If a system is driven by a signal the inverse Z-transform the output Example: then the output is can be found. . By taking A discrete time system is described by the following transfer function: 𝑧 + 0.32 2 𝑧 + 𝑧 + 0.16 Find the system response to input 𝑥[𝑛] = (−2)−𝑛 𝑢[𝑛] if all initial conditions are zero. syms n z x=(-2).^-n; x=simplify(ztrans(x)) x= 2*z/(2*z+1) h=(z+.32)/(z^2+z+.16) h= (z+8/25)/(z^2+z+4/25) y=x.*h y= 2*z/(2*z+1)*(z+8/25)/(z^2+z+4/25) yn=iztrans(y) yn = 2*(-1/2)^n+2/3*(-1/5)^n-8/3*(-4/5)^n Exercises: 1. Find the z-transform of : 𝒔𝒊𝒏𝜷𝒏 𝒖[𝒏] 2.Find the inverse z-transform of: 𝒛(𝒛 − 𝟒) − 𝟓𝒛 + 𝟔 𝒛𝟐 3.A discrete time system is described by the following transfer function: 𝒛−. 𝟓 (𝒛+. 𝟓)(𝒛 − 𝟏) Find the system response to input 𝒙[𝒏] = 𝟑−(𝒏+𝟏) 𝒖[𝒏] if all initial conditions are zero.