Distance detection#

Introduction#

The purpose of the distance detector is to detect objects and estimate their distance from the sensor. The algorithm is built on top of the Sparse IQ service and has various configuration parameters available to tailor the detector to specific use cases. The detector utilizes the following key concepts:

1. Distance filtering: A matched filter is applied along the distance dimension to improve the signal quality and suppress noise.

2. Subsweeps: The measured range is split into multiple subsweeps, each configured to maintain SNR throughout the sweep while minimizing power consumption.

3. Comparing sweep to a threshold: Peaks in the filtered sweep are identified by comparison to one of three available threshold methods.

4. Estimate distance to object: Estimate the distance to the target by interpolation of the peak and neighboring amplitudes.

5. Sort found peaks: If multiple peaks are found in a sweep, three different sorting methods can be employed, each suitable for different use-cases.

Distance filter#

As the sensor produce coherent data, samples corresponding to the location of an object will have similar phase, while the phase of free-air measurements will be random. By applying a filter in the distance domain, the noise in the free-air regions will be suppressed, resulting in an improved SNR.

The filter is automatically configured based on the detector configuration as a second order Butterworth filter with a cutoff frequency corresponding to a matched filter.

Subsweeps#

The measurement range is split up into multiple subsweeps to allow for optimization of power consumption and signal quality. The profile, HWAAS and step length are automatically assigned per subsweep, based on the detector config.

  • A shorter profile is selected at the start of the measurement range to minimize the interference with direct leakage, followed by longer profiles to gain SNR. The longest profile used can be limited by setting the parameter max_profile. If no profile is specified, the subsweeps will be configured to transfer to the longest profile(without interference from direct leakage) as quickly as possible to maximize SNR. Longer profiles yield a higher SNR at a given power consumtion level, while shorter profiles gives better depth resolution.

  • The step length can also be limited by setting the parameter max_step_length. If no value is supplied, the step length is automatically configured to appropriate size, maintaining good depth resolution while minimizing power consumption. Note, the algorithm interpolates between the measured points to maintain good resolution, even with a more coarse step length.

  • HWAAS is assigned to each subsweep in order to maintain SNR throughout the measured range as the signal strength decrease with the distance between the sensor and the measured target. The target SNR level is adjusted using the parameter signal_quality.

    Note, higher signal quality will increase power consumption and measurement time.

    The expected reflector shape is considered when assigning HWAAS to the subsweeps. For planar reflectors, such as fluid surfaces, select PLANAR. For all other reflectors, select GENERIC.

In the Exploration Tool GUI, the subsweeps can be seen as slightly overlapping lines. If the measured object is in the overlapping region, the result from the neighboring segments is averaged together.

Thresholds#

To determine if any objects are present, the sweep is compared to a threshold. Three different thresholds can be employed, each suitable for different use-cases.

Fixed threshold

The simplest approach to setting the threshold is choosing a fixed threshold over the full range.

Recorded threshold

In situations where stationary objects are present, the background signal is not flat. To isolate objects of interest, the threshold is based on measurements of the static environment. The first step is to collect multiple sweeps, from which the mean sweep and standard deviation is calculated. Secondly, the threshold is formed by adding a number of standard deviations (the number is determined by the parameter threshold_sensitivity) to the mean sweep.

Constant False Alarm Rate (CFAR) threshold (default)

A final method to construct a threshold for a certain distance is to use the signal from neighbouring distances of the same sweep. This requires that the object gives rise to a single strong peak, such as a fluid surface and not, for example, the level in a large waste container. The main advantage is that the memory consumption is minimal.

Reflector shape#

The expected reflector shape is considered when assigning HWAAS to the subsweeps and during peak sorting.

The reflector shape is set through the detector configuration parameter reflector_shape.

For a planar reflector, such as a fluid surface, select PLANAR. For all other reflectors, select GENERIC.

Peak sorting#

Multiple objects in the scene will give rise to several peaks. Peak sorting allows selection of which peak is of highest importance.

The peak sorting strategy is set through PeakSortingMethod, which is part of the detector configuration.

The following peak sorting options are available.

Closest

This method sorts the peaks according to distance from the sensor.

Strongest (default)

This method sorts the peaks according to their relative strength.

Note, the reflector shape is considered when calculating each peak’s strength. The reflector shape is selected through detector configuration parameter reflector_shape.

Detector calibration#

For optimal performance, the detector performs a number of calibration steps. The following section outlines the purpose and process of each step. Note, which of the following calibration procedures to perform is determined by the user provided detector config. For instance, the close range measurement is only performed when measuring close to the sensor.

To trigger the calibration process in the Exploration Tool gui, simply press the button labeled “Calibrate detector”. If you are running the detector from a script, the calibration is performed by calling the method calibrate_detector.

Noise level estimation

The noise level is estimated by disabling of the transmitting antenna and just sample the background noise with the receiving antenna.

Offset compensation

The purpose of the offset compensation is to improve the distance trueness(average error) of the distance detector. The compensation utilize the loopback measurement, where the pulse is measured electronically on the chip, without transmitting it into the air. The location of the peak amplitude is correlated with the distance error and used to correct the distance raw estimate.

Close range measurement calibration

Measuring the distance to objects close to the sensor is challenging due to the presence of strong direct leakage. One way to get around this is to characterize the leakage component and then subtract it from each measurement to isolate the signal component. This is exactly what the close range calibration does. While performing the calibration, it is important that the sensor is installed in its intended geometry and that there is no object in front of the sensor as this would interfer with the direct leakage.

Note, this calibration is only performed if close range measurement is active, given by the configured starting point.

Recorded threshold

The recorded threshold is also recorded as a part of the detector calibration. Note, this calibration is only performed if the detector is configured to used recorded threshold or if close range measurement is active, where recorded threshold is used.

Detector recalibration#

To maintain optimal performance, the sensor should be recalibrated if sensor_calibration_needed is set to True. A sensor calibration should be followed by a detector recalibration, performed by calling recalibrate_detector.

The detector recalibration carries out a subset of the calibration steps. All the calibration steps performed are agnostic to its surroundings and can be done at any time without considerations to the environment.

Temperature compensation#

The surrounding temperature impacts the amplitude of the measured signal and noise. To compensate for these effects, the recorded threshold has a built in compensation model, based on a temperature measurement, internal to the sensor. Note, the effectiveness of the compensation is limited when measuring in the close range region.

Configuration parameters#

class acconeer.exptool.a121.algo.distance.DetectorConfig(*, start_m: float = 0.25, end_m: float = 3.0, max_step_length: Optional[int] = None, max_profile=Profile.PROFILE_5, close_range_leakage_cancellation: bool = True, signal_quality: float = 15.0, threshold_method=ThresholdMethod.CFAR, peaksorting_method=PeakSortingMethod.STRONGEST, reflector_shape=ReflectorShape.GENERIC, num_frames_in_recorded_threshold: int = 100, fixed_threshold_value: float = 100.0, threshold_sensitivity: float = 0.5, update_rate: Optional[float] = 50.0)#
start_m: float#

Start point of measurement interval in meters.

end_m: float#

End point of measurement interval in meters.

max_step_length: Optional[int]#

Used to limit step length. If no argument is provided, the step length is automatically calculated based on the profile.

max_profile: Profile#

Specifies the longest allowed profile. If no argument is provided, the highest possible profile without interference of direct leakage is used to maximize SNR.

close_range_leakage_cancellation: bool#

Enable close range leakage cancellation logic.

Close range leakage cancellation refers to the process of measuring close to the sensor(<100mm) by first characterizing the direct leakage, and then subtracting it from the measured sweep in order to isolate the signal component of interest.

The close range leakage cancellation process requires the sensor to be installed in its intended geometry with free space in front of the sensor during detector calibration.

signal_quality: float#

Signal quality. High quality equals higher HWAAS and better SNR but increase power consumption.

threshold_method: ThresholdMethod#

Threshold method

peaksorting_method: PeakSortingMethod#

Sorting method of estimated distances.

reflector_shape: ReflectorShape#

Reflector shape.

num_frames_in_recorded_threshold: int#

Number of frames used when calibrating threshold.

fixed_threshold_value: float#

Value of fixed threshold.

threshold_sensitivity: float#

Sensitivity of threshold. High sensitivity equals low detection threshold, low sensitivity equals high detection threshold.

update_rate: Optional[float]#

Sets the detector update rate.

class acconeer.exptool.a121.algo.distance.ThresholdMethod(value)#

Threshold methods. CFAR Constant False Alarm Rate. FIXED Fixed threshold. RECORDED Recorded threshold.

CFAR = 1#
FIXED = 2#
RECORDED = 3#
class acconeer.exptool.a121.algo.distance.PeakSortingMethod(value)#

Peak sorting methods. CLOSEST sort according to distance. STRONGEST sort according to strongest reflector.

CLOSEST = 1#
STRONGEST = 2#
class acconeer.exptool.a121.algo.distance.ReflectorShape(value)#

Reflector shape.

GENERIC Reflectors of any shape. PLANAR Planar shaped reflectors facing the radar, for example water surfaces.

GENERIC = 4#
PLANAR = 2#
property exponent: float#

Detector result#

class acconeer.exptool.a121.algo.distance._detector.DetectorResult(*, distances: Optional[npt.NDArray[np.float_]] = None, strengths: Optional[npt.NDArray[np.float_]] = None, near_edge_status: Optional[bool] = None, sensor_calibration_needed: Optional[bool] = None, temperature: Optional[int] = None, processor_results: list[ProcessorResult], service_extended_result: list[dict[int, Result]])#
distances: Optional[npt.NDArray[np.float_]]#

Estimated distances (m), sorted according to the selected peak sorting strategy.

strengths: Optional[npt.NDArray[np.float_]]#

Estimated reflector strengths corresponding to the peak amplitude of the estimated distances.

near_edge_status: Optional[bool]#

Boolean indicating an object close to the start edge, located outside of the measurement range.

sensor_calibration_needed: Optional[bool]#

Indication of sensor calibration needed. The sensor calibration needs to be redone if this indication is set.

A sensor calibration should be followed by a detector recalibration, by calling recalibrate_detector().

temperature: Optional[int]#

Temperature in sensor during measurement (in degree Celsius). Notice that this has poor absolute accuracy.

processor_results: list[ProcessorResult]#

Processing result. Used for visualization in Exploration Tool.

service_extended_result: list[dict[int, Result]]#

Service extended result. Used for visualization in Exploration Tool.