# dsp.KalmanFilter

(To be removed) Estimate system measurements and states using Kalman filter

`dsp.KalmanFilter`

will be removed in a future release. Use the Kalman
filter functionality in Sensor Fusion and Tracking Toolbox™ instead.

## Description

The `dsp.KalmanFilter`

System object™ is an estimator used to recursively obtain a solution for linear optimal
filtering. This estimation is made without precise knowledge of the underlying dynamic system.
The Kalman filter implements the following linear discrete-time process with state,
*x*, at the *k*^{th} time-step: $$x(k)=Ax(k-1)+Bu(k-1)+w(k-1)$$ (state equation). This measurement, *z*, is given as: $$z(k)=Hx(k)+v(k)$$ (measurement equation).

The Kalman filter algorithm computes the following two steps recursively:

Prediction: Process parameters x (state) and P (state error covariance) are estimated using the previous state.

Correction: The state and error covariance are corrected using the current measurement.

To filter each channel of the input:

Create the

`dsp.KalmanFilter`

object and set its properties.Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?

## Creation

### Syntax

### Description

returns the Kalman
filter System object, `kalman`

= dsp.KalmanFilter`kalman`

, with default values for the parameters.

returns a Kalman filter System object, `kalman`

= dsp.KalmanFilter(`STMatrix`

, `MMatrix`

, `PNCovariance`

,
`MNCovariance`

, `CIMatrix`

)`kalman`

. The `StateTransitionMatrix`

property is set to `STMatrix`

, the `MeasurementMatrix`

property is set to `MMatrix`

, the
`ProcessNoiseCovariance`

property is set to
`PNCovariance`

, the `MeasurementNoiseCovariance`

property is set to `MNCovariance`

, and the
`ControlInputMatrix`

property is set to
`CIMatrix`

.

returns an Kalman filter System object, `kalman`

= dsp.KalmanFilter(`Name,Value`

)`kalman`

, with each property set to the specified value.
Enclose each property name in single quotes. Unspecified properties have default
values.

## Properties

## Usage

### Description

`[`

carries out the iterative Kalman filter algorithm over measurements `zEst`

, `xEst`

, `MSE_Est`

, `zPred`

, `xPred`

, `MSE_Pred`

] = kalman(`z`

,`u`

)`z`

and control inputs `u`

. The columns in `z`

and
`u`

are treated as inputs to separate parallel filters, whose
correction (or update) step can be disabled by the `DisableCorrection`

property. The values returned are estimated measurements `zEst`

,
estimated states `xEst`

, MSE of estimated states
`MSE_Est`

, predicted measurements `zPred`

,
predicted states `xPred`

, and MSE of predicted states
`MSE_Pred`

.

### Input Arguments

### Output Arguments

## Object Functions

To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named `obj`

, use
this syntax:

release(obj)

## Examples

## Algorithms

This object implements the algorithm, inputs, and outputs described on the Kalman Filter block reference page. The object properties correspond to the block parameters.

## References

[1] Greg Welch and Gary Bishop, *An Introduction to the
Kalman Filter*, Technical Report TR95 041. University of North Carolina at Chapel
Hill: Chapel Hill, NC., 1995.

## Extended Capabilities

## Version History

**Introduced in R2013b**