A Rust implementation of a radar detection system that calculates target distance and radar cross section (RCS) from radar pulse measurements.
This project implements some core functionality of a radar system by processing radar pulse detections to determine:
- Distance to target - Calculated from the round-trip time of the radar pulse
- Radar cross section (RCS) - Derived from the received signal amplitude using the radar range equation
The system uses realistic radar parameters typical of marine radar systems (25kW transmit power, 40dB antenna gain) and includes error handling for edge cases and invalid measurements.
The Detection struct represents a single radar measurement containing:
timestamp_ns: Time delay in nanoseconds from pulse transmission to receptionamplitude_dbm: Received signal strength in decibels relative to milliwatt (dBm)
get_distance(): Calculates target distance using the speed of light and round-trip timeget_radar_cross_section(): Computes RCS using the radar range equation with built-in validation
The system implements the bistatic radar equation:
σ = (P_r × (4π)² × R⁴) / (P_t × G_t × A_e)
Where:
- σ = Radar cross section (m²)
- P_r = Received power (watts)
- R = Range to target (meters)
- P_t = Transmitted power (watts)
- G_t = Transmit antenna gain
- A_e = Effective antenna area (m²)
The system includes robust error handling for:
- Non-positive radar cross section values
- Unrealistically small RCS values (< 1e-6 m²)
- Unrealistically large RCS values (> 1e6 m²)
let detection = Detection::new(6_667, -60); // 6.667μs delay (~1 km), -60dBm amplitude
let range = detection.get_distance();
match detection.get_radar_cross_section(range) {
Ok(rcs) => println!("Range: {:.2} m, RCS: {:.2e} m²", range, rcs),
Err(e) => println!("Error: {}", e),
}cargo runthiserror: For structured error handling
- Transmit Power: 25 kW (typical marine radar)
- Antenna Gain: 40 dB (~10,000x amplification)
- Effective Antenna Area: 0.785 m² (1m diameter dish)
- Speed of Light: 299,792,458 m/s