RadarCFAR (Constant False Alarm Rate)#
Overview#
Constant False Alarm Rate (CFAR) is a fundamental radar signal processing technique used for automatic target detection in the presence of varying noise and clutter environments. CFAR follows Range FFT and Doppler FFT in the radar processing pipeline, operating on range-Doppler magnitude maps to detect targets while maintaining a constant false alarm rate. The algorithm adaptively estimates the local noise floor using training cells and applies a threshold to identify potential targets, making it robust to spatially varying clutter and interference.
The CFAR operator is designed to process 2D range-Doppler magnitude maps and produce a detection list containing the coordinates (range index and Doppler index) of detected targets. This implementation supports the Cell Averaging (CA-CFAR) algorithm variant, which is widely used in radar systems due to its computational efficiency and effectiveness in homogeneous clutter environments.
Folded NCI map of the same 8T8R frame (512 range × 32 Doppler bins); detections are circled in red. CFAR Parameters, as in the 8T8R pipeline: CA, Pfa = 0.1, training/guard cells 12/2 horizontal and 48/8 vertical, cyclic padding.
Algorithm Description#
The CFAR algorithm operates by processing each cell in the range-Doppler map, treating it as a Cell Under Test (CUT). For each CUT, the algorithm estimates the local noise level using neighboring cells and compares the CUT value against an adaptive threshold to determine if it represents a valid target.
Cell Window Structure#
The CFAR algorithm uses a structured window around each CUT:
Where:
\(N\) = number of training cells (numTrain)
\(K\) = number of guard cells (numGuard)
\(CUT\) = Cell Under Test
\(T_i\) = Training cells for noise estimation
\(G_i\) = Guard cells to prevent the noise estimate from being corrupted by a target signal that may be present in the CUT
Cell Averaging CFAR#
The Cell Averaging CFAR algorithm computes the noise estimate as the average of training cells:
The threshold factor is calculated based on the desired probability of false alarm (\(P_{fa}\)) and the number of training cells:
Where:
\(N\) = number of training cells
\(P_{fa}\) = desired probability of false alarm
The detection threshold is computed as:
A target is detected when:
Two-Dimensional Processing#
The operator performs CFAR processing in two stages:
Horizontal CFAR: Processes along the Doppler dimension (horizontal) to detect targets based on velocity-domain noise characteristics
Vertical CFAR: Processes along the range dimension (vertical) to detect targets based on range-domain noise characteristics
The final detection list contains only cells that pass both horizontal and vertical CFAR thresholds (logical AND operation).
Peak Grouping#
When peak grouping is enabled, the algorithm performs Non-Maximum Suppression (NMS) to retain only local maxima:
In horizontal direction: Detections are retained only if their magnitude is greater than or equal to the magnitudes of their immediate left and right neighbors.
In vertical direction: Detections are retained only if their magnitude is greater than or equal to the magnitudes of their immediate top and bottom neighbors.
This reduces false alarms by discarding detections that are smaller than an immediate neighbor along either axis. The test is non-strict, so equal-valued adjacent cells are all retained, and it is applied independently per axis rather than over the full 2-D neighborhood.
Implementation Details#
Dataflow Configuration#
Seven dataflow heads are distributed over four phases.
The runtime rejects a phase containing two sequential groups, so each phase carries at most one SequenceDataFlow; raster heads have no such restriction and phases 1 and 2 carry two each.
Phase |
Dataflow |
Tile |
Purpose |
|---|---|---|---|
0 |
SequenceDataFlow |
single 28 KB tile |
Per-position tables, DRAM to VMEM, once per submit |
1 |
RasterDataFlow |
Width x 16 |
Input row strip |
1 |
RasterDataFlow (transposed) |
Width x 16 |
Horizontal decision, VMEM to DRAM scratch |
2 |
RasterDataFlow |
16 x Height |
Input column strip |
2 |
RasterDataFlow |
16 x Height |
Horizontal decision, DRAM scratch to VMEM |
2 |
SequenceDataFlow |
1 word x min(maxDetections, 1280) |
Detection list drain |
3 |
SequenceDataFlow |
1 word |
Detection count |
Buffer Allocation#
Buffers are sized for the widest supported image and shared between the two passes, which are sequential. The three superbanks hold about 295 KB of the 384 KB VMEM; independent worst-case buffers would need considerably more.
Superbank A (~92 KB) holds the DMA landing buffer shared by both passes, the per-position tables, and the small scalars and dataflow handlers. A row strip is Width x 16 and a column strip is 16 x Height, so one allocation of 16 x 1024 elements serves both passes.
Superbank B (~97 KB) holds the private padded strip, written by the padding kernels and read by the marching loops.
Superbank C (~106 KB) holds the horizontal decision tile at one int32 per cell, 1280 detections staged for a single drain, the frame’s detections as two parallel int16 arrays, and the detection count. Coordinates are bounded by 1024 and so fit a halfword, which is what lets the whole frame’s list stay in VMEM.
Six of the seven per-position tables hold, for every position along the marched axis, the reciprocal \(65536/\text{count}\) that replaces a division: the total, trailing and leading cell counts, for each of the two directions. The seventh holds the per-row horizontal threshold factors. CA reads only the total reciprocals; GO and SO read only the trailing and leading ones.
The compute-hot padded strip sits on its own superbank, away from the DMA landing buffer in A. The mask in C is DMA-read in the first pass and DMA-written in the second, but the passes are sequential, so no two DMA streams are ever live on one superbank at once.
Kernel Implementation#
Strip Decomposition#
The operator is separable. Both passes process 16 lanes at a time: the horizontal pass marches along x with one image row per lane, the vertical pass marches along y with one image column per lane.
Horizontal pass Vertical pass
ceil(Height/16) row strips ceil(Width/16) column strips
each Width x 16 each 16 x Height
+------------------------+ +----+----+-----+----+
| strip 0 | | | | | |
+------------------------+ | | | | |
| strip 1 | | s0 | s1 | ... | sn |
+------------------------+ | | | | |
| ... | | | | | |
+------------------------+ +----+----+-----+----+
Width and height are multiples of 8 but not necessarily of 16, so the final strip of each pass may be partial. In the horizontal pass the padding kernel zeroes the surplus lanes and the RasterDataFlow clips the final tile to the image, so their stores never reach DRAM; in the vertical pass the surplus lanes march over stale tile data and are masked out of the detection on the device. The mask allocation in DRAM is rounded up to a whole strip so that the final column strip reads in bounds.
Both passes run inside a single submit, so the fixed submit cost is paid once per frame rather than once per tile.
Running Window Sums#
Each pass carries the trailing and leading training-cell sums in vector registers and updates them once per step, rather than building a cumulative-sum table. With the cell under test at padded index \(x + \text{window}\), where \(\text{window} = \text{numTrain} + \text{numGuard}\):
trailSum += pad[x + numTrain] - pad[x]
leadSum += pad[x + 2*window + 1] - pad[x + window + numGuard + 1]
The cost per cell is therefore independent of numTrain.
A word lane is extended to 48 bits in the register file (Programmer’s Guide, Vector Register File). With numTrain + numGuard bounded by 255, a window sum is bounded by \(510 \times (2^{32} - 1) < 2^{41}\), so the running sums stay exact in a single lane and no multi-word accumulator is needed.
Fixed-Point Arithmetic#
The noise estimate and threshold are evaluated in exact integer arithmetic:
Both products are evaluated so that every intermediate stays inside the 48-bit lane, so the result is bit-identical to the exact int64 computation.
Horizontal Pass#
For each row strip:
Padding: The padding kernel copies the DMA tile into the center of the padded strip and materializes both x halos, wrapped from the opposite edge of the same row in cyclic mode and zeroed otherwise.
Marching: The marching kernel advances x from 0 to Width-1, maintaining the running sums and comparing each cell against its threshold.
Store: the per-cell decision (0 or -1) is written with transposed stores, so the output RasterDataFlow lands it in natural row-major order in DRAM.
CFAR Window and Thresholding
Example: numTrain = 3, numGuard = 1
Trailing Train | Guard | CUT | Guard | Leading Train
T3 T2 T1 | G1 | | G1 | T1 T2 T3
5 3 2 | 4 | 20 | 5 | 3 2 6
trailSum = 10 |unused | |unused | leadSum = 11
Noise = (trailSum + leadSum) / (2 * numTrain)
= 21 / 6 = 3.5
Threshold = Noise x ThresholdFactor
= 3.5 x 2.0 = 7.0
Detection: CUT >= Threshold ?
20 >= 7.0 ? YES → Target Detected! ✓
Non-Maximum Suppression (NMS) Example
One row is swept with the non-strict neighbor test, keeping only the local maxima:
Position: 0 1 2 3 4 5
Magnitude: 10 15 12 18 22 19
Position 0: 10 < 15 → Remove ✗
Position 1: 15 >= 10 AND 15 >= 12 → Keep ✓ (Peak!)
Position 2: 12 < 15 → Remove ✗
Position 3: 18 >= 12 AND 18 < 22 → Remove ✗
Position 4: 22 >= 18 AND 22 >= 19 → Keep ✓ (Peak!)
Position 5: 19 < 22 → Remove ✗
Surviving peaks: positions 1 and 4, magnitudes 15 and 22.
Every other cell is cleared, whatever its own threshold decision was.
Vertical Pass and Detection Emission#
The padding kernel mirrors the row padding on the other axis. The marching kernel then advances y, reloading the horizontal decision for the same cells. A cell survives when all four of the following hold:
it clears the vertical threshold;
it passed the horizontal decision;
it passes the vertical neighbor test, if peak grouping is enabled;
its lane lies inside the image.
Surviving cells are compacted in registers rather than by a scan over the mask, and the write cursor is clamped at the smaller of the remaining capacity and 1280, which is how the operator saturates once that capacity is reached.
Performance#
Performance considerations:
Execution Time is the average time required to execute the operator on a single VPU core.
Note that each PVA contains two VPU cores, which can operate in parallel to process two streams simultaneously, or reduce execution time by approximately half by splitting the workload between the two cores.
Total Power represents the average total power consumed by the module when the operator is executed concurrently on both VPU cores.
Idle power is approximately 7.6 W on Jetson AGX Orin and 11.8 W on Jetson AGX Thor when the PVA is not processing data.
For detailed information on interpreting the performance table below and understanding the benchmarking setup, see Performance Benchmark.
Tensor Size |
H Train |
H Guard |
V Train |
V Guard |
H Cyclic |
V Cyclic |
Peak Grouping |
Algorithm |
Input Type |
Execution Time |
Submit Latency |
Total Power |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
32x512 |
15 |
0 |
255 |
0 |
false |
false |
false |
CA |
S32 |
0.122ms |
0.004ms |
9.812W |
32x512 |
15 |
0 |
255 |
0 |
false |
false |
false |
CA_GO |
S32 |
0.127ms |
0.004ms |
9.81W |
32x512 |
15 |
0 |
255 |
0 |
false |
false |
false |
CA_SO |
S32 |
0.133ms |
0.004ms |
9.81W |
32x512 |
15 |
0 |
255 |
0 |
true |
false |
false |
CA |
S32 |
0.127ms |
0.004ms |
9.81W |
32x512 |
15 |
0 |
255 |
0 |
true |
false |
false |
CA_GO |
S32 |
0.130ms |
0.004ms |
9.811W |
32x512 |
15 |
0 |
255 |
0 |
true |
false |
false |
CA_SO |
S32 |
0.135ms |
0.004ms |
9.81W |
32x512 |
15 |
0 |
255 |
0 |
true |
true |
false |
CA |
S32 |
0.126ms |
0.004ms |
9.81W |
32x512 |
15 |
0 |
255 |
0 |
true |
true |
false |
CA_GO |
S32 |
0.131ms |
0.004ms |
9.712W |
32x512 |
15 |
0 |
255 |
0 |
true |
true |
false |
CA_SO |
S32 |
0.136ms |
0.004ms |
9.812W |
32x512 |
15 |
0 |
255 |
0 |
true |
true |
true |
CA |
S32 |
0.117ms |
0.003ms |
9.81W |
32x512 |
15 |
0 |
255 |
0 |
true |
true |
true |
CA_GO |
S32 |
0.125ms |
0.003ms |
9.812W |
32x512 |
15 |
0 |
255 |
0 |
true |
true |
true |
CA_SO |
S32 |
0.126ms |
0.003ms |
9.81W |
32x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA |
S32 |
0.112ms |
0.004ms |
9.81W |
32x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA |
U32 |
0.112ms |
0.003ms |
9.81W |
32x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA_GO |
S32 |
0.119ms |
0.003ms |
9.812W |
32x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA_SO |
S32 |
0.120ms |
0.004ms |
9.81W |
512x256 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA |
S32 |
0.402ms |
0.004ms |
11.111W |
512x256 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA_GO |
S32 |
0.453ms |
0.004ms |
11.011W |
512x256 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA_SO |
S32 |
0.453ms |
0.004ms |
11.011W |
512x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA |
S32 |
0.761ms |
0.004ms |
11.61W |
512x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA |
U32 |
0.760ms |
0.003ms |
11.513W |
512x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA_GO |
S32 |
0.859ms |
0.004ms |
11.412W |
512x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA_GO |
U32 |
0.859ms |
0.004ms |
11.409W |
512x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA_SO |
S32 |
0.858ms |
0.004ms |
11.409W |
512x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA_SO |
U32 |
0.858ms |
0.004ms |
11.409W |
Tensor Size |
H Train |
H Guard |
V Train |
V Guard |
H Cyclic |
V Cyclic |
Peak Grouping |
Algorithm |
Input Type |
Execution Time |
Submit Latency |
Total Power |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
32x512 |
15 |
0 |
255 |
0 |
false |
false |
false |
CA |
S32 |
0.129ms |
0.003ms |
13.357W |
32x512 |
15 |
0 |
255 |
0 |
false |
false |
false |
CA_GO |
S32 |
0.133ms |
0.003ms |
13.357W |
32x512 |
15 |
0 |
255 |
0 |
false |
false |
false |
CA_SO |
S32 |
0.144ms |
0.003ms |
13.357W |
32x512 |
15 |
0 |
255 |
0 |
true |
false |
false |
CA |
S32 |
0.135ms |
0.003ms |
13.256W |
32x512 |
15 |
0 |
255 |
0 |
true |
false |
false |
CA_GO |
S32 |
0.137ms |
0.003ms |
13.357W |
32x512 |
15 |
0 |
255 |
0 |
true |
false |
false |
CA_SO |
S32 |
0.146ms |
0.003ms |
13.256W |
32x512 |
15 |
0 |
255 |
0 |
true |
true |
false |
CA |
S32 |
0.136ms |
0.003ms |
13.357W |
32x512 |
15 |
0 |
255 |
0 |
true |
true |
false |
CA_GO |
S32 |
0.138ms |
0.003ms |
13.256W |
32x512 |
15 |
0 |
255 |
0 |
true |
true |
false |
CA_SO |
S32 |
0.146ms |
0.003ms |
13.256W |
32x512 |
15 |
0 |
255 |
0 |
true |
true |
true |
CA |
S32 |
0.125ms |
0.002ms |
13.357W |
32x512 |
15 |
0 |
255 |
0 |
true |
true |
true |
CA_GO |
S32 |
0.132ms |
0.002ms |
13.357W |
32x512 |
15 |
0 |
255 |
0 |
true |
true |
true |
CA_SO |
S32 |
0.133ms |
0.003ms |
13.256W |
32x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA |
S32 |
0.118ms |
0.003ms |
13.459W |
32x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA |
U32 |
0.119ms |
0.002ms |
13.357W |
32x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA_GO |
S32 |
0.126ms |
0.002ms |
13.256W |
32x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA_SO |
S32 |
0.126ms |
0.003ms |
13.256W |
512x256 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA |
S32 |
0.432ms |
0.003ms |
14.258W |
512x256 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA_GO |
S32 |
0.486ms |
0.003ms |
14.056W |
512x256 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA_SO |
S32 |
0.485ms |
0.003ms |
14.157W |
512x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA |
S32 |
0.817ms |
0.002ms |
14.056W |
512x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA |
U32 |
0.817ms |
0.003ms |
14.056W |
512x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA_GO |
S32 |
0.925ms |
0.002ms |
14.056W |
512x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA_GO |
U32 |
0.925ms |
0.003ms |
14.056W |
512x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA_SO |
S32 |
0.925ms |
0.003ms |
14.056W |
512x512 |
6 |
3 |
6 |
3 |
true |
true |
true |
CA_SO |
U32 |
0.925ms |
0.003ms |
14.056W |