Kalman filter - question about matrices

In order to familiarize myself with Kalman filter I decided to see how it work step by step. I would gladly use your help. Let's say I have a falling object with air resistance proportional to its velocity. Since my measurements are not perfect let's say that position measurement is gaussian with standard deviation of $15m$, so is velocity with deviation $5 \frac{m}{s}$. Equation for this system is $\ddot{x} = g - \frac{b}{m}\dot{x}$, where $b,m$ are constant. Now how do I find matrices $A$ and $B$. Do I simply convert to space-state form? Also, how do I determine the processing noise $\mathbf{v}$? And finally, how do I find covariance matrices of of processing($\mathbf{Q}$) and measurement ($\mathbf{R}$)? If you are kind enough to help me I would gladly ask you some more questions tomorrow.

According to the scenario you formulated, you only have measurement noise and no input noise. You are correct that you might need a state space model. For example,

$$\begin{bmatrix}\dot{x} \\ \ddot{x}\end{bmatrix} = \begin{bmatrix} 0 & 1 \\ 0 & -\frac{b}{m}\end{bmatrix} \begin{bmatrix}x \\ \dot{x}\end{bmatrix} + \begin{bmatrix} 0 \\ 1 \end{bmatrix} u + \begin{bmatrix} 0 \\ 1 \end{bmatrix} v,$$

$$\begin{bmatrix}y_1 \\ y_2 \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \begin{bmatrix}x \\ \dot{x}\end{bmatrix} + \begin{bmatrix}w_1 \\ w_2\end{bmatrix},$$

with $u$ always equal to $g$, $v$ the input noise (which assumed to be zero), $y_1$ the measured position, $y_2$ the measured velocity and $w_1$ and $w_2$ zero mean Gaussian noise.

Since we did not take into account input noise, therefore you can also view it as a zero mean Gaussian noise with also zero (standard) deviation. When calculating the covariance matrices you can take the variance (standard deviation squared) on the diagonal, if all random variables are independent (which I assume $w_1$ and $w_2$ are). This would yield,

$$Q = \mathbb{E}(v^2) = \begin{bmatrix}0 \end{bmatrix},$$

$$R = \mathbb{E}\left([w_1\ w_2]^T [w_1\ w_2]\right)= \begin{bmatrix}225 & 0 \\ 0 & 25 \end{bmatrix}.$$

But depending on whether you want to implement a Kalman filter in continues or discrete time, you might first have to discretize the state space model.

• Thank you very much for the answer. It is really helpful. Now - let's assume that we have some Gaussian noise as processing error. My questions: 1) What exactly is this processing/input error? I know that measurement error comes from uncertainty of measurements since we are not able to measure things perfectly, but how about this processing error? How do I calculate/estimate it? 2) How do I detemine whether or not error (let's say $w_1$ and $w_2$ are corelated? – gabe Jan 29 '17 at 10:37
• @G.Fil If you are doing exercises like these, then they should be given. But if you want to determine this for a physical system then I would guess that you would determine those from a measurement. I have not done this myself, so I am not completely sure about this. Especially about how to get both $v$ and $w$ out of it. But once you have a time series of them you can easily calculate $Q$ and $R$ using covariance. – fibonatic Jan 29 '17 at 12:00
• Thank you very much for you answers, really helped me :) I guess i'll go and ask one of my professors about some more details. – gabe Jan 29 '17 at 12:45