RF Prototype Test Bench (Radar/Sensor)
Minimal, educational, English‑only prototype test bench for RF/radar/sensor algorithms.
Features
• Signal simulator (package name: sigproc) with single/multiple targets
• Processing chain: windowing → range FFT (1D) → Doppler FFT (2D) → threshold/CFAR detection
• Performance metrics: Pd, Pfa; simple SNR handling
• FastAPI backend with a small web UI (Range–Doppler heatmap + detections)
• Docker image and GitHub Actions CI (optional)
• Endpoints: /health, /simulate-run, /rd-frame, /metrics, /roc
Quickstart
- Linux / macOS python -m venv .venv && source .venv/bin/activate\npip install -r requirements.txt\npytest -q\nuvicorn src.app.main:app --reload --port 8001\nOpen http://127.0.0.1:8001
- Windows (PowerShell / CMD) python -m venv .venv && .\.venv\Scripts\activate\npip install -r requirements.txt\npytest -q\nuvicorn src.app.main:app --host 127.0.0.1 --port 8001 --reload\nOpen http://127.0.0.1:8001 Docker
- Build & run: docker build -f docker/Dockerfile -t rf-proto .\ndocker run -d --name rf-proto -p 8001:8000 --restart unless-stopped rf-proto\ncurl http://127.0.0.1:8001/health
- Compose: docker compose -f docker/docker-compose.yml up --build -d\ncurl http://127.0.0.1:8001/health API • GET /health — Health check. Returns {"status":"ok"}. • POST /simulate-run — Run one pipeline pass (simulate → FFTs → detect). Returns RD shape and detections. • POST /rd-frame — Return the current Range–Doppler frame as a dB matrix plus detections (JSON). • POST /metrics — Monte‑Carlo Pd/Pfa estimate for a given configuration. • POST /roc — Compute ROC curve. Use either thresholds (k‑sigma sweep) or pfa_list (CFAR sweep). • Docs — Interactive OpenAPI docs at /docs (when running the API). Frontend • Open web/index.html served by FastAPI at '/' • Client JS: web/assets/app.js draws the heatmap and calls the API. • If UI and API share the same origin, set API_BASE = "" in app.js. Otherwise, set API_BASE to the full origin (e.g., http://127.0.0.1:8001). Tests • pytest -q • Sample smoke tests call /rd-heatmap (JSON), /metrics, /roc, etc. Troubleshooting • If the browser shows “Failed to fetch”, check that API_BASE in app.js points to your API origin and that the API is reachable (curl /health). • If you serve UI from a different origin, enable CORS in FastAPI or run the UI from the API origin. • For Docker, ensure the host port is free (use a different port mapping if needed). License MIT — see LICENSE.