0% found this document useful (0 votes)
51 views4 pages

Bayesian Filtering Techniques: Kalman and Extended Kalman Filter Basics

Uploaded by

ali_raza117
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views4 pages

Bayesian Filtering Techniques: Kalman and Extended Kalman Filter Basics

Uploaded by

ali_raza117
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Bayesian Filtering Techniques: Kalman and Extended

Kalman Filter Basics


Ján Mochnáč, Stanislav Marchevský, Pavol Kocan1
1
Dept. of Electronics and Multimedia Communications, Technical University of Košice, Park Komenského 13, 041 20
Košice, Slovak Republic

[email protected], [email protected], [email protected]

Abstract. Bayesian filters provide a statistical tool for deal- ing the set of received measurements [2]. Such PDF in-
ing with measurement uncertainty. Bayesian filters estimate cludes all available statistical information. Hence it forms
a state of dynamic system from noisy observations. These the complete solution to the estimation problem. For the lin-
filters represent the state by random variable and in each ear Gaussian estimation problem is suitable Kalman filter.
time step probability distribution over random variable rep- The Kalman filter assumes that the required PDF remains
resents the uncertainty. If estimate is needed with every new Gaussian in every time step. This filter can be used in va-
measurement, it is suitable to use recursive filter. Unfortu- riety of applications. One of the possible option is to use it
nately optimal Bayesian solution exists in a restrictive set of in video coding as motion estimator, or it can be used in er-
cases, e.g. Kalman filters which assume Gaussian PDF or ror concealment process to estimate lost motion vectors [3],
we need to use suboptimal solution, e.g. extended Kalman [4]. For recursive nonlinear estimation problem is extended
filters which use local linearization to approximate PDF to Kalman filter the simplest solution. The extended Kalman
be Gaussian. Filter is based on the linearization of the non-Gaussian PDF
in the prediction step. After that Kalman Filter can be ap-
plied.

Keywords
Bayesian approach, Kalman filter, extended Kalman 2. Bayesian Filtering
Filter, estimation. In Bayesian approach we attempt to construct the pos-
terior PDF of the state given all measurements. All available
information is used to form such PDF. So this PDF repre-
1. Introduction sents complete solution.
Let xk , k ∈ N, be the state sequence:
We often need to estimate the state of a system that
changes over the time in order to solve some scientific prob-
xk = fk (xk−1 , uk−1 , vk−1 ) (1)
lems. When we have data corrupted by additive random
noise and interference of different kinds, we need to extract where fk is in generally non-linear function of the previous
signal from this data. Input for our investigation is discrete state xk−1 ∈ Rnx , vk−1 ∈ Nnv is state noise, uk−1 ∈ Rnu is
or continuous time series, which can be analyzed in a batch known input, nx , nv , nu are dimensions of the state, process
or sequentially. In batch analyzes, time series is processed and input noise vectors.
in one step, while in sequential analyzes estimation of the Next, let zk be the measurement:
current state is updated as new measurements are made.
A recursive filter is convenient solution for sequential ana- zk = hk (xk , nk ) (2)
lyzes. Such filter operates in two stages. In prediction stage
it makes prediction of the state probability density function where zk ∈ Rnz , hk is in generally non-linear measure-
(PDF) with using of system model. In the update stage it ments function, nk ∈ Nnn is measurement noise, nz and nn
modifies predicted PDF with using of latest measurement. are dimensions of the measurement and measurement noise
Filter theory is the theory of sequentially estimating vectors.
the underlying state of a system using measurements ob- We want to find estimate of the xk based on all available
tained over time [1]. Bayesian approach to the filtering pro- measurements at time k (marked as z1:k ) by constructing the
vides base for the dynamic state estimation problems. With posterior PDF p(xk , z1:k ). It is assumed, that initial PDF
Bayesian filtering methods, we have to construct the PDF p(x0 |z0 ) ≡ p(x0 ) is available. Posterior PDF can be ob-
of the state based on the all available information, includ- tained recursively in two stages, namely prediction and up-
date. Suppose that required PDF p(xk−1 |z1:k−1 ) at time step

