Main Content


Create constant acceleration ggiwphd filter


phd = initcaggiwphd initializes a constant acceleration ggiwphd filter with no zeros components in the filter. By default, the data type of the filter is double.


phd = initcaggiwphd(detections) initializes a constant acceleration ggiwphd filter based on information provided in object detections, detections. The data type of the filter is the same as the data type of measurement in the detections.

The function initializes a constant acceleration state with the same convention as constacc and cameas, [x vx ax y vy ay z vz az].


This initialization function is not compatible with trackerGNN, trackerJPDA, and trackerTOMHT system objects.

phd = initcaggiwphd(___,dataType) specifies the data type of the filter as single or double.


collapse all

Consider an object located at position [1;2;3] with detections uniformly spread around its extent. The size of the extent is 1.2, 2.3 and 3.5 in x, y and z directions, respectively.

detections = cell(20,1);
location = [1;2;3];
dimensions = [1.2;2.3;3.5];
rng(2018) % Reproducible results
measurements = location + dimensions.*(-1 + 2*rand(3,20));
for i = 1:20
    detections{i} = objectDetection(0,measurements(:,i));

Initialize a constant acceleration ggiwphd filter with the generated detections.

phd = initcaggiwphd(detections);

Check the filter has the same position estimates as the mean of measurements.

states = phd.States
states = 9×1


measurementMean = mean(measurements,2)
measurementMean = 3×1


Check the extent and expected number of detections.

extent = phd.ScaleMatrices/(phd.DegreesOfFreedom - 4)
extent = 3×3

    1.4603    0.0885   -0.2403
    0.0885    3.0050   -0.0225
   -0.2403   -0.0225    4.8365

expDetections = phd.Shapes/phd.Rates
expDetections = 20

Input Arguments

collapse all

Object detections, specified as a cell array of objectDetection objects. You can create detections directly, or you can obtain detections from the outputs of sensor objects, such as radarSensor, monostaticRadarSensor, irSensor, and sonarSensor.

Example: detection = objectDetection(0,[1;4.5;3],'MeasurementNoise', [1.0 0 0; 0 2.0 0; 0 0 1.5])

Data type of variables used in the filter, specified as "single" for single-precision or "Double" for double-precision. When specified as "single", the initialized filter does not produce any double-precision output and may use some double variables during intermediate steps.

Data Types: single | double

Output Arguments

collapse all

ggiwphd filter, returned as a ggiwphd object.


  • You can use initcaggiwphd as the FilterInitializationFcn property of trackingSensorConfiguration.

  • When detections are provided as input, the function adds one component to the density which reflects the mean of the detections. When the function is called without any inputs, a filter is initialized with no components in the density.

  • The function uses the spread of measurements to describe the Inverse-Wishart distribution.

  • The function uses the number of detections to describe the Gamma distribution.

  • The function configures the process noise of the filter by assuming a unit standard deviation for the acceleration change rate.

  • The function specifies a maximum of 500 components in the filter.

Extended Capabilities

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

Version History

Introduced in R2019a

expand all