Resources: Kalman Filter

Problem 1

Given the following discrete-time model

Where , , and . will be used as a tuning variable, and will be experimentally estimated in the lab.

We remember how to discretize a system using Exact Discretization

Transclude of Exact-Discretization#^8febd7
Where
Transclude of Kalman-Filter#^141688

We first have (in continuous time):

Using Matlab we get the discrete system.

T = 0.002;
sys = ss(A,B,C,D);
sys_discrete = c2d(sys, T);
[A_d, B_d, C_d, D_d] = ssdata(sys_discrete);

By using the block in Simulink called “To Workspace”, we can extract .

load("NAME_OF_SIMULINK_BLOCK.mat");
y_out = NAME_OF_SIMULINK_VARIABLE;
y_out(1, :) = []
R_d = cov(y_out');

This is done by remove the first column, and then transposing the matrix before we find the covariance matrix, .