﻿ Measurement Equation

# Measurement Equation

Until now, we've dealt with the future. We've derived two Kalman Filter prediction equations:

• State Extrapolation Equation
• Covariance Extrapolation Equation

From now on, we are going to deal with the present. Let's start with the Measurement Equation.

In the "One-dimensional Kalman Filter" section, we denoted the measurement by $$z_{n}$$.

The measurement value represents a true system state in addition to the random measurement noise $$v_{n}$$, caused by the measurement device.

The measurement noise variance $$r_{n}$$ can be constant for each measurement - for example, scales with a precision of 0.5kg (standard deviation). On the other hand, the measurement noise variance $$r_{n}$$ can be different for each measurement - for example, a thermometer with a precision of 0.5% (standard deviation). In the latter case, the noise variance depends on the measured temperature.

The generalized measurement equation in matrix form is given by:

$\boldsymbol{z}_{n} = \boldsymbol{Hx}_{n} + \boldsymbol{v}_{n}$
Where:
 $$\boldsymbol{z}_{n}$$ is a measurement vector $$\boldsymbol{x}_{n}$$ is a true system state (hidden state) $$\boldsymbol{v}_{n}$$ is a random noise vector $$\boldsymbol{H}$$ is an observation matrix

## The observation matrix $$\boldsymbol{H}$$

In many cases, the measured value is not the desired system state. For example, a digital electric thermometer measures an electric current, while the system state is the temperature. There is a need for a transformation of the system state (input) to the measurement (output).

The purpose of the observation matrix $$\boldsymbol{H}$$ is to convert the system state into outputs using linear transformations. The following chapters include examples of observation matrix usage.

### Scaling

A range meter sends a signal toward a destination and receives a reflected echo. The measurement is the time delay between the transmission and reception of the signal. The system state is the range.

In this case, we need to perform a scaling:

$\boldsymbol{z}_{n} = \left[ \begin{matrix} \frac{2}{c}\\ \end{matrix} \right] \boldsymbol{x}_{n} + \boldsymbol{v}_{n}$

$\boldsymbol{H} = \left[ \begin{matrix} \frac{2}{c}\\ \end{matrix} \right]$

Where:

$$c$$ is the speed of light

$$\boldsymbol{x}_{n}$$ is the range

$$\boldsymbol{z}_{n}$$ is the measured time delay

### State selection

Sometimes certain states are measured while others are not. For example, the first, third, and fifth states of a five-dimensional state vector are measurable, while the second and fourth states are not measurable:

$\boldsymbol{z}_{n} = \boldsymbol{Hx}_{n} + \boldsymbol{v}_{n} = \left[ \begin{matrix} 1 & 0 & 0 & 0 & 0\\ 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 0 & 1\\ \end{matrix} \right] \left[ \begin{matrix} {x}_{1}\\ {x}_{2}\\ {x}_{3}\\ {x}_{4}\\ {x}_{5}\\ \end{matrix} \right] + \boldsymbol{v}_{n} = \left[ \begin{matrix} {x}_{1}\\ {x}_{3}\\ {x}_{5}\\ \end{matrix} \right] + \boldsymbol{v}_{n}$

### Combination of states

Sometimes some combination of states can be measured instead of each separate state. For example, maybe the lengths of the sides of a triangle are the states, and only the total perimeter can be measured:

$\boldsymbol{z}_{n} = \boldsymbol{Hx}_{n} + \boldsymbol{v}_{n} = \left[ \begin{matrix} 1 & 1 & 1 \\ \end{matrix} \right] \left[ \begin{matrix} {x}_{1}\\ {x}_{2}\\ {x}_{3}\\ \end{matrix} \right] + \boldsymbol{v}_{n} = ({x}_{1} + {x}_{2} + {x}_{3}) + \boldsymbol{v}_{n}$

## Measurement equation dimensions

The following table specifies the matrix dimensions of the measurement equation variables:

Variable Description Dimension
$$\boldsymbol{x}$$ state vector $$n_{x} \times 1$$
$$\boldsymbol{z}$$ measurements vector $$n_{z} \times 1$$
$$\boldsymbol{H}$$ observation matrix $$n_{z} \times n_{x}$$
$$\boldsymbol{v}$$ measurement noise vector $$n_{z} \times 1$$