Main Content

trackingABF

Alpha-beta filter for object tracking

Since R2020a

Description

The trackingABF object represents an alpha-beta filter designed for object tracking for an object that follows a linear motion model and has a linear measurement model. Linear motion is defined by constant velocity or constant acceleration. Use the filter to predict the future location of an object, to reduce noise for a detected location, or to help associate multiple objects with their tracks.

Creation

Description

abf = trackingABF returns an alpha-beta filter for a discrete time, 2-D constant velocity system. The motion model is named '2D Constant Velocity' with the state defined as [x; vx; y; vy].

abf = trackingABF(Name,Value) specifies the properties of the filter using one or more Name,Value pair arguments. Any unspecified properties take default values.

example

Properties

expand all

Model of target motion, specified as a character vector or string. Specifying 1D, 2D, or 3D specifies the dimension of the target's motion. Specifying Constant Velocity assumes that the target motion is a constant velocity at each simulation step. Specifying Constant Acceleration assumes that the target motion is a constant acceleration at each simulation step.

Data Types: char | string

Filter state, specified as a real-valued M-element vector. A scalar input is extended to an M-element vector. The state vector is the concatenated states from each dimension. For example, if MotionModel is set to '3D Constant Acceleration', the state vector is in the form:[x; x'; x''; y; y'; y''; z; z'; z''] where ' and '' indicate first and second order derivatives, respectively.

If you want a filter with single-precision floating-point variables, specify State as a single-precision vector variable. For example,

filter = trackingABF('State',single([1;2;3;4]))

Example: [200;0.2;150;0.1;0;0.25]

Data Types: single | double

State error covariance, specified as an M-by-M matrix, where M is the size of the filter state. A scalar input is extended to an M-by-M matrix. The covariance matrix represents the uncertainty in the filter state.

Example: eye(6)

Process noise covariance, specified as a scalar or a D-by-D matrix, where D is the dimensionality of motion. For example, if MotionModel is '2D Constant Velocity', then D = 2. A scalar input is extended to a D-by-D matrix.

Example: [20 0.1; 0.1 1]

Measurement noise covariance, specified as a scalar or a D-by-D matrix, where D is the dimensionality of motion. For example, if MotionModel is '2D Constant Velocity', then D = 2. A scalar input is extended to a M-by-M matrix.

Example: [20 0.1; 0.1 1]

Alpha-beta filter coefficients, specified as a scalar or row vector. A scalar input is extended to a row vector. If you specify constant velocity in the MotionModel property, the coefficients are [alpha beta]. If you specify constant acceleration in the MotionModel property, the coefficients are [alpha beta gamma].

Example: [20 0.1]

Enable state smoothing, specified as false or true. Setting this property to true requires the Sensor Fusion and Tracking Toolbox™ license. When specified as true, you can:

  • Use the smooth (Sensor Fusion and Tracking Toolbox) function, provided in Sensor Fusion and Tracking Toolbox, to smooth state estimates of the previous steps. Internally, the filter stores the results from previous steps to allow backward smoothing.

  • Specify the maximum number of smoothing steps using the MaxNumSmoothingSteps property of the tracking filter.

Maximum number of backward smoothing steps, specified as a positive integer.

Dependencies

To enable this property, set the EnableSmoothing property to true.

Object Functions

predictPredict state and state estimation error covariance of tracking filter
correctCorrect state and state estimation error covariance using tracking filter
correctjpdaCorrect state and state estimation error covariance using tracking filter and JPDA
distanceDistances between current and predicted measurements of tracking filter
likelihoodLikelihood of measurement from tracking filter
cloneCreate duplicate tracking filter

Examples

collapse all

This example shows how to create and run a trackingABF filter. Call the predict and correct functions to track an object and correct the state estimation based on measurements.

Create the filter. Specify the initial state.

state = [1;2;3;4];
abf = trackingABF('State',state);

Call predict to get the predicted state and covariance of the filter. Use a 0.5 sec time step.

[xPred,pPred] = predict(abf, 0.5);

Call correct with a given measurement.

meas = [1;1];
[xCorr,pCorr] = correct(abf, meas);

Continue to predict the filter state. Specify the desired time step in seconds if necessary.

[xPred,pPred] = predict(abf);         % Predict over 1 second
[xPred,pPred] = predict(abf,2);       % Predict over 2 seconds

Modify the filter coefficients and correct again with a new measurement.

abf.Coefficients = [0.4 0.2];
[xCorr,pCorr] = correct(abf,[8;14]);

References

[1] Blackman, Samuel S. "Multiple-target tracking with radar applications." Dedham, MA, Artech House, Inc., 1986, 463 p. (1986).

[2] Bar-Shalom, Yaakov, X. Rong Li, and Thiagalingam Kirubarajan. Estimation with applications to tracking and navigation: theory algorithms and software. John Wiley & Sons, 2004.

Extended Capabilities

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

Version History

Introduced in R2020a