Jump to content
  • Advertisement
Sign in to follow this  
Deliverance

Kalman filtering

This topic is 3088 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been searching for 1D Kalman filtering for ages but can't seem to wrap my head over all that math. I think i need to get the general idea about this in "layman's terms". I searched the forums and saw that a few people already asked about this but no helpful responses were given. Can someone give me an example of 1D Kalman filtering, please?

Share this post


Link to post
Share on other sites
Advertisement
The 1D Kalman Filter is quite simple actually. You will begin with your state vector

[x, v]

in this case you are estimating the position x and v is your velocity in either direction.

The filter is broken into two stages...the prediction and the update. The prediction stage gives the a priori estimate based on the previous iteration. The estimate is computed as

x_k = F * x_k-1 + G

where F = [1 deltaT] and G = [0.5 * deltaT^2 deltaT] * sigma. Sigma is added noise. The covariance matrix is predicted as

p_k = F * p_k_1 * FT + Q

where FT is the transpose of F and Q = G * GT.

Given a new measurement for the object being tracked the predicted state is updated as follows:

(1) Compute the residual measurement: y = z - H * x_k, where z is your new measurement, H = [1 0], and x_k is the predicted value from above.

(2) Compute the residual covariance: S = H * p_k * HT + R, where R is measurement noise.

(3) Compute the kalman gain: K = p_k * HT * inv( S ), where inv() computes the inverse of the S.

(4) Compute the new estimate of the object:

x = x_k + K * y
p = ( I - K * H ) * p_k, where I is the identify matrix.

Hope this helps a little. The wiki page for the Kalman Filter gives a small example as well for a truck, which is basically the same example I have just given. If you have more specific questions as to which part you don't understand or any implementation questions, post them here.

- me

Share this post


Link to post
Share on other sites
1. Is your state space 1-dimensional, or is it that you have a particle moving in one dimension, governed by Newton's Laws of motion (as in inferno82's example)?

2. Do you want a continuous-time filter, or a discrete-time one?

3. In any case, I think the Kalman filter is best understood as a Bayesian estimator. You start with a Gaussian prior over the state space (specified by a mean -- the "estimate" -- and a covariance matrix). Then at each step, conceptually, you multiply your prior by the likelihood function -- also a Gaussian -- corresponding to your observation. Since the product of Gaussians is a Gaussian, you just get a new Gaussian distribution (encoded by a different mean and covariance) which becomes the prior for your next observation. That's really all that's going on.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!