Discrete Linear Systems and Z-Transform
Total Page:16
File Type:pdf, Size:1020Kb
Discrete Linear Systems and Z-transform Sven Laur University of Tarty 1 Lumped Linear Systems Recall that a lumped system is a system with finite memory that together with future inputs completely determines the output. The finite memory is formally represented as a state x. In most real world examples, the state x corresponds to certain physical properties of the system, like its position in the space, voltage levels etc. A system is time-invariant, if its behaviour does not depend on a time step k. More formally, if we have two runs of the system x[k1]= x0 x[k2]= x0 ( u[k1 + ℓ]= u0[ℓ], ℓ ≥ 0 ( u[k2 + ℓ]= u0[ℓ], ℓ ≥ 0 then the corresponding output signals y1 and y2 are just shifts of each other y1[k1 + ℓ]= y1[k2 + ℓ], ℓ ≥ 0 . Recall that the linearity condition is defined as follows. Assume that y1 and y2 are the output signals of the systems x[0] = x1 x[0] = x1 and ( u[k]= u1[k], k ≥ 0 ( u[k]= u2[k], k ≥ 0 Then the output of the following system x[0] = α1x1 + α2x2 ( u[k]= α1u1[k]+ α2u2[k], k ≥ 0 can be expressed as a linear combination y[k]= α1y1[k]+ α2y2[k] . As a result, we can decompose the run of a system into a sum of zero-state and zero-input responses, as x[0] = x0 x[0] = 0 x[0] = x0 = + 0 ( u[k], k ≥ 0 ( u[k], ℓ ≥ 0 ( u[k]= , ℓ ≥ 0 Intuitively, the zero-state response yzs describes how the system responds to the control signal and the zero-input response yzi describes how the system behaves without external inference or how it reacts for small disturbances. As we can split the input signal into a sum of step functions 1, if k = m , δm[k]= (0, if k =6 m , the zero-state response yzs can be computed as a linear combination of zero-state responses to these step functions. For clarity consider SISO system (single input single output system). Then the system determines the correspondence δm[·] 7→ gm[·] and zero-state response to any input signal can be computed as a sum ∞ k ∞ yzs[k]= u[m]gm[k]= u[m]gm[k]+ u[m]gm[k] (1) m=0 m=0 m=k+1 X X X where the first term in the sum quantifies the effect of past and present inputs to the output and the second term quantifies the effect of future inputs to the output. If a system is causal, the effect of future inputs must be zero. For the time-invariant systems, we can go a step further. It is possible though a bit technical to show that the system state x must also depend linearly on initial input x0 and input signal u. Consequently, a system in a relaxed state x[k] = 0 remains in the relaxed state until the input signal u[k + ℓ] = 0. In particular, note that the step function δm[k]=0 for k<m and thus the system is still in the zero state at time m. Hence, we can conclude gm[k]= g0[k − m] := g[k − m] and we have to only know how the system reacts to the unit impulse at k = 0. For linear causal systems, the corresponding sum (1) is a convolution k yzs[k]= u[m]g[m − k] . (2) m=0 X 2 Convolutions and Z-transform Convolutions as such are difficult to confront in a raw format. Hence, mathe- maticians use formal methods to circumvent this eminent danger. Discrete con- volutions can be treated with formal series. Lety ˆ(x) be a product of ∞ ∞ −k −k uˆ(x)= u[k]z andu ˆ(x)= g[k]z . k=0 k=0 X X Then it is straightforward to verify k y[k]= u[k]g[m − k] m=0 X since we must take terms formu ˆ(x) andg ˆ(x) so that their summary degree is −k. This transformation is known as z-transform. For obvious reasons, the z-transform is unique. For each function g[·], we can computeg ˆ[z] and, given an infinite seriesg ˆ[z], we can reconstruct all values of g[·]. Similarly, it is easy to see that z-transform is linear h[k]= α1 · g1[k]+ α2 · g2[k] ⇐⇒ hˆ[z]= α1 · gˆ1[z]+ α2 · gˆ2[z] . 3 Transfer Function A transfer function gˆ[z] of a linear system is just a z-transform of impulse re- sponse g[·]. In particular, the convolution relation (2) becomes a product yˆzs[z]=ˆg[z]ˆu[z] . (3) For causal and lumped systems, it is possible to show that a transfer function must be a rational function N[z] gˆ[z]= D[z] where N[z] and D[z] are polynomials and deg N[z] ≤ deg D[z]. The stability and controllability of a linear system is greatly influenced by zeroes and poles of transfer function. A pole ofg ˆ[z] is a point z such that gˆ[z]= ∞ ⇔ D[z]=0 and a zero ofg ˆ[z] is a point z such that gˆ[z]=0 ⇔ N[z]=0 . Matlab function tf2zp computes zeros and poles of a rational function. 4 State Space Description and Transfer Function Normally, it is almost impossible to derive transfer function from the definition, since the system will have an infinite response to a unit impulse. Similarly, it is non-trivial task to device a linear system that implements the transfer function gˆ[z] by trying to device a system that has corresponding impulse response or impulse response matrix. Hence, one needs more clever conversion algorithms. Although a description of a lumped linear system can in principle be arbi- trarily complex, all of these can be converted into the following canonical form x[k +1]= A[k]x[k]+ B[k]u[k] (4) ( y[k]= C[k]x[k]+ D[k]u[k] where A[·], B[·], C[·] and D[·] are time-varying matrices with an appropriate shape. Moreover, any system that can be described through the equations (4) is linear. A system is time-invariant iff all matrices are constant in time. Now given a state space description (4) of a time-invariant system, it is possible to compute the transfer matrix Gˆ [z] as follows − Gˆ [z]= C(zI − A) 1B + D . This formula reveals an obvious fact that we can divide any linear system into a stateless subsystem y1[k]= Du[k] and a remaining sub-system with inertia x[k +1]= Ax[k]+ Bu[k] ( y2[k]= Cx[k] that are run in parallel. Indeed, if y[k]= y1[k]+ y2[k], then the corresponding −1 transfer function is Gˆ 1[z]+ Gˆ 2[z]= C(zI − A) B + D. For any proper transfer matrix it is also possible to construct a corresponding canonical state space equation. For clarity, we present the corresponding formula for the SISO system. Let the transfer function be n−1 n−2 β1z + β2z + · · · + βn gˆ[z]= n n−1 n−2 + γ z + α1z + α2z + · · · + αn then the corresponding matrices that determine state space equation are −α1 −α2 · · · αn−1 −αn 1 1 0 · · · 0 0 0 D = 0 1 · · · 0 0 B = 0 . . .. .. · · · . (5) . 0 0 0 · · · 1 0 C = β1 β2 ... βn−1 βn D = γ In Matlab these transformations are implemented as tf2ss and ss2tf. There are many other Matlab functions that can be used to analyse and op- timise the realisations of a transfer function. However, all these functions are require the purchase of Control System Toolbox. 5 Analyse and Synthesis of Block Diagrams∗ It is often convenient to decompose a linear system into small sub-systems that are interconnected. Moreover, all discrete systems can be built form addition, gˆ[z] = α · gˆ1[z] gˆ[z] =g ˆ 1[z] +g ˆ 2[z] gˆ1[z] α gˆ1[z] + gˆ2[z] gˆ1[z] gˆ[z] =g ˆ 1[z] · gˆ2[z] gˆ[z] = 1 − gˆ2[z] + gˆ1[z] gˆ1[z] gˆ2[z] gˆ2[z] Fig. 1. Transfer function of parallel, sequential and loop-back constructions multiplication, duplication and delay modules. Hence, it practical to know how to compute a transfer function from a block diagram and vice versa. The corresponding computation rule for simple configurations are given in Figure 1. One possible configuration how to reduce construction of MIMO (mul- tiple input multiple output) systems to SISO systems is given in Figure 2. Most of these formulae follow directly from the definitions, whereas the loop- back construction is a bit tricky to analyse. As usual, let u and y denote input and output signals. Additionally, let v be the feedback signal. Then the corresponding z-transforms must satisfy the following constraints yˆzs =ˆg1[z](ˆu +ˆv) , (6) vˆ =ˆg2[z] · yˆzs . (7) Now iterative substitution of the equation (7) into the equation (6) yields 2 gˆ1[z] yˆzs =ˆg1[z](1 +g ˆ2[z]+ˆg2[z]+ · · · )ˆu = · uˆ , 1 − gˆ2[z] which justifies the formula for the loop-back construction. u1 gˆ11 [z] + y1 gˆ21 [z] u 2 gˆ12 [z] gˆ22 [z] u 3 gˆ13 [z] gˆ23 [z] + y2 Fig. 2. The synthesis of a MIMO system with a transfer matrix Gˆ [z]=(ˆgij [z]) can be reduced to the design of individual transfer functionsg ˆij [z]..