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.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

**System object: **phased.CFARDetector

**Package: **phased

Perform CFAR detection

`Y = step(H,X,cutidx)`

[Y,th] = step(___)

[Y,noise] = step(___)

Y = step(H,X,cutidx,thfac)

[Y,TH,N]
= step(H,X,cutidx,thfac)

Starting in R2016b, instead of using the `step`

method
to perform the operation defined by the System
object™, you can
call the object with arguments, as if it were a function. For example, ```
y
= step(obj,x)
```

and `y = obj(x)`

perform
equivalent operations.

`Y = step(H,X,cutidx)`

performs CFAR detection on specified elements of the
input data, `X`

. `X`

can either be a real-valued
*M*-by-1 column vector or a real-valued
*M*-by-*N* matrix. `cutidx`

is a
length-*D* vector of indices specifying the input elements or cells under test
(CUT) on which to perform detection processing. When `X`

is a vector,
`cutidx`

specifies the element. When `X`

is a matrix,
`cutidx`

specifies the row of the element. The same index applies to all
columns of the matrix. Detection is performed independently along each column of
`X`

for the indices specified in `cutidx`

. You can
specify the input arguments as single or double precision.

The output argument `Y`

contains detection results. The format of
`Y`

depends on the `OutputFormat`

property.

When

`OutputFormat`

is`'Cut result'`

,`Y`

is a*D*-by-1 vector or a*D*-by-*N*matrix containing logical detection results.*D*is the length of`cutidx`

and*N*is the number of columns of`X`

. The rows of`Y`

correspond to the rows in`cutidx`

. For each row,`Y`

contains`1`

in a column if there is a detection in the corresponding column of`X`

. Otherwise,`Y`

contains a`0`

.When

`OutputFormat`

is`'Detection report'`

,`Y`

is a*1*-by-*L*vector or a 2-by-*L*matrix containing detections indices.*L*is the number of detections found in the input data. When`X`

is a column vector,`Y`

contains the index for each detection in`X`

. When`X`

is a matrix,`Y`

contains the row and column indices of each detection in`X`

. Each column of`Y`

has the form`[detrow;detcol]`

. When the`NumDetectionsSource`

property is set to`'Property'`

,*L*equals the value of the`NumDetections`

property. If the number of actual detections is less than this value, columns without detections are set to`NaN`

.

The size of the first dimension of the input matrix can vary to simulate a changing signal length. A size change can occur, for example, in the case of a pulse waveform with variable pulse repetition frequency.

`[Y,th] = step(___)`

also returns
the detection threshold, `th`

, applied to detected
cells under test.

When

`OutputFormat`

is`'CUT result'`

,`th`

returns the detection threshold whenever an element of`Y`

is`1`

and`NaN`

whenever an element of`Y`

is`0`

.`th`

has the same size as`Y`

.When

`OutputFormat`

is`'Detection index'`

,`th`

returns a detection threshold for each corresponding detection in`Y`

. When the`NumDetectionsSource`

property is set to`'Property'`

,*L*equals the value of the`NumDetections`

property. If the number of actual detections is less than this value, columns without detections are set to`NaN`

.

To enable this syntax, set the `ThresholdOutputPort`

property
to `true`

.

`[Y,noise] = step(___)`

also
returns the estimated noise power, `noise`

, for
each detected cell under test in `X`

.

When

`OutputFormat`

is`'CUT result'`

,`noise`

returns a noise power estimate when`Y`

is`1`

and`NaN`

whenever`Y`

is zero.`noise`

has the same size as`Y`

.When

`OutputFormat`

is`'Detection index'`

,`noise`

returns a noise power estimate for each corresponding detection in`Y`

. When the`NumDetectionsSource`

property is set to`'Property'`

,*L*equals the value of the`NumDetections`

property. If the number of actual detections is less than this value, columns without detections are set to`NaN`

.

To enable this syntax, set the `NoisePowerOutputPort`

property
to `true`

.

`Y = step(H,X,cutidx,thfac)`

, in addition,
specifies `thfac`

as the threshold factor used
to calculate the detection threshold. `thfac`

must
be a positive scalar. To enable this syntax, set the `ThresholdFactor`

property
to `'Input port'`

.

You can combine optional input and output arguments when their
enabling properties are set. Optional inputs and outputs must be listed
in the same order as the order of the enabling properties. For example, ```
[Y,TH,N]
= step(H,X,cutidx,thfac)
```

.

The object performs an initialization the first time the object is executed. This
initialization locks nontunable properties (MATLAB)
and input specifications, such as dimensions, complexity, and data type of the input data.
If you change a nontunable property or an input specification, the System
object issues an error. To change nontunable properties or inputs, you must first
call the `release`

method to unlock the object.

`phased.CFARDetector`

uses cell averaging in
three steps:

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

`Method`

property value.Method Noise Estimate `'CA'`

Use the average of the values in all the training cells. `'GOCA'`

Select the greater of the averages in the front training cells and rear training cells. `'OS'`

Sort the values in the training cells in ascending order. Select the *N*th item, where*N*is the value of the`Rank`

property.`'SOCA'`

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 details, see [1].

[1] Richards, M. A. *Fundamentals
of Radar Signal Processing*. New York: McGraw-Hill, 2005.