xwr.constraints
¶
Radar configuration constraints.
This module documents and enforces known constraints on radar configurations.
Warning
These constraints are not exhaustive or guaranteed to be correct. If you find a missing constraint, or run into an undocumented or incorrectly implemented check, please open an issue!
Summary¶
| Constraint | Description |
|---|---|
FrameDutyCycle |
Active transmit time < 99% of frame period |
RFDutyCycle |
RF on-time < 50% of frame period |
ExcessRampTime |
ADC window must complete before ramp ends |
CubeSizeLimit |
Data cube must fit in device L3 buffer |
FrameLengthPowerOfTwo |
Frame length: power of 2 |
AdcSamplesPowerOfTwo |
ADC samples: power of 2 |
MaxSampleRate |
ADC sample rate ≤ device maximum |
MinSampleRate |
ADC sample rate ≥ device minimum |
FrequencyRange |
Start/end frequency within device RF band |
MaxBandwidth |
Chirp bandwidth ≤ device RF maximum |
NetworkUtilization |
Radar throughput < 80% of capture |
ReceiveBuffer |
Receive buffer must hold ≥ 2 radar frames |
xwr.constraints.AdcSamplesPowerOfTwo
¶
Bases: Constraint
ADC samples per chirp must be a power of two.
The number of samples per chirp must be a power of two for the range FFT:
adc_samples & (adc_samples - 1) == 0
Source code in src/xwr/constraints.py
xwr.constraints.Constraint
¶
Bases: ABC
Base class for a radar configuration constraint.
Source code in src/xwr/constraints.py
check
abstractmethod
staticmethod
¶
check(radar: XWRConfig, capture: DCAConfig | None = None) -> ConstraintCheck
xwr.constraints.ConstraintCheck
dataclass
¶
Result of a single constraint check.
Attributes:
| Name | Type | Description |
|---|---|---|
constraint |
type[Constraint]
|
type of the constraint being checked. |
passed |
bool | None
|
|
detail |
str
|
computed value (on pass/skip) or violation description (on fail). |
Source code in src/xwr/constraints.py
xwr.constraints.CubeSizeLimit
¶
Bases: Constraint
Radar data cube must fit within the device L3 radar buffer.
Checks frame_size (total bytes for one frame) against the device
hardware L3 memory limit:
frame_size ≤ _LIMITS[device_name]
where frame_size = frame_length × num_tx × num_rx × adc_samples
× BYTES_PER_SAMPLE (see XWRConfig.frame_size).
| Device | L3 size |
|---|---|
| AWR1642 | 768 KiB |
| AWR1843 | 1 MiB |
| AWR2944 | 2.5 MiB |
| AWRL6844 | 896 KiB |
Source code in src/xwr/constraints.py
xwr.constraints.ExcessRampTime
¶
Bases: Constraint
ADC sampling must complete before the frequency ramp ends.
The ADC window must fit within the chirp ramp:
ramp_end_time - adc_start_time ≥ T_s
where T_s = adc_samples / sample_rate × 1000 μs (see
XWRConfig.sample_time).
Source code in src/xwr/constraints.py
xwr.constraints.FrameDutyCycle
¶
Bases: Constraint
Active frame time must not exceed the frame period.
The fraction of each period spent actively transmitting must stay below 99%:
frame_time / frame_period < 99%
where frame_time = chirp_time × frame_length / 1000 ms (see
XWRConfig.frame_time).
Source code in src/xwr/constraints.py
xwr.constraints.FrameLengthPowerOfTwo
¶
Bases: Constraint
Frame length must be a power of two.
The number of chirps per TX antenna per frame must be a power of two for the range-Doppler FFT:
frame_length & (frame_length - 1) == 0
Source code in src/xwr/constraints.py
xwr.constraints.FrequencyRange
¶
Bases: Constraint
Start and end frequencies must lie within the device RF band.
Both the start frequency and the end frequency
(start_freq + bandwidth / 1000) are checked against per-device limits:
| Device | Min (GHz) | Max (GHz) |
|---|---|---|
| AWR1642 | 76 | 81 |
| AWR1843 | 76 | 81 |
| AWR2944 | 76 | 81 |
| AWRL6844 | 57 | 64 |
Source code in src/xwr/constraints.py
xwr.constraints.MaxBandwidth
¶
Bases: Constraint
Effective chirp bandwidth must not exceed the device RF limit.
Bandwidth is computed as freq_slope × T_s (see
XWRConfig.bandwidth).
| Device | Maximum |
|---|---|
| AWR1642 | 4000 MHz |
| AWR1843 | 4000 MHz |
| AWR2944 | 4000 MHz |
Source code in src/xwr/constraints.py
xwr.constraints.MaxSampleRate
¶
Bases: Constraint
ADC sampling rate must not exceed the device maximum.
| Device | Maximum |
|---|---|
| AWR1642 | 12,500 Ksps |
| AWR1843 | 25,000 Ksps |
| AWR2944 | 37,500 Ksps |
| AWRL6844 | 25,000 Ksps |
Source code in src/xwr/constraints.py
xwr.constraints.MinSampleRate
¶
Bases: Constraint
ADC sampling rate must meet the device minimum.
| Device | Minimum |
|---|---|
| AWR1843 | 2,000 Ksps |
Source code in src/xwr/constraints.py
xwr.constraints.NetworkUtilization
¶
Bases: Constraint
Radar data throughput must not exceed 80% of capture card capacity.
High utilization risks packet loss in the networking:
radar.throughput / capture.throughput < 80%
Skipped if no DCAConfig is provided.
Source code in src/xwr/constraints.py
xwr.constraints.RFDutyCycle
¶
Bases: Constraint
RF transmitter on-time must not exceed 50% of the frame period.
Counts only the time the RF ramp is active (ramp_end_time per TX
per chirp), excluding idle time and the inter-frame gap:
ramp_end_time × num_tx × frame_length / (frame_period × 1000) < 50%
Source code in src/xwr/constraints.py
xwr.constraints.ReceiveBuffer
¶
Bases: Constraint
OS receive buffer must hold at least two full radar frames.
Since radar frames are transmitted by the capture card in consecutive bursts of packets, a buffer smaller than two frames risks dropping packets when the consumer falls momentarily behind:
socket_buffer / frame_size ≥ 2
Skipped if no DCAConfig is provided.
Source code in src/xwr/constraints.py
xwr.constraints.check_config
¶
check_config(
radar: XWRConfig, capture: DCAConfig | None = None, log: bool = True
) -> list[ConstraintCheck]
Run all constraints against a configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radar
|
XWRConfig
|
radar configuration. |
required |
capture
|
DCAConfig | None
|
capture card configuration; cross-config constraints are skipped if not provided. |
None
|
log
|
bool
|
if |
True
|
Returns:
| Type | Description |
|---|---|
list[ConstraintCheck]
|
All constraint results, including passed and skipped checks. |