This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

trackingUKF class

Unscented Kalman filter

Description

The trackingUKF class creates a discrete-time unscented Kalman filter used for tracking positions and velocities of target platforms. An unscented Kalman filter is a recursive algorithm for estimating the evolving state of a process when measurements are made on the process. The unscented Kalman filter can model the evolution of a state that obeys a nonlinear motion model. The measurements can also be nonlinear functions of the state. In addition, the process and the measurements can have noise. Use an unscented Kalman filter when the current state is a nonlinear function of the previous state or when the measurements are nonlinear functions of the state or when both conditions apply. The unscented Kalman filter estimates the uncertainty about the state, and its propagation through the nonlinear state and measurement equations, using a fixed number of sigma points. Sigma points are chosen using the unscented transformation as parameterized by the Alpha, Beta, and Kappa properties.

Construction

filter = trackingUKF creates an unscented Kalman filter object for a discrete-time system using default values for the StateTransitionFcn, MeasurementFcn, and State properties. The process and measurement noises are assumed to be additive.

filter = trackingUKF(transitionfcn,measurementfcn,state) specifies the state transition function, transitionfcn, the measurement function, measurementfcn, and the initial state of the system, state.

filter = trackingUKF(___,Name,Value) configures the properties of the unscented Kalman filter object using one or more Name,Value pair arguments. Any unspecified properties have default values.

Properties

expand all

Kalman filter state, specified as a real-valued M-element vector.

Example: [200;0.2]

Data Types: double

State error covariance, specified as a positive-definite real-valued M-by-M matrix where M is the size of the filter state. The covariance matrix represents the uncertainty in the filter state.

Example: [20 0.1; 0.1 1]

State transition function, specified as a function handle. This function calculates the state vector at time step k from the state vector at time step k–1. The function can take additional input parameters, such as control inputs or time step size. The function can also include noise values.

  • If HasAdditiveProcessNoise is true, specify the function using one of these syntaxes:

    x(k) = transitionfcn(x(k-1))
    
    x(k) = transitionfcn(x(k-1),parameters)
    where x(k) is the state at time k. The parameters term stands for all additional arguments required by the state transition function.

  • If HasAdditiveProcessNoise is false, specify the function using one of these syntaxes:

    x(k) = transitionfcn(x(k-1),w(k-1))
    
    x(k) = transitionfcn(x(k-1),w(k-1),parameters)
    where x(k) is the state at time k and w(k) is a value for the process noise at time k. The parameters argument stands for all additional arguments required by the state transition function.

Example: @constacc

Data Types: function_handle

Process noise covariance:

  • When HasAdditiveProcessNoise is true, specify the process noise covariance as a scalar or a positive definite real-valued M-by-M matrix. M is the dimension of the state vector. When specified as a scalar, the matrix is a multiple of the M-by-M identity matrix.

  • When HasAdditiveProcessNoise is false, specify the process noise covariance as an Q-by-Q matrix. Q is the size of the process noise vector.

    You must specify ProcessNoise before any call to the predict method. In later calls to predict, you can optionally specify the process noise as a scalar. In this case, the process noise matrix is a multiple of the Q-by-Q identity matrix.

Example: [1.0 0.05; 0.05 2]

Option to model processes noise as additive, specified as true or false. When this property is true, process noise is added to the state vector. Otherwise, noise is incorporated into the state transition function.

Measurement model function, specified as a function handle. This function can be a nonlinear function that models measurements from the predicted state. Input to the function is the M-element state vector. The output is the N-element measurement vector. The function can take additional input arguments, such as sensor position and orientation.

  • If HasAdditiveMeasurementNoise is true, specify the function using one of these syntaxes:

    z(k) = measurementfcn(x(k))
    
    z(k) = measurementfcn(x(k),parameters)
    where x(k) is the state at time k and z(k) is the predicted measurement at time k. The parameters term stands for all additional arguments required by the measurement function.

  • If HasAdditiveMeasurementNoise is false, specify the function using one of these syntaxes:

    z(k) = measurementfcn(x(k),v(k))
    
    z(k) = measurementfcn(x(k),v(k),parameters)
    where x(k) is the state at time k and v(k) is the measurement noise at time k. The parameters argument stands for all additional arguments required by the measurement function.

Example: @cameas

Data Types: function_handle

