Documente Academic
Documente Profesional
Documente Cultură
It was 1960 when the first paper on Kalman filter was presented to the world.
48
Also, the algorithm for Kalman filter is not complicated, either. It is more complicated than the
low-pass filter we saw in Part I, but absolutely not beyond our capability. Just a few additional
steps of computing and formulae are included. And one of the equations we have seen in Part I is
among them. This means there is a connection between the concepts of Kalman filter and low-pass
filter. This will be discussed in detail in Chapter 6.
Emphasizing once again, it is not difficult at all to apply Kalman filter algorithm to real world
problem without knowing its theoretical background. By understanding the explanation on the
algorithm in Part II and going through various examples in Part III, your fear towards Kalman
filter will melt away like snow.
Shall we go on, now?
49
x0 , P0
xk Ax k 1
Pk APk 1 AT Q
K k Pk H T ( HPk H T R) 1
Measurement
zk
xk xk K k ( z k Hx k )
Pk Pk K k HPk
Estimate
x k
50
In the figure, the part in the dashed box is Kalman filter algorithm. The structure is very simple. It
receives only one input (measurement, zk ) and returns one output (estimate, xk ).2 Internal process
is done through a four-step computation.
While analyzing the algorithm presented in Figure 5.1, it would be better not paying too much
attention to the subscript k in the name of each variable. It just serves to clarify that Kalman filter
algorithm is executed recursively and thats it. No meaning beyond that. If that subscript k makes
you confused, it is all right to ignore it completely. On the other hand, the superscript - has an
important meaning. Any variable bearing this has totally different meaning from the one without it
with same name.
Now let us look into the computational procedure of the algorithm in detail. The first step is for
prediction. The two variables xk and Pk , which will be used throughout the Steps II through IV,
are computed in this step. The superscript - means predicted value. The formulae in this
prediction step have very close relationship with system model. This will be discussed in detail
later.
In Step II, Kalman gain( Kk ) is being computed. The variable Pk computed in the previous step is
used. H and R are the values preset outside Kalman filter.
In Step III, an estimate is computed from a measurement given as input. It has not been clearly
revealed yet, but the formula in this step is related to low-pass filter. This will be explained later,
xk instead of xk .
51
External input
zk (measurement)
Final output
xk (estimate)
System model
A , H, Q, R
xk , Pk , Pk , Kk
Explanation for the variables in System model category, shown as A , H , Q , and R , were not
given so far. These should be set before implementing Kalman filter. In other words, these
variables are not computed or assumed in Kalman filter. These are the values preset by the user
according to the characteristics of the system and purpose of Kalman filter. Therefore, you could
assume that the values of these variables are already known and dont have to worry about them
when studying Kalman filter algorithm itself. However, please keep in mind that the performance
of Kalman filter is closely tied to these values. The relationship between system model and
Kalman filter will be discussed in detail in Chapter 8.
In the table above, all the variables except those categorized as System model could not be
changed arbitrarily by the designer because these are measured or computed by the algorithm.
Therefore, when the performance of Kalman filter designed is not satisfactory, the only variables
that could be adjusted are those four variables related to system modeling. In other words, the four
variables of the system model are the design factors. The performance of Kalman filter will be
determined by these. For your reference, the performance of Kalman filter gets better as your
system model gets closer to the actual system you are modeling.
Kalman filter algorithm laid out in Figure 5.1 has been divided into four steps, but if we divide this
according to the meaning, it becomes two parts.
Prediction process
Step I of Figure 5.1 falls into this process. The estimate and error covariance from the previous
time point ( xk 1 and Pk 1 , respectively) are used as input and prediction of these two at the
52
current time point ( xk and Pk , respectively) are returned as final result. These values are used
for estimation process. The system model parameters used in prediction process are A and Q .
Estimation process
In Kalman filter algorithm, Steps II, III, and IV fall into this process. The results of estimation
process are the estimate( xk ) and error covariance( Pk ). In this process, measurement( zk ) is also
included as an input in addition to the predictions from prediction process ( xk and Pk ). System
model variables used in estimation process are H and R .
xk and Pk
2. Compensate the difference between measurement and prediction, and compute new
estimate. This estimate is the final result of Kalman filter: xk and Pk
3. Loop through those two steps above.
Following the conceptual categorization shown above, prediction process and estimation process
will be presented in Chapters 6 and 7, respectively, in this book. This type of categorization is
helpful for understanding Kalman filter algorithm. Finally, system model will be discussed in
Chapter 8. System model is so important that it is not an exaggeration to say it determines the
performance of Kalman filter.