Constant false alarm rate (CFAR) detector
CFARDetector object implements a one-dimensional
constant false-alarm rate (CFAR) detector. Detection processing is
performed on selected elements (called cells) of the input data. A
detection is declared when an image cell value exceeds a threshold.
To maintain a constant false alarm-rate, the threshold is set to a
multiple of the image noise power. The detector estimates noise power
for a cell-under-test (CUT) from surrounding
cells using one of three cell averaging methods, or an order statistics
method. The cell-averaging methods are cell averaging (CA), greatest-of
cell averaging (GOCA), or smallest-of cell averaging (SOCA).
For each test cell, the detector:
estimates the noise statistic from the cell values in the training band surrounding the CUT cell.
computes the threshold by multiplying the noise estimate by the threshold factor.
compares the CUT cell value to the threshold to determine whether a target is present or absent. If the value is greater than the threshold, a target is present.
To run the detector
Define and set up your CFAR detector. See Construction.
step to perform CFAR detection
according to the properties of
The behavior of
step is specific to each object in
Starting in R2016b, instead of using the
H = phased.CFARDetector creates a CFAR
detector System object,
H. The object performs
CFAR detection on input data.
H = phased.CFARDetector( creates
H, with each specified property
Name set to the specified Value. You can specify additional name-value
pair arguments in any order as (
Specify the CFAR detector algorithm as one of
Rank of order statistic
Specify the rank of the order statistic as a positive integer
scalar. The value must be less than or equal to the value of the
Number of guard cells
Specify the number of guard cells used in training as an even integer. This property specifies the total number of cells on both sides of the cell under test.
Number of training cells
Specify the number of training cells used in training as an even integer. Whenever possible, the training cells are equally divided before and after the cell under test.
Methods of obtaining threshold factor
Specify whether the threshold factor comes from an automatic
Desired probability of false alarm
Specify the desired probability of false alarm as a scalar between
0 and 1 (not inclusive). This property applies only when you set the
Custom threshold factor
Specify the custom threshold factor as a positive scalar. This
property applies only when you set the
Format of detection results
Format of detection results returned by the
Output detection threshold
To obtain the detection threshold, set this property to
Output estimated noise
To obtain the estimated noise, set this property to
|step||Perform CFAR detection|
|Common to All System Objects|
Create System object with same property values
Expected number of inputs to a System object
Expected number of outputs of a System object
Check locked states of a System object (logical)
Allow System object property value changes
Perform cell-averaging CFAR detection on a given Gaussian noise vector with a desired probability of false alarm (pfa) of 0.1. Assume that the data comes from a square law detector and no pulse integration is performed. Use 50 cells to estimate the noise level and 1 cell to separate the test cell and training cells. Perform the detection on all cells of the input.
detector = phased.CFARDetector('NumTrainingCells',50,... 'NumGuardCells',2,'ProbabilityFalseAlarm',0.1); N = 1000; x = 1/sqrt(2)*(randn(N,1) + 1i*randn(N,1)); dets = detector(abs(x).^2,1:N); pfa = sum(dets)/N
pfa = 0.1140
Perform cell-averaging CFAR detection on a given Gaussian noise vector with a desired probability of false alarm (pfa) of 0.005. Assume that the data comes from a square law detector and no pulse integration is performed. Perform the detection on all cells of the input. Use 50 cells to estimate the noise level and 1 cell to separate the test cell and training cells. Display the detection indices.
rng default; detector = phased.CFARDetector('NumTrainingCells',50,'NumGuardCells',2, ... 'ProbabilityFalseAlarm',0.005,'OutputFormat','Detection index'); N = 1000; x1 = 1/sqrt(2)*(randn(N,1) + 1i*randn(N,1)); x2 = 1/sqrt(2)*(randn(N,1) + 1i*randn(N,1)); x = [x1,x2]; cutidx = 1:N; dets = detector(abs(x).^2,cutidx)
dets = 339 537 538 734 786 827 979 136 418 539 874 1 1 1 1 1 1 1 2 2 2 2
phased.CFARDetector uses cell averaging in
Identify the training cells from the input, and form
the noise estimate. The next table indicates how the detector forms
the noise estimate, depending on the
|Use the average of the values in all the training cells.|
|Select the greater of the averages in the front training cells and rear training cells.|
|Sort the values in the training cells in ascending order. Select
the Nth item, where N is the
value of the |
|Select the smaller of the averages in the front training cells and rear training cells.|
Multiply the noise estimate by the threshold factor to form the threshold.
Compare the value in the test cell against the threshold to determine whether the target is present or absent. If the value is greater than the threshold, the target is present.
For further details, see .
 Richards, M. A. Fundamentals of Radar Signal Processing. New York: McGraw-Hill, 2005.
Usage notes and limitations:
See System Objects in MATLAB Code Generation (MATLAB Coder).