Code covered by the BSD License

### Highlights from Learning the Kalman-Bucy Filter in Simulink

5.0
5.0 | 3 ratings Rate this file 24 Downloads (last 30 days) File Size: 54.8 KB File ID: #18485 Version: 1.0

# Learning the Kalman-Bucy Filter in Simulink

by

### Yi Cao (view profile)

27 Jan 2008 (Updated )

A Simulink model to learn the continuous-time Kalman-Bucy Filter

File Information
Description

This model simulates the continuous-time version of Kalman filter, i.e. Kalman-Bucy filter working with a continuous-time Gassian process. An m-file is developed to provide several examples to show how the Simulink model can be used.

The package is suitable for beginner to learn the Kalman-Bucy filter by just changing the model parameters without to know the details of calculations. By looking into masked subsystems, you will also be albe to learn how it can be implemented in Simulink.

The model is developed in MATLAB R14SP1 (MATLAB 7.0.1, Simulink 6.1). If there is a need to work with previous version, please let me know.

Acknowledgements

Learning The Kalman Filter In Simulink V2.1 inspired this file.

MATLAB release MATLAB 7.0.1 (R14SP1)
02 Mar 2016 M Shivarama Shetty

### M Shivarama Shetty (view profile)

03 Apr 2013 andresfe24

### andresfe24 (view profile)

I just noticed that if I make the measurement matrix:

C = [1 0; 0 1]

the covariances behave appropriately. It is like if somehow the error from the velocity (which was not being measured) was accumulating on the estimates of the position and the velocity.

I am not sure why this is happening since the original measurement matrix:

C = [1 0];

produces an observable system (I verified this with the "obsv" and "rank" functions in Matlab).

Thanks.

Comment only
02 Apr 2013 andresfe24

### andresfe24 (view profile)

Very useful. Thanks!

For the ship position/velocity example, even though it seems like the filter successfully tracks the state, I saw that the covariances (P) are actualy growing. I am not sure why this would happen. I have tried modifying the model and measurement errors (Q and R), but still the covariances keep growing. What confuses me is that the error covariance for the position estimate starts actually decreasing, and then after several simulation steps, it starts to increase to much higher values.

Covariances seem to successfully decrease for the 4-state example, indicating more confidence on the estimates.

I tested this buy placing a Scope in the Simulink model to monitor the covariances.

Any comments on this are greatly appreciated.

Comment only
05 Apr 2009 V. Poor

### V. Poor (view profile)

07 Mar 2008 Yuriy Pigovsky

It is very useful information for beginners.
Especially to those, who need to know that Kalman-Bucy filter is not just a kind of death theory, but a real think, which could be applied in real-world applications.