978-1-4244-3538-8/09/$25.00 ©2009 IEEE

Authorized licensed use limited to: BEIHANG UNIVERSITY. Downloaded on May 17,2020 at 14:04:12 UTC from IEEE Xplore. Restrictions apply.
k-1 is available. Then using the system model it is possible Kalman Filter is based on Bayesian filtering, and thus it
to obtain the prior PDF of the state at the time step k [2]: works also in the two phases: Predict and Update. Predict
Z stage can be described with following two equations:
p(xk |z1:k−1 ) = p(xk |xk−1 )p(xk−1 |z1:k−1 ) dxk−1 (3)
x̂k|k−1 = Fk x̂k−1|k−1 + Bk−1 uk−1 (8)
Prediction step usually deforms, spreads state PDF due to where x̂k|k is the estimate of the state at time k given obser-
noise. vations up to time k and
Measurement zk is available at time step k, so it can be used
to update the the prior. Using Bayes’ rule we obtain: Pk|k−1 = Fk Pk−1|k−1 FTk + Qk−1 (9)

p(zk |xk )p(xk |z1:k−1 ) where Pk|k is the error covariance matrix.
p(xk |z1:k ) = (4)
p(zk |z1:k−1 ) Update stage can be described with the following equations:

where the normalizing constant is: ỹk = zk − Hk x̂k|k−1 (10)


Z
where ỹk is innovation term,
p(zk |z1:k−1 ) = p(zk |xk )p(xk |z1:k−1 ) dxk (5)
Sk = Hk Pk|k−1 HTk + Rk (11)
In the update equation (5), the measurement zk is used to
modify the predicted prior from the previous time step to where Sk is innovation covariance and Rk is covariance of
obtain PDF of the state. nk ,
Equations (3) and (4) theoretically allow optimal Bayesian Kk = Pk|k−1 HTk S−1k (12)
solution. But it is only conceptual solution and integrals where Kk is Kalman gain,
in these equations are intractable. Solution exists in some
restricted cases such as Kalman Filter and grid-based filters. x̂k|k = x̂k|k−1 + Kk ỹk (13)

is update state estimate and


2.1 Kalman Filter
Kalman filter together with its basic variants are com- Pk|k = (I − Kk Hk )Pk|k−1 (14)
monly used tools in statistical signal processing, especially
in the context of causal, real-time applications. is update estimate covariance.
There are several approaches in the derivation of the Kalman With using least-square methods we obtain the same
Filter. We can assume Gaussian distribution of the deriving results. By using least-square method all the distributions
process and of the initial state. In the next phase, we derive are described by their means and covariances in the deriva-
the posterior distribution of the states given the observations, tion procedure.
taking the mean of the resulting distributions as the estima-
tion of the state. The second approach combines a recursive-
weighted least-squares method with special weighting of the
2.2 Extended Kalman Filter
previous estimate of the states in the role of additional mea- Kalman Filter can be used in estimation of the state
surements [5], [6]. xk ∈ Rnx where posterior PDF is Gaussian in every time
step. But in many cases this PDF is not-Gaussian and we
To model state of the internal process let’s assume that
need to use different approach such as approximate grid-
posterior density in time k-1, p(xk−1 |zk−1 ), is Gaussian.
based method or extended Kalman Filter. This methods are
Hence, p(xk |zk ) is also Gaussian. Next, random variables
also labeled as sub-optimal algorithms [7], [9].
vk−1 and nk are independent with normal probability dis-
tributions and with covariances labeled as Qk−1 and Rk . Again, let xk ∈ Rnx be the state sequence, but in op-
fk (xk−1 , vk−1 ) and hk (xk , nk ) are linear function. Hence, posite to the previous case, process is governed by the non-
equations (1) and (2) for derivation of the optimal Bayesian linear stochastic difference equation [8]:
solution can be rewritten to the form:
xk = f (xk , uk ) + vk−1 (15)
xk = Fk xk−1 + Bk uk + vk−1 (6)
with measurement zk ∈ Rnz :
zk = Hk xk + nk (7)
xk = h(xk ) + nk (16)
where Fk and Hk are matrices defining the linear function
[7]. In practice, these matrices and covariance matrices where vk−1 and nk represent process and measurements
Qk−1 , Rk might change with each time step or measurement. noise vectors. In this case, functions f and h are non-linear.
As the Kalman filter is recursive estimator, only estimated Function f can be used to compute state in time step k from
state from the previous time step and measurement at the the previous estimate and function h can be used to compute
current time step are needed to compute current state [8]. the predicted measurement from the predicted state.