Measurement noise covariance, specified as a positive scalar or positive-definite real-valued matrix.

  • When HasAdditiveMeasurementNoise is true, specify the measurement noise covariance as a scalar or an N-by-N matrix. N is the size of the measurement vector. When specified as a scalar, the matrix is a multiple of the N-by-N identity matrix.

  • When HasAdditiveMeasurementNoise is false, specify the measurement noise covariance as an R-by-R matrix. R is the size of the measurement noise vector.

    You must specify MeasurementNoise before any call to the correct method. After the first call to correct, you can optionally specify the measurement noise as a scalar. In this case, the measurement noise matrix is a multiple of the R-by-R identity matrix.

Example: 0.2

Option to enable additive measurement noise, specified as true or false. When this property is true, noise is added to the measurement. Otherwise, noise is incorporated into the measurement function.

Sigma point spread around state, specified as a positive scalar greater than zero and less than or equal to one.

Distribution of sigma points, specified as a nonnegative scalar. This parameter incorporates knowledge of the noise distribution of states for generating sigma points. For Gaussian distributions, setting Beta to 2 is optimal.

Secondary scaling factor for generation of sigma points, specified as a scalar from 0 to 3. This parameter helps specify the generation of sigma points.

Methods

cloneCreate unscented Kalman filter object with identical property values
correctCorrect Kalman state vector and state error covariance matrix
correctjpdaCorrect state and state estimation error covariance using JPDA
distanceDistance from measurements to predicted measurement
initializeInitialize unscented Kalman filter
likelihoodMeasurement likelihood
predict Predict unscented Kalman state vector and state error covariance matrix
residualMeasurement residual and residual covariance

Examples

collapse all

Create a trackingUKF object using the predefined constant-velocity motion model, constvel, and the associated measurement model, cvmeas. These models assume that the state vector has the form [x;vx;y;vy] and that the position measurement is in Cartesian coordinates, [x;y;z]. Set the sigma point spread property to 1e-2.

filter = trackingUKF(@constvel,@cvmeas,[0;0;0;0],'Alpha',1e-2);

Run the filter. Use the predict and correct methods to propagate the state. You can call predict and correct in any order and as many times as you want.

meas = [1;1;0]; 
[xpred, Ppred] = predict(filter);
[xcorr, Pcorr] = correct(filter,meas);
[xpred, Ppred] = predict(filter);
[xpred, Ppred] = predict(filter)
xpred = 4×1

    1.2500
    0.2500
    1.2500
    0.2500

Ppred = 4×4

   11.7500    4.7500   -0.0000    0.0000
    4.7500    3.7500   -0.0000    0.0000
   -0.0000   -0.0000   11.7500    4.7500
    0.0000    0.0000    4.7500    3.7500

More About

expand all

Algorithms

The unscented Kalman filter estimates the state of a process governed by a nonlinear stochastic equation

xk+1=f(xk,uk,wk,t)

where xk is the state at step k. f() is the state transition function, uk are the controls on the process. The motion may be affected by random noise perturbations, wk. The filter also supports a simplified form,

xk+1=f(xk,uk,t)+wk

To use the simplified form, set HasAdditiveProcessNoise to true.

In the unscented Kalman filter, the measurements are also general functions of the state,

zk=h(xk,vk,t)

where h(xk,vk,t) is the measurement function that determines the measurements as functions of the state. Typical measurements are position and velocity or some function of these. The measurements can include noise as well, represented by vk. Again the class offers a simpler formulation

zk=h(xk,t)+vk

To use the simplified form, set HasAdditiveMeasurmentNoise to true.

These equations represent the actual motion of the object and the actual measurements. However, the noise contribution at each step is unknown and cannot be modeled exactly. Only statistical properties of the noise are known.

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.” Transactions of the ASME–Journal of Basic Engineering, Vol. 82, Series D, March 1960, pp. 35–45.

[3] Wan, Eric A. and R. van der Merwe. “The Unscented Kalman Filter for Nonlinear Estimation”. Adaptive Systems for Signal Processing, Communications, and Control. AS-SPCC, IEEE, 2000, pp.153–158.

[4] Wan, Merle. “The Unscented Kalman Filter.” In Kalman Filtering and Neural Networks, edited by Simon Haykin. John Wiley & Sons, Inc., 2001.

[5] Sarkka S. “Recursive Bayesian Inference on Stochastic Differential Equations.” Doctoral Dissertation. Helsinki University of Technology, Finland. 2006.

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

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2018b