xwr.rsp
¶
Radar Signal Processing for batched 4D spectrum.
Image Axis Order
Elevation and azimuth axes are in "image order": increasing index is down and to the right, respectively.
To use the RSP:
-
Pick your backend. Currently, we support numpy, jax, and pytorch.
-
Select the appropriate radar model.
-
Import the RSP class matching your backend and radar:
Tip
Use
xwr.rsp.RSP
as the type for a generic RSP, andRSP[np.ndarray]
,RSP[jax.Array]
,RSP[torch.Tensor]
, etc for a RSP with a specific backend.
xwr.rsp.RSP
¶
Abstract, backend-agnostic Radar Signal Processing base class.
Info
This class documents the public interface for all radar signal processing (RSP) classes, except where otherwise noted.
Type Parameters
TArray
: Generic backend, e.g.,np.ndarray
, jaxjax.Array
, or torchTensor
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
window
|
bool | dict[Literal['range', 'doppler', 'azimuth', 'elevation'], bool]
|
whether to apply a hanning window. If |
False
|
size
|
dict[Literal['range', 'doppler', 'azimuth', 'elevation'], int]
|
target size for each axis after zero-padding, specified by axis. If an axis is not spacified, it is not padded. |
{}
|
Source code in src/xwr/rsp/generic.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
|
__call__
¶
__call__(
iq: Complex64[TArray, "#batch doppler tx rx _range"]
| Int16[TArray, "#batch doppler tx rx _range"],
) -> Complex64[TArray, "#batch doppler2 el az _range"]
Process IQ data to compute elevation-azimuth spectrum.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
iq
|
Complex64[TArray, '#batch doppler tx rx _range'] | Int16[TArray, '#batch doppler tx rx _range']
|
IQ data in complex or interleaved int16 IQ format. |
required |
Returns:
Type | Description |
---|---|
Complex64[TArray, '#batch doppler2 el az _range']
|
Computed doppler-elevation-azimuth-range spectrum. |
Source code in src/xwr/rsp/generic.py
doppler_range
¶
doppler_range(
iq: Complex64[TArray, "#batch doppler tx rx range"],
) -> Complex64[TArray, "#batch doppler2 tx rx range2"]
Calculate range-doppler spectrum from IQ data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
iq
|
Complex64[TArray, '#batch doppler tx rx range']
|
IQ data. |
required |
Returns:
Type | Description |
---|---|
Complex64[TArray, '#batch doppler2 tx rx range2']
|
Computed range-doppler spectrum, with windowing if specified. |
Source code in src/xwr/rsp/generic.py
elevation_azimuth
¶
elevation_azimuth(
rd: Complex64[TArray, "#batch doppler tx rx range"],
) -> Complex64[TArray, "#batch doppler el az range"]
Calculate elevation-azimuth spectrum from range-doppler spectrum.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rd
|
Complex64[TArray, '#batch doppler tx rx range']
|
range-doppler spectrum. |
required |
Returns:
Type | Description |
---|---|
Complex64[TArray, '#batch doppler el az range']
|
Computed elevation-azimuth spectrum, with windowing and padding if specified. |
Source code in src/xwr/rsp/generic.py
fft
abstractmethod
¶
fft(
array: Complex64[TArray, ...],
axes: tuple[int, ...],
size: tuple[int, ...] | None = None,
shift: tuple[int, ...] | None = None,
) -> Complex64[TArray, ...]
Compute FFT on the specified axes of the array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
array
|
Complex64[TArray, ...]
|
Input array. |
required |
size
|
tuple[int, ...] | None
|
Target size for each axis after FFT (or |
None
|
axes
|
tuple[int, ...]
|
Axes along which to compute the FFT. |
required |
shift
|
tuple[int, ...] | None
|
Axes to shift after FFT, if any. |
None
|
Returns:
Type | Description |
---|---|
Complex64[TArray, ...]
|
FFT of the input array along the specified axes. |
Source code in src/xwr/rsp/generic.py
hann
abstractmethod
staticmethod
¶
hann(iq: Complex64[TArray, ...], axis: int) -> Complex64[TArray, ...]
Apply a Hann window to the specified axis of the IQ data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
iq
|
Complex64[TArray, ...]
|
IQ data. |
required |
axis
|
int
|
Axis along which to apply the Hann window. |
required |
Returns:
Type | Description |
---|---|
Complex64[TArray, ...]
|
IQ data with the Hann window applied along the specified axis. |
Source code in src/xwr/rsp/generic.py
mimo_virtual_array
abstractmethod
¶
mimo_virtual_array(
rd: Complex64[TArray, "#batch doppler tx rx range"],
) -> Complex64[TArray, "#batch doppler elevation azimuth range"]
Set up MIMO virtual array from range-doppler spectrum.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rd
|
Complex64[TArray, '#batch doppler tx rx range']
|
range-doppler spectrum. |
required |
Returns:
Type | Description |
---|---|
Complex64[TArray, '#batch doppler elevation azimuth range']
|
Computed MIMO virtual array, in elevation-azimuth order. |
Source code in src/xwr/rsp/generic.py
xwr.rsp.iq_from_iiqq
¶
iq_from_iiqq(
iiqq: Int16[TArray, "... n"] | Complex64[TArray, "... _n"],
) -> Complex64[TArray, "... n2"]
Un-interleave IIQQ data.
Type Parameters
TArray
: This function is multi-backend, and supports numpynp.ndarray
, jaxjax.Array
, and torchTensor
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
iiqq
|
Int16[TArray, '... n'] | Complex64[TArray, '... _n']
|
interleaved IIQQ data; see |
required |
Returns:
Type | Description |
---|---|
Complex64[TArray, '... n2']
|
Complex IQ data. |
Source code in src/xwr/rsp/generic.py
xwr.rsp.iqiq_from_iiqq
¶
Un-interleave IIQQ data.
Type Parameters
TArray
: This function is multi-backend, and supports numpynp.ndarray
, jaxjax.Array
, and torchTensor
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
iiqq
|
Int16[TArray, '... n']
|
interleaved IIQQ data; see |
required |
Returns:
Type | Description |
---|---|
Int16[TArray, '... n/2 2']
|
IQ data in an uninterleaved format with a trailing I/Q axis. |