Authorized licensed use limited to: BEIHANG UNIVERSITY. Downloaded on May 17,2020 at 14:04:12 UTC from IEEE Xplore. Restrictions apply.
Extended Kalman Filter is based upon approximation
of the Bayes’ rule using linearization. Again as Kalman Fil-
ter, its extended version works also in two phases: prediction
and update. Predict stage can be described using following
equations:
x̂k|k−1 = f (x̂k−1|k−1 , uk ) (17)
where x̂k|k−1 is the estimate of the state at time k given
observations up to time k-1 and

Pk|k−1 = F̂k Pk−1|k−1 F̂Tk + Qk (18)

where Pk|k−1 is the error covariance matrix.


Update stage can be described with the following equations:

ỹk = zk − h(x̂k|k−1 ) (19)

where ỹk is innovation term,


Fig. 1: Estimation of the noisy signal using Kalman
filter.
Sk = Ĥk Pk|k−1 ĤTk + Rk (20)

where Sk is innovation covariance and Rk is covariance of


nk ,
Kk = Pk|k−1 ĤTk Sk −1 (21)
where Kk is Kalman gain,

x̂k|k = x̂k|k−1 + Kk ỹk (22)

is update state estimate and

Pk|k = (I − Kk Ĥk )Pk|k−1 (23)

is update estimate covariance. State transition and observa-


tion matrices are defined by the following:

∂f
Fk = (24)
∂x x̂k−1|k−1 ,uk

∂h Fig. 2: Smoothed estimation of the noisy signal.
Hk = (25)
∂x x̂k|k−1

Equations for the extended Kalman filter shown above


utilizes first term in a Taylor expansion of the non-linear
function. Utilizing higher order terms is possible, but com-
putational complexity prohibited their use [7].

3. Simulations
In our simulation we have tried to estimate simple sine
signal using Kalman and also extended Kalman filter. All
simulation were done using EKFUKF toolbox in MATLAB.
When we compare Fig. 1 – Fig. 2 for Kalman filter with
Fig. 3 – Fig. 4 for extended Kalman filter we can see that
Kalman filter gives better results what corresponds to the
assumption that for highly restrictive case (Gaussian PDFs)
no algorithm can outperform Kalman filter. From Fig. 2
it is clear that smoothed estimate is almost the same as the Fig. 3: Estimation of a random sine signal using ex-
original sine signal. Hence Kalman filter estimation in this tended Kalman filter.
scenario is very good choice.

Authorized licensed use limited to: BEIHANG UNIVERSITY. Downloaded on May 17,2020 at 14:04:12 UTC from IEEE Xplore. Restrictions apply.
sity in each time step. For this situation there is no other
solution that can outperform Kalman filter. But in many
real world applications the assumptions made for Kalman
filter do not hold. In such applications it is possible to use
some approximation like in extended version of Kalman fil-
ter. The extended Kalman filter approximate non-Gaussian
PDF to be Gaussian what cannot describe it very well for
every case and leads to the estimation errors, therefore par-
ticle filter seems to be better solution for such applications
and our research will follow this way.

