Filtering of Discrete-Time State-Space models with the p
Transcripción
Filtering of Discrete-Time State-Space models with the p
Recent Researches in Telecommunications, Informatics, Electronics and Signal Processing Filtering of Discrete-Time State-Space models with the p-Shift Kalman-like Unbiased FIR Algorithm OSCAR IBARRA-MANZANO Guanajuato University Department of Electronics, DICIS Ctra. Salamanca-Valle, 3.5+1.8km, Palo Blanco, Salamanca MEXICO [email protected] Abstract: In this paper, we show a simple way to derive the p-shift finite impulse response (FIR) unbiased estimator (UE) recently proposed by Shmaliy for time-invariant discrete-time state-space models. We also examine its iterative Kalman-like form. We conclude that the Kalman-like algorithm can serve efficiently as an optimal estimator with large averaging horizons. It has better engineering features than the Kalman one, being independent on noise and initial conditions. Both algorithms produce similar errors, although the proposed one overperforms the Kalman filter if the noise covariance matrices are filled incorrectly. The full horizon Kalman-like and Kalman algorithms produce equal errors only within some range of averaging horizons. With smaller horizons, the Kalman filter is more accurate and, with larger ones, the proposed solution provides better denoising. Simulation results are obtained for the 3-state space polynomial model and quadratic noiseless signal measured with noise. Key–Words: Kalman-like filtering, FIR estimator, State-space 1 Introduction where xn and x̃n|n are the state vector and its estimate1 and E denotes an average of the succeeding expression. The condition (1) means that the average of the estimate x̃n|n must be equal to that of its origin xn in order for the bias to be removed from the estimate. We find (1) imbedded in many linear estimators, as shown in [4]. Most recently, the unbiasedness has been employed by Zhou and Wang in [11] to design FIR-median hybrid filters with polynomial fitting, Shmaliy et. al in [9, 12–14] for unbiased FIR filtering, prediction and smoothing of state space models, Kim and Lee in [15] to design a FIR filter for state estimation, and Ahn and Kim in [16] for fixedlag maximum likelihood FIR smoothing of state space models. Any FIR filter obeying (1) can be said to be optimal in the minimum bias sense with the following recognized engineering features: its gain does not depend on noise and initial conditions [2, 4]; for polynomial signals, its gain can be represented with unique finitedegree polynomials, existing on an averaging horizon of N points [9]; and it becomes virtually optimal in the minimum mean square error (MSE) sense when N À 1 [2] or the mean square initial state dominates the noise components in order of magnitudes [17], because the estimate variance reduces as a reciprocal Unbiased estimators play an important role in solving problems in tracking [1], timekeeping and clock synchronization [2], positioning, etc. Unbiasedness is strongly desired for median estimators, channel estimation in wireless systems, channel identification and equalization, estimation of systems with unknown inputs and periodic time-varying structures, image denoising, etc. Even the IEEE Standard 1139-1999 [3] for frequency and time metrology states that “an efficient and unbiased estimator is preferred”. Signals and models are often estimated using the finite impulse response (FIR) filters [4–9] owing to important advantages of the latter against the infinite impulse response (IIR) ones. FIR filters are known to have an imbedded bounded input/bounded output (BIBO) stability and better robustness against the model uncertainties [10]. It also follows from [4] that the optimal FIR filter is more robust against the Kalman one. Summarizing, Jazwinski stated in [10] that the limited memory (or FIR) filter appears to be the only device for preventing divergence in the presence of unbounded perturbation in the system. In state space FIR modeling and estimation of discrete-time signals, unbiasedness is commonly achieved by satisfying the unbiasedness condition E{x̃n|n } = E{xn } , ISBN: 978-1-61804-005-3 1 Here and in the following x̃k|v means the estimate at k via measurement from the past to v. (1) 71 Recent Researches in Telecommunications, Informatics, Electronics and Signal Processing of N [7, 8]. A payment for this is a higher order of FIR filters against the IIR ones that causes computational burden. Therefore, methods of fast convolution computation are often required in order to reduce the computation time. That can be provided either employing the circular convolution theorem in the discrete Fourier transform (DFT) domain or designing fast recursive or iterative computation forms in discrete time. Below, we first show a simple way to derive the p-shift FIR unbiased estimator (UE) proposed by Shmaliy in [18] for discrete-time state-space models and then examine its iterative Kalman-like form in comparison to the standard Kalman one. positive step p. Finally, smoothing can be organized at a past point n + p with a negative lag p. Inherently, all FIR estimates are N -dependent. We can thus recognize the fixed horizon estimation with T = τ (N − 1), N = const, and m = n − N + 1; variable horizon estimation with T = τ (N − 1), N = var, and m = n − N + 1; and full horizon estimation via all the data available with T = τ (N − 1) = τ n, N = n + 1, and m = 0. If the condition (1) is satisfied, then all these estimates will exist in the unbiased sense. Being essentially an averaging structure, the unbiased FIR filter relies on large N in order to reduce noise substantially in the output. That causes the main problem associated with such kind of filters: their practical implementation has typically large computational complexity featured to batch discrete convolution forms, when N À 1. To circumvent this problem, fast methods of discrete convolution computations need to be used. In discrete time, this means finding fast recursive forms for the batch unbiased FIR estimator. 2 Signal Model Let us consider a general discrete real-time-invariant linear model [19] represented in state space with the state and observation equations, respectively, xn = Axn−1 + Bwn , (2) yn = Cxn + Dvn , (3) 3 where the K × 1 state vector and M × 1 observation vector are given by, respectively, xn = [x1n x2n . . . xKn ]T , (4) yn = [y1n y2n . . . yM n ]T . (5) It has been shown in [4] that the unbiasedness constraint for linear FIR filters is equal to the deadbeat constraint associated with noiseless both system and measurement. That means that the unbiased FIR estimator can be derived, if we remove noise from (1) and (2) and represent the remaining deterministic equations on a horizon of N points, similarly to [9], with recursively computed forward-in-time solutions [19] as follows, respectively, The K × K transition matrix A projects the nearest past state xn−1 to the present state xn . The measurement matrix C has M × K dimensions. Most generally, B and D have K × K and M × M dimensions, respectively. The K × 1 input noise vector and M × 1 measurement noise vector, respectively, wn = [w1n w2n . . . wKn ]T , (6) vn = [v1n v2n . . . vM n ]T , (7) Xn,m = An−m xm , (8) Yn,m = Cn−m xm , (9) where the KN × 1 state vector Xn,m and the M N × 1 observation vector Yn,m are specified on the time interval from m to n by, respectively, £ ¤T Xn,m = xTn xTn−1 . . . xTm , (10) have zero-mean components, E{wn } = 0 and E{vn } = 0. It is implied that wn and vn are mutually uncorrelated, E{wi vjT } = 0, having arbitrary covariances Rw = E{wi wjT } and Qv = E{vi vjT }, respectively, for all i and j. The vectors wn and vn are thus supposed to be not obligatorily Gaussian and delta-correlated. If we now apply a linear convolution operator to measurement yn on a horizon of N points, we can expect solving three basic estimation problems. Filtering can be provided if the estimate is related to the current point n. Prediction can be obtained if the estimate is forwarded to the future point n + p with a ISBN: 978-1-61804-005-3 p-Shift Unbiased FIR Estimator £ ¤ T T T Yn,m = ynT yn−1 . . . ym . (11) Here, the KN × K transition matrix An−m and the M N ×K observation matrix Cn−m are time-invariant and dependent on the averaging interval length N − 1 = n − m, respectively, £ ¤T , (12) Ai = (Ai )T (Ai−1 )T . . . AT I Ci = 72 £ (CAi )T (CAi−1 )T ... (CA)T ¤T CT . (13) Recent Researches in Telecommunications, Informatics, Electronics and Signal Processing Let us now assign some K × M N gain matrix H(p) and claim that the estimate x̃n+p|n of xn is x̃n+p|n = H(p)Yn,m = H(p)Cn−m xm . Table 1: Iterative p-Shift Kalman-like FIR UE Algorithm (14) (15) Stage Because Yn,m in (14) can be said to be an input and x̃n+p|n an output of the estimator, the gain matrix H(p) must realize the convolution principle. The estimate x̃n+p|n can now be found in the unbiased sense and assigned as x̄n+p|n . To enable finding the relevant unbiased gain H̄(p), first rewrite the unbiasedness condition (1) for the deterministic state vector as E{x̄n+p|n } = E{xn+p } = xn+p . Given: m = n − N + 1, s = m + K − 1 PK−1 = (CTK−1 CK−1 )−1 FK−1 = AK−1 PK−1 (AK−1 )T x̄s+p|s (16) = AK−1+p PK−1 CK−1 T Ys,m Update: Fv = AFv−1 AT − AFv−1 ×(I + ΞFv−1 )−1 ΞFv−1 AT x̄m+v+p|m+v = Ax̄m+v+p−1|m+v−1 +Ap Fv CT (ym+v − CA1−p ×x̄m+v+p−1|m+v−1 ) Instruction: Use x̄m+v+p|m+v as the output when v = N − 1 3.1.1 Full Horizon Algorithm It follows that the algorithm (Table 1) can be used straightforwardly when N is fixed or variable. In a specific case of the model distinct over all observation time, estimation must be provided employing all the data available. That will guarantee best denoising. The relevant full horizon Kalman-like unbiased FIR algorithm attains hence a simpler form (Table 2). This algorithm suggests that the computation must start with n = K, because CTK−1 CK−1 is singular otherwise. Its splendid property is that only two parameters are required, K and p. (19) and relevant p-shift unbiased FIR estimate x̄n+p|n = An−m+p (CTn−m Cn−m )−1 CTn−m Yn,m . (20) Although the batch convolution form (20) can be used whenever the unbiased estimate is needed via measurement from m to n, the computational problem arises instantly when N is large. That often causes computation time delays such that x̄n+p|n cannot be used in real time. Below we shall show that the problem can efficiently be overcome by representing (20) in a recursive Kalman-like form. 4 Simulations Below, we apply the Kalman-like algorithm to the 3-state space polynomial model and quadratic signal measured with noise in a comparison to the standard Kalman one. 3.1 Kalman-like Form of the FIR UE Following [18], the FIR UE can be represented in an iterative form as shown in Table 1. One can observe that the iterative computation starts at m + K with v = K and finishes at n when v = N − 1. The true estimate is taken at each v = N − 1 and the procedure repeated recursively. It is important that the algorithm (Table 1) does not involve noise and initial conditions. ISBN: 978-1-61804-005-3 Ξ = AT CT CA Set: In order to solve (15) for H̄(p) fitting (16), the state vector xn+p needs to be specified via the initial state xm . That can be done if we write the first component of (8) at n as xn = An−m xm . Because n can be arbitrary, we can further induce a time shift p and go to xn+p = An−m+p xm . (17) Now substitute (17) instead of x̃n+p|n in (15), remove the initial state vector xm from both sides, and go to the p-variant unbiasedness (or deadbeat) constraint An−m+p = H̄(p)Cn−m . (18) Further multiplying (18) from the right-hand side with the identity matrix (CTn−m Cn−m )−1 CTn−m Cn−m gives us the p-shift unbiased gain matrix H̄(p) = An−m+p (CTn−m Cn−m )−1 CTn−m K, p, v = K, ..., N − 1 4.1 Filtering of the 3-state space model In the first experiment, we consider the 3-state space polynomial model xn = Axn−1 + wn , 73 (21) Recent Researches in Telecommunications, Informatics, Electronics and Signal Processing Table 2: Full Horizon Kalman-like FIR UE Algorithm Given: Set: First state × 103 Stage K, p, and n > K Ξ= Kalman-like Kalman 1 AT CT CA x1n PK−1 = (CTK−1 CK−1 )−1 FK−1 = 0 1 AK−1 PK−1 (AK−1 )T 2 n × 103 (a) x̄K−1+p|K−1 150 = AK−1+p PK−1 CK−1 T YK−1 100 Kalman Kalman-like Error Update: 2 Fn = AFn−1 AT − AFn−1 50 2 0 ×(I + ΞFn−1 )−1 ΞFn−1 AT 1 ? 50 x̄n+p|n = Ax̄n−1+p|n−1 + Ap Fn CT ×(yn − CA1−p x̄n−1+p|n−1 ) 150 n × 103 (b) Kalman Kalman-like Error 100 50 2 yn = Cxn + vn , (22) 1 ? 50 in which xn = [x1n x2n x3n ]T , C = [ 1 0 0 ], and 2 1 τ τ2 A= 0 1 τ . 0 0 0 Figure 1: Kalman and Kalman-like estimates of x1n under the temporary measurement uncertainty: (a) measurement and estimates, (b) estimate errors, and (c) errors in the Kalman filter estimate affected by incorrect noise description. The process was generated recursively at 3000 discrete points by setting τ = 1 s, x10 = 100, x20 = 10−2 /s, and x30 = 10−5 /s2 . All noise sources were assumed to be independent and uncorrelated white sequences with the standard deviations of σx1 = 1, σx2 = 5 × 10−3 /s, σx3 = 3 × 10−5 /s2 , and σv = 100. To investigate effect of a temporary measurement uncertainty upon the estimates, we voluntary added a bias of 200 to the measurement noise vn in the time interval from 1200 to 1250 points. For such processes with known initial conditions and noise variances, the standard Kalman algorithm can be applied straightforwardly to produce optimal estimates as described in [2] (see Appendix B). The Kalman-like unbiased algorithm (Table 1) can also be applied straightforwardly, if we let K = 3, specify C2 , by (13), as 1 2τ C2 = 1 τ 1 0 2τ 2 τ2 2 4.1.1 Filtering of the first state Figure 1a sketches filtering estimates, p = 0, of the first state x1n provided with two algorithms and N = 700. One can observe that the estimates are consistent, except for the initial transient region that is removed in Fig. 1b and Fig. 1c. Both filters produce similar errors that can be seen in Fig. 1b. It can also be seen that the Kalman filter exhibits a bit larger peak-excursion in the uncertainty region in Fig. 1b. A situation changes if we recall that the state noise is not always observable in applications and increase the standard deviation in the first and second states by the factor of 2 and 4, respectively. Under such conditions, the Kalman filter is no longer optimal and one can expect for errors in its estimate. In fact, the Kalman filter demonstrates larger excursions in Fig. 1c under the temporary uncertainty and larger noise beyond this region, although its estimate remains unbiased. We meet a similar picture reported in [8] as related to the current clock state filtering via the Global Positioning System (GPS)-based measurement of the clock time errors in the presence of GPS time uncertainties. , 0 and set N corresponding to the minimum difference with the Kalman estimate in the absence of uncertainty. ISBN: 978-1-61804-005-3 n × 103 (c) 74 Recent Researches in Telecommunications, Informatics, Electronics and Signal Processing Kalman Kalman 2 1.5 x3n Third state × 103/s2 Second state × 103/s 1.5 1 x2n Kalman-like 1 0.5 0.5 Kalman-like 2 1 0 ? 0.5 Kalman n × 103 (a) n × 103 (a) Kalman-like 2 1 0 ?1 ?2 0.5 1 2 ? 0.5 1.5 n × 103 (b) Kalman 1 5 4 3 2 1 0 ?1 ?2 ?3 Error × 103/s Kalman-like 0.5 2 1 ? 0.5 Kalman-like Kalman 2 1 n × 103 (b) Kalman Error × 103/s2 Error × 103/s 1 2 1 Error × 103/s2 0 Kalman-like 2 1 n × 103 (c) n × 103 (c) Figure 3: Kalman and Kalman-like Estimates of x3n under the temporary measurement uncertainty: (a) measurement and estimates, (b) estimate errors, and (c) errors in the Kalman filter estimate caused by incorrect noise description in the second and third states. Figure 2: Kalman and Kalman-like Estimates of x2n under the temporary measurement uncertainty: (a) measurement and estimates, (b) estimate errors, and (c) errors in the Kalman filter estimate caused by incorrect noise description in the second and third states. 4.1.2 Quadratic Process × 102 Kalman-Like (Full-Horizon) Filtering of the second and third states In line with the first state, the same tendencies can be traced in the estimates of the second and third states sketched in Fig. 2 and Fig. 3. In fact, both filters produce similar errors in Fig. 2b and Fig. 3b, except for the region close to n = 2 × 103 , in which the Kalmanlike filter exhibits excursions, owing to transients in the response to the uncertainty. It is also seen that the Kalman-like filter strongly overperforms the Kalman one in Fig. 2c and Fig. 3c when we increase the noise variances of the second and third states in the covariance matrix. 4.2 Kalman 1 0 1.5 0.5 ?5 x1n yn ?10 n × 103 (a) 240 Error Kalman 80 1.5 0.5 1 ? 80 Denoising of a quadratic signal Kalman-Like (Full-Horizon) Equal Errors In the second typical experiment, we generated a quadratic noiseless signal x1n observed as yn in the presence of measurement white noise sequence vn having the standard deviation of σv = 200 as shown in Fig. 4a. The process was generated with the initial states x10 = 100, x20 = −5 × 10−2 /s, and x30 = −5×10−4 /s2 . Because the Kalman filter needs ISBN: 978-1-61804-005-3 5 ? 240 n × 103 (b) Figure 4: Denoising of a quadratic signal with the Kalman and full horizon Kalman-like algorithms: (a) measurement and estimates and (b) estimate errors. 75 Recent Researches in Telecommunications, Informatics, Electronics and Signal Processing the system covariance matrix, we voluntary accepted σx1 = 2, σx2 = 5 × 10−2 /s, and σx3 = 10−5 /s2 . For such a distinct model over all time, the full horizon Kalman-like filter (Table 2) was run along with the Kalman filter. Figure 4a shows both estimates and Fig. 4b gives us the relevant errors. Under the above-specified conditions, the Kalman filter tracks the deterministic signal with errors associated with the accepted components in the covariance matrix. Just on the contrary, the Kalman-like filter inherently starts with large noise when N is small. 5 IEEE Trans. Ultrason. Ferroel. Freq. Contr., Vol. 54, No. 11, 2007, pp. 2403–2406. [8] Y. S. Shmaliy, Optimal gains of FIR estimators for a class of discrete-time and state-space models, IEEE Signal Process. L., Vol. 15, 2008, pp. 517–520. [9] Y. S. Shmaliy, Unbiased FIR filtering of discrete-time polynomial state-space models, IEEE Trans. Signal Process., Vol. 57, No. 4, 2009, pp. 1241–1249. [10] A. H. Jazwinski, Stochastic Processes and Filtering Theory, Academic Press, 1970. Conclusions [11] X. Zhou and X. Wang. FIR-median hybrid filters with polynomial fitting, Digital Signal Process., Vol. 39, No. 2, 2004, pp. 112–124. In this paper, we proposed a short way to derive the discrete-time p-shift Kalman-like FIR UE originally presented in [18]. Based upon several examples, we showed that this algorithm can serve efficiently as an optimal estimator if N occurs to be large. In turn, the Kalman algorithm requires noise description that often cannot be provided correctly and its estimate thus cannot always be optimal. [12] Y. S. Shmaliy, L. Morales-Mendoza L, FIR smoothing of discrete-time polynomial signals in state space, IEEE Trans. Signal Process., Vol. 58. No. 5, 2010, pp. 2544–2555. [13] Y. S. Shmaliy, An unbiased p-step predictive FIR filter for a class of noise-free discrete-time models with independently observed states, Signal Image Video Process., Vol. 3, No. 2, 2009, pp. 127–135. References: [1] E. Brookner, Tracking and Kalman Filtering Made Easy, John Wiley & Sons, 1998. [14] L. Arceo-Miquel, Y. S. Shmaliy, O. IbarraManzano, Optimal synchronization of local clocks by GPS 1PPS signals using predictive FIR filters, IEEE Trans. Instrum. Measur., Vol. 58, No. 6, 2009, pp. 1833–1840. [2] Y. S. Shmaliy, An unbiased FIR filter for TIE model of a local clock in applications to GPSbased timekeeping, IEEE Trans. Ultrason. Ferroel. Freq. Contr., Vol. 53, No. 6, 2006, pp. 862–870. [15] P. S. Kim, M. E. Lee, A new FIR filter for state estimation and its application, J. Comput. Sci. Techn., Vol. 22, No. 5, 2007, pp. 779-784. [3] Definitions of physical quantities for fundamental frequency and time metrology – random instabilities. IEEE Standard 1139-1999. [16] C. K. Ahn, P. S. Kim, Fixed-lag maximum likelyhood FIR smoother for state-space models, IEICE Electonics Express, Vol. 5, No. 1, 2008, pp. 11–16. [4] W. H. Kwon, P. S. Kim, S. H. Han, A receding horizon unbiased FIR filter for discrete-time state space models, Automatica, Vol. 38, No. 3, 2002, pp. 545–551. [17] Y. S. Shmaliy, O. Ibarra-Manzano, Optimal FIR filtering of the clock time errors, Metrologia, Vol. 45, No. 5, 2008, pp. 571–576. [5] Y. S. Shmaliy, A simple optimally unbiased MA filter for timekeeping, IEEE Trans. Ultrason. Ferroel. Freq. Contr., Vol. 49, No. 6, 2002, pp. 789–797. [18] Y. S. Shmaliy, Linear optimal FIR estimation of discrete time-invariant state-space models, IEEE Trans. Signal Process., Vol. 58, No. 6, 2010, pp. 3086–3096. [6] Z. Quan, S. Han, W. H. Kwon, A robust FIR filter for linear discrete-time state-space signal models with uncertainties, IEEE Signal Process. L., Vol. 14, No. 8, 2007, pp. 553–556. [19] H. Stark, J. W. Woods, Probability, random processes, and estimation theory for engineers, 2nd ed., Prentice Hall, 1994. [7] Y. S. Shmaliy, On real-time optimal FIR estimation of linear TIE models of local clocks, ISBN: 978-1-61804-005-3 76