Windows software to simuluate kalman filter.
Visual Kalman Filter provides a visual method in windows to estimate the state of a process or removes "noise" from series of data. The users need not install matlab, and there are only three steps to operate it. You'll get the curve and the estimated results.
Key Features of Visual Kalman Filter
Support for discrete system and continuous system
Manage (save or open) the file with the project file *.klm
Easy to use
Support for ALL Windows OS.
New and improved interface.
Other introductions of Visual Kalman Filter
The Kalman filter is a set of mathematical equations that provides an efficient computational (recursive) means to estimate the state of a process, in a way that minimizes the mean of the squared error. The filter is very powerful in several aspects: it supports estimations of past, present, and even future states, and it can do so even when the precise nature of the modeled system is unknown.
'Visual Kalman Filter' provides a visual method to estimate the state of a process. The users need not install matlab, and there are only three steps to operate it. Finally if you click the state you want to observe, the figure and the values of the estimated result will appear immediately.
The main operation you need to do is to set initial matrice. User has two choices: 1. Open an existent matrice txt file edited beforehand. For example, user can open the txt files in the folder 'Demos' in the installed path. 2. Fill the matrice manually, and save them in a txt file at last.
The Kalman Filter
Rudolf Emil Kalman, born on May 19, 1930, in Budapest, Hungary, is a Hungarian-American electrical engineer, mathematical system theorist, and college professor, who was educated in the United States, and has done most of his work there. He is currently a retired professor from three different institutes of technology and universities. He is most noted for his co-invention and development of the Kalman filter, a complicated mathematical formulation that is widely used in control systems, avionics, and outer space manned and unmanned vehicles. For this work, U.S. President Barack Obama awarded Kalman with the National Medal of Science on October 7th, 2009.
The Kalman filter produces estimates of the true values of measurements and their associated calculated values by predicting a value, estimating the uncertainty of the predicted value, and computing a weighted average of the predicted value and the measured value. The most weight is given to the value with the least uncertainty. The estimates produced by the method tend to be closer to the true values than the original measurements because the weighted average has a better estimated uncertainty than either of the values that went into the weighted average.
The Kalman filter has two distinct phases: Predict and Update. The predict phase uses the state estimate from the previous timestep to produce an estimate of the state at the current timestep. This predicted state estimate is also known as the a priori state estimate because, although it is an estimate of the state at the current timestep, it does not include observation information from the current timestep. In the update phase, the current a priori prediction is combined with current observation information to refine the state estimate. This improved estimate is termed the a posteriori state estimate. Typically, the two phases alternate, with the prediction advancing the state until the next scheduled observation, and the update incorporating the observation. However, this is not necessary; if an observation is unavailable for some reason, the update may be skipped and multiple prediction steps performed. Likewise, if multiple independent observations are available at the same time, multiple update steps may be performed (typically with different observation matrices Hk).
Formulas of Kalman filter
In order to use the Kalman filter to estimate the internal state of a process given only a sequence of noisy observations, one must model the process in accordance with the framework of the Kalman filter. This means specifying the following matrice:
Fk, the state-transition model; Hk, the observation model; Qk, the covariance of the process noise; Rk, the covariance of the observation noise; and sometimes Bk, the control-input model for each time-step
First of all, we need to introduce a system of discrete control processes--Linear Stochastic Difference equation. The system can be a linear stochastic differential equations to describe:
X (k) = AX (k-1) + BU (k) + W (k)
Coupled system of measurement:
Z (k) = HX (k) + V (k)
Formula in the last two, X (k) is k times the system state, U (k) is k times the amount of system control. A and B are system parameters, the multi-model system, their matrix. Z (k) is k times the measured value, H is a measure of system parameters, the multi-measurement system, H for the matrix. W (k) and V (k) represent process and measurement noise. They are assumed as Gaussian white noise (White Gaussian Noise), their covariance are Q, R (here we assume they do not change with the system state changes).
To meet the above conditions (linear stochastic differential systems, processes and measurement are Gaussian white noise), Kalman filter is optimal information processors.
First of all we have to use the system process model to predict the next state of the system. Suppose the current system state is k, according to the system model can be based on a state of the system in state prediction:
X (k | k-1) = AX (k-1 | k-1) + BU (k) ... ... ... .. (1)
Type (1), X (k | k-1) is predicted using the results of the previous state, X (k-1 | k-1) is on a state of optimal results, U (k) for the present state control volume, if not control volume, it can be 0.
Until now, our system results have been updated, however, corresponds to X (k | k-1) of the covariance not updated. We use P said covariance:
P (k | k-1) = AP (k-1 | k-1) A '+ Q ... ... ... (2)
Type (2), P (k | k-1) is X (k | k-1) corresponds to the covariance, P (k-1 | k-1) is X (k-1 | k-1) corresponding covariance, A ', said the transposed matrix A, Q is the systematic process of covariance. 1,2 is the Kalman filter formula 5 formula which the first two, that is, the system forecasts.
Now that we have now the state of prediction, and then we collect the current state of measurement. Predicted value and measured value combination, we can get current state (k) the optimization estimates X (k | k):
X (k | k) = X (k | k-1) + Kg (k) (Z (k)-HX (k | k-1)) ... ... ... (3)
One Kg for the Kalman gain (Kalman Gain):
Kg (k) = P (k | k-1) H '/ (HP (k | k-1) H' + R) ... ... ... (4)
Until now, we've got the best k state estimates X (k | k). However, another Kalman filter in order to keep the system running until the end of the process going, we need to update the k state X (k | k) of the covariance:
P (k | k) = (I-Kg (k) H) P (k | k-1) ... ... ... (5)
Where I is a matrix, a single model for a single measurement, I = 1. When the system enters state k +1, P (k | k) is the formula (2) P (k-1 | k-1). This algorithm can go from the return operation.
Kalman filter basically describes the principle, formula 1,2,3,4, and 5 are his five basic formula. According to this formula 5, can easily achieve a computer program.
Example of Visual Kalman Filter
If we are to the object of study is a room temperature. Judgments based on your experience, the room temperature is constant, that is, the next minute the temperature is equal to the temperature of this minute (assuming we do a minute of time units). Suppose you are on your experience is not 100% believe that there may be deviations from top to bottom several times. We call these deviations as a Gaussian white noise (White Gaussian Noise), which is later in front of these deviations is not related to and consistent with Gaussian distribution (Gaussian Distribution). In addition, we put a thermometer in the room, but the thermometer is not accurate, measurement error than the actual value. We also put these errors as Gaussian white noise.
Well, now we have two for a minute about the room temperature values: the predictive value of your experience (Predictive value) and the thermometer's value (measured value). Here we use the combination of the two values of noise to their respective estimated the actual room temperature.
Of course, we do not need very much to see the exact model. We know the temperature of this room is near the same temperature for a time, so A = 1. Does not control volume, so U (k) = 0. So come to:
X (k | k-1) = X (k-1 | k-1) ... ... ... .. (6)
Formula (2) can be changed:
P (k | k-1) = P (k-1 | k-1) + Q ... ... ... (7)
Because the measured value is the thermometer, correspond directly with the temperature, so H = 1. 3,4,5 can be replaced by the following formula:
X (k | k) = X (k | k-1) + Kg (k) (Z (k)-X (k | k-1)) ... ... ... (8)
Kg (k) = P (k | k-1) / (P (k | k-1) + R) ... ... ... (9)
P (k | k) = (1-Kg (k)) P (k | k-1) ... ... ... (10)
Now we simulate a set of measurements as input. Suppose the real room temperature is 25 degrees, I simulated 200 measurements, the average of these measurements is 25 degrees, but several times by adding a standard deviation of the Gaussian white noise.
Order Kalman filter to work, we need to tell the two zero-time Kalman initial value is X (0 | 0) and P (0 | 0). Not too concerned about their values, one can easily give up, because as Kalman's work, X will gradually converge.But for P, usually do not get 0, because this might lead to Kalman totally believe you given X (0 | 0) is the best system, so that algorithms can not converge. I chose the X (0 | 0) = 1 degree, P (0 | 0) = 10.
The system's real temperature is 25 degrees, figure used black lines. Figure in red is the optimal Kalman filter output results (the results in the algorithm set Q = 1e-6, R = 1e-1).
Example download: temperature.txt
Another example download: Free_falling.txt
In installed folder, you will find some klm files such as Free_falling.klm, temperature.klm. When you have opened the software, You can Click 'open Project' to open the demos. With three steps, you will get the results.
Product list