Skip to content

FirdevsTorlak/fmcw-radar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FMCW Radar Prototype (Range + Doppler)

A minimal, educational FMCW radar pipeline you can run on a laptop or Raspberry Pi.
It includes:

  • A signal simulator (single/multi-target) to generate baseband FMCW beat signals.
  • A range–Doppler processing chain (windowing, 1D/2D FFT, 2D CA-CFAR).
  • A live viewer (matplotlib) that updates the range–Doppler map in real time.

Hardware note: This repo ships with a simulator by default. You can later add a real front-end (e.g., TI IWR6843 raw samples or ADALM-PLUTO IQ) by writing a new acquisition module that yields frames shaped (n_chirps, n_samples) complex64.

Quick start

# 1) Create venv (optional)
python -m venv .venv

# 2) Activate it
#   Windows:
.venv\Scripts\activate
#   Linux/macOS:
source .venv/bin/activate

# 3) Install deps
pip install -r requirements.txt

# 4) Run the demo (simulator)
python -m src.main

You should see a live Range–Doppler heatmap and a short detection list (R, v, SNR) in the plot.

How it works (short)

  • FMCW up-chirps with slope S = B / T_chirp.
  • The dechirped beat for a target at range R and radial velocity v appears at:
    • Range (fast time): f_b ≈ 2 S R / c
    • Doppler (slow time): f_d = 2 v f_c / c
  • Processing:
    1. Windowing (fast/slow time) → 1D FFT (range)
    2. 1D FFT across chirps (Doppler) → Range–Doppler map
    3. 2D CA-CFAR for detections
    4. Live plotting

Tuning tips

  • Range resolution: ΔR = c / (2B) → increase B for finer range bins.
  • Velocity resolution: Δv ≈ λ / (2 * T_frame) → more chirps per frame improves Doppler bins.
  • Make CFAR looser/tighter via CFAR_PFA, CFAR_guard, CFAR_train in src/config.py.
  • Simulator noise level: SimConfig.noise_sigma.

Add your own front-end

Create a module under src/acquisition/ that yields frames (N_chirps, N_samples) as complex64:

def stream_frames():
    while True:
        yield frame  # shape: (N_chirps, N_samples), dtype=np.complex64

Then set SOURCE = "sim""your_source" and import it in src/main.py.

Troubleshooting

  • If the plot window doesn’t open on Windows:
    set MPLBACKEND=TkAgg
    python -m src.main
  • Make sure you’re using the project’s virtualenv interpreter.

License

MIT (educational/research use; follow local RF regulations for any on-air tests).

About

FMCW-Radar: Simu-lator & Range-Doppler-Demo (FMCW= Frequency-Modulated Continuous-Wave)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages