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.
# 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.mainYou should see a live Range–Doppler heatmap and a short detection list (R, v, SNR) in the plot.
- FMCW up-chirps with slope
S = B / T_chirp. - The dechirped beat for a target at range
Rand radial velocityvappears at:- Range (fast time):
f_b ≈ 2 S R / c - Doppler (slow time):
f_d = 2 v f_c / c
- Range (fast time):
- Processing:
- Windowing (fast/slow time) → 1D FFT (range)
- 1D FFT across chirps (Doppler) → Range–Doppler map
- 2D CA-CFAR for detections
- Live plotting
- Range resolution:
ΔR = c / (2B)→ increaseBfor 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_traininsrc/config.py. - Simulator noise level:
SimConfig.noise_sigma.
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.complex64Then set SOURCE = "sim" → "your_source" and import it in src/main.py.
- 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.
MIT (educational/research use; follow local RF regulations for any on-air tests).