EngeePhased.CFARDetector
|
Page in progress. |
A detector with a constant false alarm level (PULT) for one-dimensional signals.
| Library |
|
| Block |
Description
System object EngeePhased.CFARDetector simulates a detector with a constant false alarm level (PULT) for one-dimensional signals.
The input signal sequence is divided into intervals (called cells). Detection is registered when the cell value in the input data exceeds the threshold value. To maintain a constant false alarm rate, the threshold value is set to a multiple of the noise power of the input data.
The detector evaluates the noise power from neighboring cells surrounding the tested cell (cell-under-test, CUT) using one of three cell averaging methods or the ordinal statistics method. Cell averaging methods: cell averaging (CA), largest cell value averaging (GOCA) or smallest cell value averaging (SOCA).
For more information about CFAR detectors, see [1].
For each tested cell, the detector:
-
Evaluates noise statistics based on cell values in the training band surrounding the test cell.
-
Calculates the threshold value by multiplying the noise estimate by the threshold factor.
-
Compares the value of the cell under test with a threshold value to determine the presence or absence of a target. If the value is greater than the threshold, then the goal is present.
To create and use a detector with a POOL, follow these steps:
-
Create an object EngeePhased.CFARDetector and set its properties.
-
Call the object with arguments as if it were a function.
To learn more about how to work with system objects, see Engee System Objects.
Syntax
Creation
-
detector = EngeePhased.CFARDetector()— creates a detector object with a POOL with default property values. -
detector = EngeePhased.CFARDetector(Name=Value)— creates a detector object with a POOL with the specified properties as a pairName=Value, whereName— the name of the property, andValue— the appropriate value. You can specify multiple pairs «name-value» the order of the pairs does not matter. Unspecified properties retain their default values.detector=EngeePhased.CFARDetector(Method="OS", ThresholdFactor="Custom", Rank=2)
Using
-
Y = detector(X,cutidx)— performs detection with a POOL in the input data X for the tested cells cutidx. The output argument Y contains the detection results for the cells being tested. -
Y,th = detector(_)— also returns the detection threshold th applied to the detected test cells. To use this syntax, set the ThresholdOutputPort valuetrue. -
Y,noise = detector(_)— also returns an estimate of the noise power noise for each detected test cell in the argument X. To use this syntax, set the NoisePowerOutputPort valuetrue. -
_ = detector(X,cutidx,thfac)— also uses the threshold coefficient thfac to calculate the detection threshold. To use this syntax, set the ThresholdFactor value"Input port".
Arguments
Input arguments
X — input signal
+
the real vector is a column M by 1 | the real matrix M by N
Details
The input signal, specified as a real vector on or a real matrix on .
| Типы данных |
|
cutidx — indexes of the tested cells
+
a vector of length D consisting of positive integers
Details
Indexes of the cells under test, specified as a vector of positive integers of length , where — the number of cells being tested.
-
If the argument X is a vector, the argument cutidx points to an element.
-
If the argument X is a matrix, the argument cutidx points to a row of the matrix.
The same index is applied to all columns of the matrix. Detection is performed independently for each column X for the indexes specified in cutidx.
| Типы данных |
|
thfac — detection threshold coefficient
+
positive scalar
Details
The threshold coefficient used to calculate the detection threshold, set as a positive scalar.
Dependencies
To use this input argument, set the property CustomThresholdFactor of the detector object to "Input port".
| Типы данных |
|
Output arguments
Y is the detector output
+
the logical matrix D by N | The logical matrix is 2 by L
Details
The format of the detector output data depends on the property OutputFormat:
-
If for a property OutputFormat value set
"Cut result", the argument Y is a vector on or the matrix on , containing the logical detection results. Meaning is the length of the cutidx argument, and — the number of columns of the argument X. The lines of the Y argument correspond to the lines in the cutidx argument. For each line of the argument, Y contains the value1in the column, if there is a detection in the corresponding column of the argument X. Otherwise, the Y argument contains the values0. -
If for a property OutputFormat value set
"Detection index", the argument Y is a vector on or the matrix on , containing detection indexes. Meaning is the number of detections found in the input data. If the argument X is a column vector, then the argument Y contains the index of each detection in the argument X. If the argument X is a matrix, then the argument Y contains the row and column indexes of each detection in the argument X. Each column of the Y argument has the form[detrow;detcol]. If the property NumDetectionsSource is set to"Property", is equal to the value of the NumDetections property. If the number of actual detections is less than this value, then the non-detections columns are set toNaN.
The size of the first dimension of the input matrix can be changed to simulate a change in the length of the signal. A change in size can occur, for example, in the case of a pulse waveform with a variable pulse repetition rate.
| Типы данных |
|
th — calculated detection threshold
+
the real matrix
Details
The calculated detection threshold for each detected cell, returned as a real matrix. The data on the th port has the same dimension as Y.
-
If for a property OutputFormat value set
"CUT result", the argument th returns the detection threshold when the argument Y is1, andNaNwhen the argument Y is equal to0. -
If for a property OutputFormat value set
"Detection index", the th argument returns the detection threshold for each corresponding detection in Y. If the property NumDetectionsSource is set to"Property", is equal to the value of the NumDetections property. If the number of actual detections is less than this value, columns without detections are set toNaN.
Dependencies
To enable this output argument, set the ThresholdOutputPort value true.
| Типы данных |
|
noise — noise power assessment
+
the real matrix
Details
An estimate of the noise power for each detected cell, returned as a real matrix. The noise has the same dimensions as the argument Y.
-
If for a property OutputFormat value set
"CUT result", the noise argument returns the noise power when the Y argument is1, andNaNwhen the argument Y is equal to0. -
If for a property OutputFormat value set
"Detection index", the noise argument returns the noise power for each corresponding detection in Y. If the property NumDetectionsSource is set to"Property", is equal to the value of the NumDetections property. If the number of actual detections is less than this value, columns without detections are set toNaN.
Dependencies
To enable this output argument, set the NoisePowerOutputPort value true.
| Типы данных |
|
Features
#
NumTrainingCells —
number of training cells
Integer
Details
An even integer number of training cells used in training. If possible, the training cells are divided equally before and after the test cell.
Default value 2 indicates the presence of one training cell both in front and behind the test cell.
#
Method —
The POOL averaging method
String
Details
The POOL averaging method specified by one of the following values: "CA" (by default), "GOCA", "SOCA" or "OS".
For values "CA", "GOCA", "SOCA" The noise power is the average value of the samples obtained from the training band.
For the value "OS" The noise power is is the cell value obtained as a result of numerical ordering of all the values of the training cells. Install using the Rank.
| The averaging method | Description |
|---|---|
|
Calculates the sample average of all the training cells surrounding the test cell. |
|
Divides the two-dimensional learning window surrounding the test cell into left and right halves. The algorithm then calculates the average of the samples for each half and selects the largest average. |
|
Divides the two-dimensional learning window surrounding the test cell into left and right halves. The algorithm then calculates the average of the samples for each half and selects the smallest average. |
|
Sorts the training cells in ascending order of numerical values. The algorithm then selects the kth value from the list. k is the rank specified by the Rank property. |
#
NoisePowerOutputPort —
enabling noise output power estimation
Logical
Details
Switching on the noise output power, set as false (by default) or true.
To get a noise estimate, set the NoisePowerOutputPort property to true and use the output argument noise when calling the object function.
#
ProbabilityFalseAlarm —
required probability of false alarm
Real number
Details
The required probability of a false alarm, given as a real positive scalar in the range of 0 before 1.
The algorithm calculates the threshold coefficient from the required false alarm probability.
Default value — 0.001.
Dependencies
To use this property, set the ThresholdFactor value "Auto".
#
OutputFormat —
format of the detection results
String
Details
The format of the returned detection results, set by one of the following values: "CUT result" (by default) or "Detection index".
If the OutputFormat property is set to "CUT result", the results are boolean detection values (1 or 0) for each tested cell.
If the OutputFormat property is set to "Detection index" The results are a vector or matrix containing the indexes of the checked cells that exceeded the detection threshold.
#
ThresholdFactor —
the method of determining the threshold coefficient
String
Details
The threshold coefficient method, set by one of the following values: "Auto" (by default), "Custom" or "Input port":
-
"Auto"— the object automatically calculates the threshold coefficient based on the desired probability of a false alarm specified in the property ProbabilityFalseAlarm. In the calculation, it is assumed that each independent input signal is a single pulse coming out of a detector with a quadratic law without pulse integration. The calculation also assumes that the noise is white Gaussian. -
"Custom"— the threshold coefficient is set in the CustomThresholdFactor property. -
"Input port"— the input argument thfac sets the threshold coefficient.
#
ThresholdOutputPort —
enabling the output of the threshold detection value
Logical
Details
Enabling the detection threshold output, set as false (by default) or true.
To enable the detection threshold output, set the ThresholdOutputPort property to true and use the output argument th.
#
NumDetections —
maximum number of detection indexes
Integer
Details
The maximum number of detection indexes, set as a positive integer.
Default value — 1.
Dependencies
To use this property, set the OutputFormat value "Detection index", and for the property NumDetectionsSource the value "Property".
#
Rank —
rank of ordinal statistics
Integer
Details
The rank of an ordinal statistic, given as a positive integer scalar.
The value of this property must be less than or equal to the value of the NumTrainingCells property. Default value 1 sets the lowest value in the learning area.
Dependencies
To use this property, set the Method value "OS".
#
NumDetectionsSource —
the source of the number of detections
String
Details
The source of the number of detections, set to one of the following values: "Auto" (by default) or "Property":
-
If the NumDetectionsSource property is set to
"Auto"The number of reported detection indexes is equal to the total number of cells tested that have detections. -
If the NumDetectionsSource property is set to
"Property", the number of reported detections is determined by the value of the NumDetections property.
Dependencies
To use this property, set the [Property:OutputForma]t value "Detection index".
#
CustomThresholdFactor —
user threshold factor
Real number
Details
A custom threshold coefficient set as a real positive scalar.
Default value — 1.
Dependencies
To use this property, set the Property to:ThresholdFactor value "Custom".
#
NumGuardCells —
number of protective cells
Integer
Details
Specify an even integer number of safety cells used in training. This property determines the total number of cells on either side of the cell being tested.
Default value 2 indicates the presence of one protective cell to the left and right of the tested cell.
Examples
Calculating the probability of a false alarm using a detector with a remote
Details
Let’s perform cell-averaged detection with a POOL on a given Gaussian noise vector with the desired false alarm probability. 0.1. Let’s assume that the data comes from a quadratic law detector and pulse integration is not performed. We use 50 cells for noise level assessment and 1 a cell for separating the test and training cells. We will perform detection on all input data cells.
using EngeePhased
using Random
Random.seed!(1234)
detector = EngeePhased.CFARDetector(NumTrainingCells=50,NumGuardCells=2,ProbabilityFalseAlarm=0.1);
N = 1000
x = 1/sqrt(2) * (randn(N, 1) + 1im * randn(N, 1))
dets = detector(abs(x).^2,1:N)
pfa = sum(dets)/N
0.091
Calculation of detection indexes with PULT
Details
Let’s perform cell-averaged detection with a POOL on a given Gaussian noise vector with the desired false alarm probability. 0.005. Let’s assume that the data comes from a quadratic law detector and pulse integration is not performed. We will perform detection on all input data cells. We use 50 cells for noise level assessment and 1 a cell for separating the test and training cells. Let’s display the detection indexes.
using EngeePhased
using Random
Random.seed!(1234)
detector = EngeePhased.CFARDetector(NumTrainingCells=50,NumGuardCells=2,ProbabilityFalseAlarm=0.005,OutputFormat="Detection index")
N = 1000
x1 = 1/sqrt(2) * (randn(N, 1) + im * randn(N, 1))
x2 = 1/sqrt(2) * (randn(N, 1) + im * randn(N, 1))
x = [x1 x2]
cutidx = 1:N
dets = detector(abs(x).^2,cutidx)
2×2000 Matrix{Float64}:
167.0 18.0 251.0 370.0 835.0 NaN … NaN NaN NaN NaN NaN NaN NaN
1.0 2.0 2.0 2.0 2.0 NaN NaN NaN NaN NaN NaN NaN NaN
Additional Info
Detection from the POOL
Details
An object EngeePhased.CFARDetector uses cell averaging in three steps:
-
Determines the training cells from the input data and generates a noise estimate. The table shows how the detector generates a noise estimate depending on the value of the property Method.
Method Noise level assessment. "CA"Uses the average of the values in all the training cells.
"GOCA"Selects the larger of the average values in the training cells on the left and the training cells on the right.
"OS"Sorts the values in the training cells in ascending order, then selects -th element, where — property value Rank.
"SOCA"Selects the lower of the average values in the tested cells on the left and right.
-
Multiplies the noise estimate by the threshold factor to get the threshold value.
-
Compares the value in the cell under test with a threshold value to determine the presence or absence of a target. If the value is greater than the threshold, then the goal is present.
Data accuracy
Details
An object EngeePhased.CFARDetector supports single and double precision for inputs, properties, and arguments.
If the input data of the argument X has single precision, then the output data has single precision.
If the input data of the argument X has double precision, then the output data has double precision.
The accuracy of the output data does not depend on the accuracy of the properties and other arguments.