Skip to content

Tabish-P/radar-target-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Radar Target Detection with 2D CFAR

Project Overview

This project simulates an FMCW automotive radar and detects a moving target using:

  • FMCW waveform generation
  • Range FFT (1D FFT)
  • Range-Doppler Map generation (2D FFT)
  • 2D CFAR thresholding to isolate target detections from noise

The implementation is in radar.m.

Output

Generated figures:

  • 1st-FFT.png 1st-FFT
  • 2nd-FFT.png 2nd-FFT
  • 2D-CFAR.png 2D-CFAR

These visualize range estimation, range-doppler response, and final CFAR detections respectively.

Radar Setup

The simulation uses the following requirements:

  • Carrier frequency: 77 GHz
  • Maximum range: 200 m
  • Range resolution: 1 m
  • Maximum velocity: 70 m/s

Target motion used in the script:

  • Initial range: 110 m
  • Velocity: -20 m/s (approaching radar)

Processing Pipeline

  1. Generate FMCW chirps from radar specifications.
  2. Simulate transmitted and received signals over time.
  3. Mix Tx and Rx to obtain beat signal.
  4. Run 1D FFT for range estimation.
  5. Run 2D FFT to produce the Range-Doppler Map (RDM).
  6. Apply 2D CFAR to the RDM for binary target detection.

Implementation Steps for the 2D CFAR Process

The CFAR process is implemented as follows:

  1. Convert local RDM window values from dB to linear power
  2. For each Cell Under Test (CUT), define a rectangular window that includes:
    • Training cells (background/noise estimate)
    • Guard cells (buffer around CUT to prevent target leakage)
  3. Sum power in the full training+guard window.
  4. Subtract guard-window power from total window power to keep only training-cell power.
  5. Average by the number of training cells to estimate local noise power.
  6. Convert the average noise power back to dB
  7. Add a fixed offset (SNR margin) to form the detection threshold.
  8. Compare CUT value against threshold:
    • If CUT > threshold, mark detection = 1
    • Else, detection = 0

Selection of Training, Guard Cells, and Offset

Current values:

  • Training cells: Tr = 10, Td = 8
  • Guard cells: Gr = 4, Gd = 4
  • Offset: 6 dB

Why these values are reasonable:

  • Training cells must be large enough to estimate local noise robustly.
  • Guard cells must be large enough to isolate the target main lobe from training statistics.
  • Offset controls false alarms versus missed detections:
    • Lower offset: more sensitive, potentially noisier output.
    • Higher offset: cleaner output, but risk of suppressing weaker targets.

Steps Taken to Suppress Non-Thresholded Edge Cells

CFAR cannot be evaluated at map boundaries because a full training+guard window does not fit around those CUTs.

To keep output size equal to the original RDM while removing undefined regions:

  1. Run CFAR only where a full window is valid.
  2. Leave edge regions as non-detections (0).
  3. Explicitly set boundary bands to 0 in the CFAR matrix using margins:
    • Top and bottom bands: Tr + Gr rows
    • Left and right bands: Td + Gd columns

This ensures:

  • No invalid thresholding at edges
  • Output dimensions remain unchanged
  • Cleaner and consistent binary detection map

About

MATLAB project demonstrating Radar Target Generation and Detection

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages