KALMANFILTERING3-SCLHome

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

KALMAN FILTERING – NOISE-CORRUPTED SIGNAL PROCESSING
The Kalman filter can out-perform a first-order
l.p. filter and will provide an element of state prediction
G F STEVEN
(Published in Electronics & Wireless World November 1988)
The Kalman filter is now over 25 years old, but has only achieved wider application in recent years because of more accessible, faster and cheaper means for its computation. The term ‘filter’ applies because of its ability to reduce the effects of noise on a signal, but the Kalman filter is more correctly called a State Estimator, the term ‘state’ being used to describe an attribute of a system. Thus, if we consider an aircraft being tracked by radar, the aircraft states of interest might be its course, height and speed; these states would need to be correctly assessed, say, for the purposes of air traffic control. In this case a Kalman filter might be used to estimate the ‘states’ of the aircraft, based on radar measurements.
This example is deliberately chosen, not only because it is a textbook example of Kalman filter application, but also because it underscores the fact that such techniques, at least until recently, have been associated predominantly with the space, defence and communications industries.
NOISE ASPECTS
Kalman filtering is used to process signals which are corrupted by noise, which can be interpreted here not only in its conventional sense of ‘unwanted signal’ but also to express the idea of uncertainty. Thus, fluctuations in the Financial Times Index, or changes in national unemployment figures, could both be considered as examples of uncertainty or noise superimposed on a underlying trend or signal.
Such noise may arise within the system itself and is variously known as process, plant or system noise. It is associated with uncertainty in the dynamics of the system (such as in weather forecasting). Alternatively, noise may arise within the observation mechanism or sensor, when it is known as observation or measurement noise. It can arise for a variety of reasons: e.g. electrical and/or mechanical inaccuracies in the sensor such as training misalignment and backlash in the radar tracking example above; or because of arithmetic resolution in the computing elements, rounding off errors and limitations inherent in the computing algorithms. However, to simplify the mathematics, fundamental assumptions are made concerning both process and observation noise which have a bearing on the development and application of the Kalman filter.
GENERAL FEATURES
The Kalman filtering operation is generally concerned with discrete-time or sampled-data systems. The filter output at any particular instant is a weighted combination of two elements; a prediction of the correct output at that instant, based on earlier data; and a noisy observation made at that instant.
The weighting of each element depends on whether the filter places greater faith in its own prediction or on the observation, bearing in mind that both are subject to uncertainty. Thus, the composite output is an intuitively acceptable combination of prediction and observation, in which the error in the combination is less than either of the errors in the components taken separately.
KALMAN FILTER FORMULATION
Consider the simple case where a single-input, single-output system is subject to process and observation noise as referred to previously. We are concerned with the state of that system and can write standard state space form:
x(k+1)=Ax(k)+Bu(k)+w(k)(1) (process equation)
y(k)=Cx(k)+v(k)(2)(observation equation)
Where y(k) is an observation at time k, x(k) is the system state at time k. A and C are linear scaling factors. w(k) and v(k) are process and observation noise components respectively. These equations can be expressed diagrammatically as in Figure 1.
We assume that the noise sequences w(l), w(2) …..w(k) and v(1), v(2) … v(k) have zero mean, that each successive value of noise is independent of the previous values and that w(k) and v(k) sequences are independent of each other. Further, we assume that the state x(k) is similarly independent of either of the noise values w(k) and v(k). These assumptions need to be borne in mind and checked for validity when any particular application of Kalman filter is being considered. Extensions to the theory do exist to cater for departure from these assumptions, but are not considered here.
We now make three further fundamental assertions in the formulation of the Kalman filter.
1. On average, the difference between estimated state and actual state at time k is zero. This is
expressed notationally as:
)]()(ˆ[)](~[=−=k x k x E k x E Where E is the expectation, or ‘averaging’ operator and )(ˆk x the estimated value of x(k). This is termed an unbiassed estimate.2.
The expected value of the square of the previously mentioned error is a minimum. This is the ‘minimum mean square error’ (m.m.s.e. ) criterion and is expressed notationally as:Min 2)]()(ˆ[k x k x E −
or min 2
)](~[k x E 3. The estimate of the state at time k is a linear combination of observation at time k and prediction of the state at time k based on previous data thus:
)
()()1/(ˆ)()/(ˆk y k K k k x k J k k x +−=(3)
Where notationally
=)/(ˆk k x estimate of state based on data up to present time k and
)1/(ˆ−k k x is an estimate of state at time k based on data up to time (k-l); i.e. a one-step-ahead
prediction. y(k), of course, is an observation at time k. J(k) and K(k) are both weighting factors which may be time-varying and are therefore shown as functions of k.
We now have all the required information to formulate a Kalman filter. Making substitution into (3) from the observation equation for y(k):
)]
()()[()1/(ˆ)()/(ˆk v k Cx k K k k x k J k k x ++−=
Figure 1. System diagram of a Kalman state estimator
Taking expectations (strictly, unconditional expectations)
)]
([)()]([).()([)()](ˆ[k v E k K k x CE k K k x E k J k x E ++=(4)
Note that the last term on the r.h.s is zero, from the assumption that the noise is zero mean. Now,referring to the requirement for unbiassedness 0)]()(ˆ[=−k x k x E implies that
)]
([)(ˆ[k x E k x E =Therefore expression (4) reduces to
)
(1)(k CK k J −=(5)
Substituting (5) into (3),
)]
1/(ˆ)()[()1/(ˆ)/(ˆ−−+−=k k x C k y k K k k x k k x (6)
Equation (6) embodies the idea of filter output consisting of a combination of predicted and observed data. We now wish to evaluate K(k), commonly known as the Kalman gain. Examining the m.m.s.e. requirement, repeat (6)
)]
1/(ˆ)()[()1/(ˆ)/(ˆ−−+−=k k x C k y k K k k x k k x Subtracting )
(k x =−)()/(ˆk x k k x “error”
)()]1/(ˆ)()()[()1/(ˆk x k k x C k v k Cx k K k k x −−−++−=)
()()()1/(ˆ])(1[k v k K k x k k x C k K +−−−=Squaring and taking expectations,
=−2)]()/([k x k k x E “mean square error”
2
)]()())()1/(ˆ)()(1[(k v k K k x k k x C k K E +−−−=Now, if the r.h.s. is expanded as a squared expression and expectations taken, the following results are obtained. It must be remembered that we have assumed that noise sequences and states are not correlated and therefore the expectation of these cross products is zero.Also 2
)]([v k v E σ=, observation noise variance by definition We define
2)]()/([k x k k x E − as )/(k k P ,
and 2)]()1/([k x k
k x E −− as )
1/(−k k P Thus 22)()1/(.])(1[)/(k K k k P C k K K k P +−−
=2
v σWe wish to minimise this expression with respect to K(k) to arrive at the m.m.s.e. criterion. This may be done by differentiation methods; however a more straightforward method is to carry out a completion of squares procedure as follows:
)1/()1/()1/(])1/()1/()(][)1/([)1/()1/()
()1/(2)(][)1/([)1/()()1/(2)(])1/([)/(2
2222
2222
2
2222222v
v v
v
v v k k P C k k P C k k P k k P C k k CP k K k k P C k k P k k P C k K k k CP k K k k P C k k p k K k k CP k K k k P C k k P σσσσσσ+−−−−++−−−+−=−++−−−
+−=−+−−+−=And this is minimised by inspection when 2
2)1/()
1/()(v k k P C k k CP k K σ+−−=
(7)
By back substitution,
22
2
2)1/()1/()1/()/(v k k P C k k P C k k P k k P σ+−−−−=(8)
2
2
2)1/()1/(v v k k P C k k P σσ+−−=(9)
Re-expressing (8):
)]
(1)[1/()/(k CK k k P k k P −−=(10)
Now, )()()()1(k w k Bu k Ax k x ++=+ again.Thus )()(ˆ)1(ˆk Bu k x A k x +=+,
and )
()]()(ˆ[)1()1(ˆk w k x k x A k x k
x −−=+−+Squaring and averaging (hence mean square error) and assuming noise is uncorrelated with states gives: 22)/()/1(w k k P A k k
P σ+=+ where 2
w σ is the plant noise variance.
KALMAN FILTER OPERATION
We now have the complete formulation of all computational steps to allow the Kalman filter to
estimate system state from successive observations of system output. These steps involve iterations of the following sequence:1. Calculate Kalman gain (equation 7)
2. Input new observation, update current estimate (equation 6)
3. Update the current m.m.s.e. estimate (equation 10)
4. Input new control, if known. Generate new state prediction (equation 1)
5. Generate a new m.m.s.e. prediction (equation 11).
6.
Repeat from step 1, at new sample instant. The necessary expressions used in such filtering are summarised below, for reference. They are shown in the order in which they might be used in a practical situation:
Kalman gain 2
2)1/()1/()(v k k P C k k CP k K σ+−−=
(7)
Current state estimate
)]
1/(ˆ)()[()1/(ˆ)/(ˆ−−+−=k k x C k y k K k k x k k x (6)
Current m.m.s.e. estimate )]
(1)[1/()/(k CK k k P k k P −−=(10)
New state prediction )
()()()1(k w k Bu k Ax k
x ++=+(1)
New m.m.s.e. prediction 2
2)/()/1(w k k P A k k
P σ+=+(11)
To start the computational sequence, initial values need to be chosen for )1/(−k k P and
)1/((ˆ−k k x that is, )0/1(P and )0/1(ˆx respectively. Values for noise variances are assumed to
be known.AN EXAMPLE
The application of a simple, scalar Kalman filter can be illustrated in a real example where airflow
within an industrial dryer was to be estimated using a single anemometer. Airflow distribution in such an application is complex and measured airflow is subject to both actual disturbances in the dryer and to inaccuracies within the anemometer.
To cope with the degree of uncertainty in airflow measurement it was decided to pass the anemometer output through a Kalman filter in order to make optimal estimates of actual airflow. As already stated,noise variances for the plant and sensor needed to be quantified beforehand, and some value for m.m.s.e.. and state estimates were required to start off the filter algorithm. These values were found by experiment, a simple mathematical model of the plant’s behaviour was determined following a series of step response tests carried out on the dryer and from which process and observation equation parameters were evaluated. This model was run on a hand-held calculator with a value of noise superimposed on the noise free model output, sufficient for its performance to represent that of the actual plant. Thus a record of true airflow and noisy airflow measurements were available for feeding into a Kalman filter. A plot of such values appears in Figure 2.
The filter algorithm was based on the filter equations quoted earlier and run on the same hand-held calculator. The airflow measurement record was applied to the filter for a variety of plant and
Figure 2. Model representing ideal and noisy behaviour of airflow, providing an input to the Kalman filter
observation noise settings and error between filter output and true airflow were determined; a simple statistical analysis was then carried out to find the values of plant and observation noise that yielded the best estimate of airflow, i.e. minimum standard deviation (s.d.) in estimate error.
The variation of estimate error – accuracy – with plant and observation noise settings is shown in Figure 3.
Figure 3. Variation of error, showing that proper choice of plant and observation noise setting can
reduce estimate error
This figure shows that estimate error can be minimised by judicious selection of plant and observation noise figures. The Kalman filter was again run with the best combination of noise values and a plot for filter airflow estimates against true airflow is shown in Figure 4.
Figure 4. Plot of estimates against true airflow after choosing combination of noise values, to be compared
with Figure 2.
PASSIVE FILTERING
The airflow measurement record was also passed through a simple first-order filter for comparison purposes. A plot of estimate error against filter time constant is shown in Figure 5 which shows that the most accurate performance is not as good as that in Figure 4; a short time constant fails to filter out system noise and a long time constant degrades the filter’s tracking performance. Against this, a simple Kalman filter provides reasonable steady state and tracking performance combined with a facility for state prediction, albeit at greater computation cost. In this application however, where a computer was to be used for airflow data logging at slow sample rates, the inclusion of Kalman filtering to improve airflow measurements in the face of extremely noisy data would be considered to be a significant and worthwhile improvement.
Figure 5. Plot of estimate error against time-constant of first-order filter,
showing that its best performance is poorer than that of Figure 4.。

相关文档
最新文档