# staticDetectionFuser

Static fusion of synchronous sensor detections

## Description

`staticDetectionFuser`

System object™ creates a static detection fuser object to fuse angle-only sensor
detections.

To obtain the fuser:

Create the

`staticDetectionFuser`

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

### Description

creates a
default three-sensor static detection fuser object to fuse angle-only sensor
detections.`fuser`

= staticDetectionFuser()

sets properties using one or more name-value pairs. For example, `fuser`

= staticDetectionFuser(`Name,Value`

)```
fuser =
staticDetectionFuser('FalseAlarmRate',1e-6,'MaxNumSensors',12)
```

creates a fuser
that has a maximum of 12 sensors and a false alarm rate of `1e-6`

.
Enclose each property name in quotes.

## Properties

Unless otherwise indicated, properties are *nontunable*, which means you cannot change their
values after calling the object. Objects lock when you call them, and the
`release`

function unlocks them.

If a property is *tunable*, you can change its value at
any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

`FuserSensorIndex`

— Sensor index of composite detections

`1`

(default) | positive integer

Sensor index of the composite detections reported by the fuser, specified as a
positive integer. This index becomes the `SensorIndex`

of
`objectDetection`

objects returned by the fuser.

**Example: **`5`

**Data Types: **`double`

`MeasurementFusionFcn`

— Function for fusing multiple sensor detections

`'triangulateLOS'`

(default) | char | string | function handle

Function for fusing multiple sensor detections, specified as a character vector, string, or function handle. The function fuses multiple detections into one and returns the fused measurement and measurement noise. Any fusing function combines at most one detection from each sensor. The syntax of the measurement fuser function is:

[fusedMeasurement,fusedMeasurementNoise] = MeasurementFusionFcn(detections)

`detections`

– cell array of`objectDetection`

measurements.`fusedMeasurement`

– an*N*-by-1 vector of fused measurements.`fusedMeasurementNoise`

– an*N*-by-*N*matrix of fused measurements noise.

The value of *N* depends on the
`MeasurementFormat`

property.

MeasurementFormat Property | N |

`'Position'` | 1, 2, and 3 |

`'Velocity` | 1, 2, and 3 |

`'PositionAndVelocity` | 2, 4, and 6 |

`'Custom'` | Any |

**Data Types: **`char`

| `string`

| `function_handle`

`MeasurementFormat`

— Format of the fused measurement

`'Position'`

(default) | `'Velocity'`

| `'PositionAndVelocity'`

| `'Custom'`

Format of the fused measurement, specified as `'Position'`

,
`'Velocity'`

, `'PositionAndVelocity'`

, or
`'Custom'`

. The formats are

`'Position'`

– the fused measurement is the position of the target in the global coordinate frame.`'Velocity'`

– the fused measurement is the velocity of the target in the global coordinate frame.`'PositionAndVelocity'`

– the fused measurement is the position and velocity of the target in the global coordinate frame defined according to the format`[x;vx;y;vy;z;vz]`

.`'Custom'`

– custom fused measurement. To enable this format, specify a function using the`MeasurementFcn`

.

**Example: **`'PositionAndVelocity'`

`MeasurementFcn`

— Custom measurement function

char | string | function handle

Custom measurement function, specified as a character vector, string, or function handle. Specify the function that transforms fused measurements into sensor measurements. The function must have the following signature:

sensorMeas = MeasurementFcn(fusedMeas,measParameters)

#### Dependencies

To enable this property, set the `MeasurementFormat`

property
to `'Custom'`

.

**Data Types: **`char`

| `string`

| `function_handle`

`MaxNumSensors`

— Maximum number of sensors in surveillance region

`3`

(default) | positive integer greater than one

Maximum number of sensors in surveillance region, specified as a positive integer greater than one.

**Data Types: **`double`

`Volume`

— Volume of sensor detection bin

`1e-2`

(default) | positive scalar | *N*-length vector of positive scalars

Volume of sensors detection bins, specified as a positive scalar or
*N*-length vector of positive scalars. *N* is the
number of sensors. If specified as a scalar, each sensor is assigned the same volume. If
a sensor produces an angle-only measurement, for example, azimuth and elevation, the
volume is defined as the solid angle subtended by one bin.

**Data Types: **`double`

`DetectionProbability`

— Probabilities of a target detection

`0.9`

(default) | positive scalar | *N*-length vector of positive scalars

Probability of detection of a target by each sensor, specified as a scalar or
*N*-length vector of positive scalars in the range (0,1).
*N* is the number of sensors. If specified as a scalar, each sensor
is assigned the same detection probability. The probability of detection is used in
calculating the cost of fusing a "one" (target was detected) or "zero" (target was not
detected) detections from each sensor.

**Example: **`0.99`

**Data Types: **`double`

`FalseAlarmRate`

— Rate of false positives generated by sensors

`1e-6`

(default) | positive scalar | *N*-length vector of positive scalars

Rate at which false positives are reported by sensor in each bin, specified as a
scalar or *N*-length vector of positive scalars. *N*
is the number of sensors. If specified as a scalar, each sensor is assigned the same
false alarm rate. The false alarm rate is used to calculate the likelihood of clutter in
the detections reported by each sensor.

**Example: **`1e-5`

**Data Types: **`double`

`UseParallel`

— Option to use parallel computing resources

`false`

(default) | `true`

Option to use parallel computing resources, specified as `false`

or
`true`

. The `staticDetectionFuser`

calculates the cost
of fusing detections from each sensor as an n-D assignment problem. The fuser spends
most of the time in computing the cost matrix for the assignment problem. If Parallel Computing Toolbox™ is installed, this option lets the fuser use the parallel pool of workers
to compute the cost matrix.

