# trackingKF

Linear Kalman filter for object tracking

## Description

A `trackingKF`

object is a discrete-time linear
Kalman filter used to track the positions and velocities of target platforms.

A Kalman filter is a recursive algorithm for estimating the evolving state of a process when measurements are made on the process. The filter is linear when the evolution of the state follows a linear motion model and the measurements are linear functions of the state. The filter assumes that both the process and measurements have additive noise. When the process noise and measurement noise are Gaussian, the Kalman filter is the optimal minimum mean squared error (MMSE) state estimator for linear processes.

You can use this object in these ways:

Explicitly set the motion model. Set the motion model property,

`MotionModel`

, to`Custom`

, and then use the`StateTransitionModel`

property to set the state transition matrix.Set the

`MotionModel`

property to a predefined state transition model:Motion Model `'1D Constant Velocity'`

`'1D Constant Acceleration'`

`'2D Constant Velocity'`

`'2D Constant Acceleration'`

`'3D Constant Velocity'`

`'3D Constant Acceleration'`

## Creation

### Syntax

### Description

`filter = trackingKF`

creates a linear Kalman filter object for a
discrete-time, 2-D, constant-velocity moving object. The Kalman filter uses default
values for the `StateTransitionModel`

,
`MeasurementModel`

, and `ControlModel`

properties. The function also sets the `MotionModel`

property to
`'2D Constant Velocity'`

.

specifies the state transition model, `filter`

= trackingKF(`F`

,`H`

)`F`

, and the measurement
model, `H`

. With this syntax, the function also sets the
`MotionModel`

property to `'Custom'`

.

also specifies the control model, `filter`

= trackingKF(`F`

,`H`

,`G`

)`G`

. With this syntax, the
function also sets the `MotionModel`

property to
`'Custom'`

.

sets the motion model property, `filter`

= trackingKF(`'MotionModel'`

,`model`

)`MotionModel`

, to
`model`

.

configures the properties of the Kalman filter by using one or more
`filter`

= trackingKF(___,`Name`

,`Value`

)`Name`

,`Value`

pair arguments and any of the
previous syntaxes. Any unspecified properties take default values.

## Properties

## Object Functions

`predict` | Predict state and state estimation error covariance of linear Kalman filter |

`correct` | Correct state and state estimation error covariance using tracking filter |

`correctjpda` | Correct state and state estimation error covariance using tracking filter and JPDA |

`distance` | Distances between current and predicted measurements of tracking filter |

`likelihood` | Likelihood of measurement from tracking filter |

`clone` | Create duplicate tracking filter |

`residual` | Measurement residual and residual noise from tracking filter |

`initialize` | Initialize state and covariance of tracking filter |

## Examples

## More About

## Algorithms

The Kalman filter describes the motion of an object by estimating its state. The state generally consists of object position and velocity and possibly its acceleration. The state can span one, two, or three spatial dimensions. Most frequently, you use the Kalman filter to model constant-velocity or constant-acceleration motion. A linear Kalman filter assumes that the process obeys the following linear stochastic difference equation:

$${x}_{k+1}={F}_{k}{x}_{k}+{G}_{k}{u}_{k}+{v}_{k}$$

*x _{k}* is the state at step

*k*.

*F*is the state transition model matrix.

_{k}*G*is the control model matrix.

_{k}*u*represents known generalized controls acting on the object. In addition to the specified equations of motion, the motion may be affected by random noise perturbations,

_{k}*v*. The state, the state transition matrix, and the controls together provide enough information to determine the future motion of the object in the absence of noise.

_{k}In the Kalman filter, the measurements are also linear functions of the state,

$${z}_{k}={H}_{k}{x}_{k}+{w}_{k}$$

where *H _{k}* is the measurement
model matrix. This model expresses the measurements as functions of the state. A
measurement can consist of an object position, position and velocity, or its position,
velocity, and acceleration, or some function of these quantities. The measurements can also
include noise perturbations,

*w*.

_{k}These equations, in the absence of noise, model the actual motion of the object and the actual measurements. The noise contributions at each step are unknown and cannot be modeled. Only the noise covariance matrices are known. The state covariance matrix is updated with knowledge of the noise covariance only.

For a brief description of the linear Kalman filter algorithm, see Linear Kalman Filters.

## References

[1] Brown, R.G. and P.Y.C. Wang.
*Introduction to Random Signal Analysis and Applied Kalman
Filtering*. 3rd Edition. New York: John Wiley & Sons, 1997.

[2] Kalman, R. E. "A New Approach to
Linear Filtering and Prediction Problems." *Transaction of the ASME–Journal of
Basic Engineering*, Vol. 82, Series D, March 1960, pp. 35–45.

[3] Blackman, Samuel.
*Multiple-Target Tracking with Radar Applications*. Artech House.
1986.

## Extended Capabilities

## See Also

### Functions

### Objects

### Topics

**Introduced in R2021a**