Acknowledgement
The work presented in this paper was supported by
Grant of Ministry of Education and Academy of Science of
Slovak Republic VEGA under Grand No 1/4088/07.
Fig. 4: Smoothed estimation of a random sine signal
using extended Kalman smoother. References
[1] PUNSKAYA, E. Sequential Monte Carlo methods for digital commu-
nications. Ph.D. thesis, Engineering Department, Cambridge Univer-
Extended Kalman filter (Fig. 4) has problem with estimation sity, Cambridge, UK, 2003, p. 30 - 42.
of peaks of the sine signal. Also when we compare these [2] GORDON, N. J., SALMOND, D. J., SMITH, A. F. M. Novel ap-
two filter algorithms, Kalman filter need less time to catch proach to nonlinear/non-Gaussian Bayesian state estimation. Radar
the signal at the start of the signal run. and Signal Processing, IEE Proceedings F, 1993, vol. 140, no. 2,
p. 107 - 113.
However, Kalman filter can not be used in non-
[3] POLEC, J., ONDRUŠOVÁ, S., KOTULIAKOVÁ, K., KAR-
Gaussian environment and extended Kalman filter is one of LUBÍKOVÁ, T. Hierarchical Transform Coding Using NURBS Ap-
the possible options in this environments. Extended Kalman proximation. Proceedings Elmar-2008: 50th International Sympo-
filter is sub-optimal algorithm which uses local linearization sium ELMAR-2008, Zadar, Croatia, 2008, ISBN 978-953-7044-09-1,
vol. 1, p. 65 - 68.
and Gaussian approximation. This fact results in poor esti-
mation of the highly non-linear time series (Fig. 5). Hence, [4] GAO, Z.-W., LIE, W.-N. Video error concealment by using Kalman-
filtering technique. Proceedings of the 2004 International Symposium
extended Kalman filter can be used in non-Gaussian envi- on Circuits and Systems, ISCAS apos, vol. 2, 2004, p. 69 - 72.
ronment, but for better estimation approximate grid-based
[5] GANNOT, S., YEREDOR, A. The Kalman Filter and its Application
methods or particle filters are more suitable [7]. to Speech Processing. In Springer Handbook of Speech Processing
and Speech Communication, Springer, 2008, p. 135 - 157.
[6] ORAVEC, M., ROZINAJ, G., BESZÉDEŠ, M. Detection and Recog-
nition of Human Faces and Facial Features. Speech, Audio, Image and
4. Conclusion Biomedical Signal Processing Using Neural Networks, Berlin Heidel-
In our paper we try to simply describe basic Bayesian berg, ISBN: 978-3-540-75397-1, 2008, p. 283 - 301.
filter solution. In such filter approach probability density [7] ARULAMPALAM, M.S., MASKELL, S., GORDON, N., CLAPP, T.
A tutorial on particle filters for online nonlinear/non-Gaussian
function includes all information needed to optimally solve Bayesian tracking. IEEE Transactions on Signal Processing, 2002,
estimation problem. While we often need to process infor- vol. 50, no. 2, p. 174 - 188.
mation sequentially, it is suitable to use recursive filters, like [8] WELCH, G., BISHOP, G. An Introduction to the Kalman Filter, Sig-
Kalman and extended Kalman filters. Kalman filter repre- graph Course Notes, course 8, 2001.
sents optimal Bayesian solution for Gaussian posterior den- [9] FOX, D.,HIGHTOWER, J., LIAO, L., SCHULZ, D., Borriello, G.
Bayesian Filters for Location Estimation. IEEE Pervasive Computing
Magazine, 2003, p. 24 - 33.

Fig. 5: Estimation of the bimodal nonlinear time series using extended Kalman filter.

Authorized licensed use limited to: BEIHANG UNIVERSITY. Downloaded on May 17,2020 at 14:04:12 UTC from IEEE Xplore. Restrictions apply.

You might also like