**Data Types: **`logical`

`TimeTolerance`

— Absolute tolerance between timestamps of detections

`1e-6`

(default) | nonnegative scalar

Absolute tolerance between timestamps of detections, specified as a nonnegative
scalar. The `staticDetectionFuser`

assumes that sensors are synchronous.
This property defines the allowed tolerance value between detection time-stamps to still
be considered synchronous.

**Example: **`1e-3`

**Data Types: **`double`

## Usage

### Description

returns the fused detections, `compositeDets`

= fuser(`dets`

)`compositeDets`

, of input detections,
`dets`

.

`[`

also returns analysis information, `compositeDets`

,`analysisInfo`

] = fuser(`dets`

)`analysisInfo`

.

### Input Arguments

`dets`

— Pre-fused detections

cell array of `objectDetection`

objects

Pre-fused detections, specified as a cell array of `objectDetection`

objects.

### Output Arguments

`compositeDets`

— Fused detections

cell array of `objectDetection`

objects

Pre-fused detections, returned as a cell array of `objectDetection`

objects.

`analysisInfo`

— Analysis information

structure

Analysis information, returned as a structure. The fields of the structure are:

`CostMatrix`

–*N*-dimensional cost matrix providing the cost of association of detections, where*N*is the number of sensors. The cost is the negative log-likelihood of the association and can be interpreted as the negative score of the track that will be generated by the fused measurement.`Assignments`

– A*P*-by-*N*list of assignments, where*P*is the number of composite detections.`FalseAlarms`

– A*Q*-by-1 list of indices of detections declared as false alarms by association.

**Data Types: **`struct`

## 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

### Fuse Detections from ESM Sensors

Fuse angle-only detections from three ESM sensors.

Load stored detections from the sensors.

load('angleOnlyDetectionFusion.mat','detections');

Visualize angle-only detections for plotting the direction vector.

rPlot = 5000; plotData = zeros(3,numel(detections)*3); for i = 1:numel(detections) az = detections{i}.Measurement(1); el = detections{i}.Measurement(2); [xt,yt,zt] = sph2cart(deg2rad(az),deg2rad(el),rPlot); % The sensor is co-located at platform center, therefore use % the position from the second measurement parameter originPos = detections{i}.MeasurementParameters(2).OriginPosition; positionData(:,i) = originPos(:); plotData(:,3*i-2) = [xt;yt;zt] + originPos(:); plotData(:,3*i-1) = originPos(:); plotData(:,3*i) = [NaN;NaN;NaN]; end plot3(plotData(1,:),plotData(2,:),plotData(3,:),'r-') hold on plot3(positionData(1,:),positionData(2,:),positionData(3,:),'o','MarkerSize',12,'MarkerFaceColor','g')

Create a `staticDetectionFuser`

to fuse angle-only detections using the measurement fusion function `triangulateLOS`

.

fuser = staticDetectionFuser('MeasurementFusionFcn','triangulateLOS','MaxNumSensors',3)

fuser = staticDetectionFuser with properties: FusedSensorIndex: 1 MeasurementFusionFcn: 'triangulateLOS' MeasurementFormat: 'Position' MaxNumSensors: 3 Volume: [3x1 double] DetectionProbability: [3x1 double] FalseAlarmRate: [3x1 double] TimeTolerance: 1.0000e-06 UseParallel: false

Create the fused detections and obtain the analysis information.

[fusedDetections, analysisInfo] = fuser(detections); fusedPositions = zeros(3,numel(fusedDetections)); for i = 1:numel(fusedDetections) fusedPositions(:,i) = fusedDetections{i}.Measurement; end plot3(fusedPositions(1,:),fusedPositions(2,:),fusedPositions(3,:),'ko', ... 'MarkerSize',12, 'MarkerFaceColor','k') legend('Angle-only Detections','Sensor Positions','Fused Target Measurements') title('Angle-only Detection Fusion') xlabel('x [m]') ylabel('y [m]') view(2)

Use the `analysisInfo`

output to check the assignments.

analysisInfo.Assignments

`ans = `*6x3 uint32 matrix*
0 10 14
1 6 11
2 7 12
3 8 13
4 9 0
5 0 15

## Algorithms

### Detection Fusion Workflow

The static detection fuser:

Calculates the cost of fusing or matching detections from each sensor to one another.

Solves a 2-D or

*S*-D assignment problem, where*S*is the number of sensors, to associate or match detections from one sensor to others.Fuses the measurement and measurement covariance of the associated detection n-tuples to generate a list of composite or fused detections.

Declares unassigned detections from each sensor as false alarms.

The `staticDetectionFuser`

assumes that all sensors are
synchronous and generate detections simultaneously. The
`staticDetectionFuser`

also assumes that the sensors share a common
surveillance region. Associating *n* detections from *m*
sensors indicates *m* - *n* missed detections or false
alarms.

## References

[1] Bar-Shalom, Yaakov, Peter K.
Willett, and Xin Tian. *Tracking and data fusion*. Storrs, CT, USA:: YBS
publishing, 2011.

## Extended Capabilities

### C/C++ Code Generation

Generate C and C++ code using MATLAB® Coder™.

Usage notes and limitations:

See System Objects in MATLAB Code Generation (MATLAB Coder).

## Version History

**Introduced in R2018b**

## Open Example

You have a modified version of this example. Do you want to open this example with your edits?

## MATLAB Command

You clicked a link that corresponds to this MATLAB command:

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

# Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)