Smart Presence Reference Application

Contents

Smart Presence Reference Application#

Smart presence is based on the presence detector, see Presence Detector. The algorithm divides the presence detection range into multiple zones. Furthermore, it has the possibility to change configuration based on detection, as well as configure how many zones that need to have detection before switching configuration. This is perfect to utilize when a low power configuration is wanted for scanning and a more robust configuration is wanted to, e.g., track a person walking through the zones. Smart presence has the same configuration possibilities as the presence detector, with the additions to create multiple zones in the range, utilize the wake up mode and to set how many zones that need to have detection before switching configuration.

Detection zones#

The chosen range will be divided into the specified number of detection zones with equal size. The maximum number of detection zones is the number of measured points in the chosen range. To increase the maximum number of zones without extending the range, the step size can be decreased. This will increase the number of sampling points at the cost of increased power consumption. To get better distance resolution for the triggered zones, the chosen profile can be decreased. However, it should be remembered that the chosen profile needs to be large enough to get sufficient SNR in the complete range. Furthermore, the pulse extends outside the chosen detection range, hence it is possible to detect presence slightly outside of the chosen range. The extended detection range is dependent on the profile and is bounded by twice the full width at half maximum envelope power, see Radial resolution.

Detection types#

As for the presence detector, both fast and slow motions are considered. The triggered zones are reported back as a separate vector for fast motion detection, intra_zone_detections and for slow motion detection, inter_zone_detections, as well as one vector for the combined detections, total_zone_detections. For both slow and fast motions, the zone with the highest presence score is returned. The default for smart presence is to use both fast and slow motion detection to get a responsive detection, while at the same time having a stable detection when someone is being still. Since the fast presence detection has lower time constants in the filtering it is more responsive than the slow motion detection, thus the triggered zones for fast and slow motions can differ. The max_presence_zone is the zone with the most presence. However, the fast presence is prioritized due to faster responsiveness, i.e., if fast presence is detected (regardless of if slow presence is detected or not), the zone with the highest fast presence score is returned. If only slow presence is detected, the zone with the highest slow motion presence score is returned.

Wake up mode#

If wake_up_mode is enabled, the application will change configuration based on whether presence is detected or not. The wake up configuration has the possibility to divide the range into multiple zones, as well as setting how many zones that need detection in a two second period before switching configuration. The two seconds period is created by having the zone linger its trigger for two seconds when the detection is lost. When presence is detected, switching is automatically done to the nominal configuration. After switching, it takes some time before the nominal detector has gained detection due to the filtering in the presence detector. Because of this, there is a latency when switching. During this time, presence is assumed detected. The maximum latency time is set based on the filter constants in the nominal presence configuration. All the settings in the nominal configuration can be set differently compared to the wake up configuration if that is needed. However, the nominal configuration does not have the parameter for setting the number of zones needed for switching, since this is not relevant. The application will switch back to the wake up configuration when the presence detection is lost.

GUI#

In the GUI, the fast and slow presence score together with their respective threshold is displayed for easy adjustments. The detection zones are displayed in a circle sector. When wake up mode is enabled, two circle sectors are displayed, one representing the wake up configuration and one representing the nominal configuration. Green background indicates which configuration that is currently active. The zones will be colored with different colors showing detection and detection type. Blue indicates slow motion detection, orange indicates fast motion detection and green indicates that both have detection. Light gray is an additional color for the wake up configuration. It represents the two seconds lingering detection of a zone that has lost its detection, see section Wake up mode for more information. In the circle sector for the nominal configuration, it is possible to have only the distance with the maximum presence score displayed or to display all detected zones.

The upper plots in the example in Figure 25 show that fast motions are not detected, and slow motions are detected. The lower plot displays the range which is set to 1-3 m and that slow motions are detected in the middle zone.

../../_images/a121_smart_presence_gui.png

Figure 25 Example of the smart presence GUI. Inter presence is detecting presence in the middle zone, while intra presence is not detecting movement.#

Tests#

Test cases#

1. Human walking from Zone 3 -> Zone 1 (1-3 meters range)

2. Human walking through all zones from the side (1-3 meters range)

3. Human walking from Zone 3 -> Zone 1 (1-5 meters range)

4. Human walking through all zones from the side (1-5 meters range)

5. Human walking into wake up config and confirm detection. Continue walking and confirm detection is done with nominal config.

6. Human walking into wake up config and stops. Confirm detection in both wake up config and nominal config.

7. Ceiling mounted sensor. Human walking into wake up config and confirm detection. Continue walking and confirm detection is done with nominal config.

8. Ceiling mounted sensor. Human walking into wake up config and stops. Confirm detection in both wake up config and nominal config.

Test setup#

In these tests the A121 EVK was used. In the first test cases, the EVK was mounted on a wall at the same height as the test person’s torso, see Figure 26.

../../_images/smart_presence_setup.png

Figure 26 Sensor mounted on the wall. Setup used for test cases 1-6.#

In the later test cases, the EVK was mounted on the ceiling, see Figure 27.

../../_images/a121_smart_presence_ceiling.png

Figure 27 Sensor mounted on the ceiling about 3 m up from the floor. Setup used for test cases 7 and 8.#

Configuration#

For test cases 1-4, the configuration in Table 10 was used.

Table 10 Smart presence configurations. Where applicable, if only one value is displayed, the same value was used for both wake up and nominal configuration.#

Parameter

Test cases 1-4

Short range wake up / nominal

Medium range wake up / nominal

Long range wake up / nominal

Ceiling wake up / nominal

Range start

1 m

0.5 m / 0.06 m

1.5 m / 0.3 m

3 m / 2 m

2 m / 1.5 m

Range end

3 m / 5 m

1 m

2.5 m

5 m

3.5 m

Frame rate

10 Hz

2 Hz / 10 Hz

2 Hz / 12 Hz

2 Hz / 12 Hz

4 Hz / 12 Hz

Sweeps per frame

32

16

16

32

24 / 18

HWAAS

16

16

32

48

32 / 18

Inter frame idle state

Deep sleep

Deep sleep

Deep sleep

Deep sleep

Deep sleep

Enable intra frame detection

True

True

True

True

True

Intra detection threshold

1.30

1.50 / 1.40

1.50 / 1.30

1.40 / 1.20

1.50 / 1.20

Intra time constant

0.15 s

0.15 s

0.15 s

0.15 s

0.15

Intra output time constant

0.50 s

0.30 s

0.30 s

0.30 s

0.25 s / 0.3 s

Enable inter frame detection

True

True

True

True

True

Enable phase boost

False

False

False

False

False / True

Inter detection threshold

1.0

1.0

1.0

1.0 / 0.8

1.0 / 0.8

Inter fast cutoff frequency

20.0 Hz

5 Hz

6 Hz

6 Hz

6 Hz

Inter slow cutoff frequency

0.2 Hz

0.2 Hz

0.2 Hz

0.2 Hz

0.2 Hz

Inter time constant

0.5 s

0.5 s

0.5 s

0.5 s

0.5 s

Inter output time constant

3.0 s

2.0 s

2.0 s

2.0 s

0.5 s / 2.0 s

Inter presence timeout

3 s

3 s

3 s

3 s

3 s

Number of zones

3

1 / 5

1 / 7

5

1

Number of zones for wake up

1

1

2

1

Test cases 5 and 6 were tested for the short range, medium range and long range presets. Test cases 7 and 8 were tested for the ceiling preset.

Results#

1. Human walking from Zone 3 -> Zone 1 (1-3 meters range)

../../_images/smart_presence_test1_a.png ../../_images/smart_presence_test1_b.png
Table 11 Smart presence test results for test cases 1-4. All zones were detected successfully when walking towards the sensor and each zone was successfully detected when passing by.#

Zone

Walk towards

Pass by

0 (1-3 m range)

OK

OK

1 (1-3 m range)

OK

OK

2 (1-3 m range)

OK

OK

0 (1-5 m range)

OK

OK

1 (1-5 m range)

OK

OK

2 (1-5 m range)

OK

OK

5. Human walking into wake up config and confirm detection. Continue walking and confirm detection is done with nominal config.

../../_images/a121_smart_presence_short_nominal_config.png

Figure 28 Person detected in the middle detection zone with nominal configuration.#

Table 12 Smart presence test results for test cases 5-8. Presence was detected and configuration changed successfully for all test cases.#

Preset

Walk

Walk and stop

Short range

OK

OK

Medium range

OK

OK

Long range

OK

OK

Ceiling

OK

OK

Configuration parameters#

class acconeer.exptool.a121.algo.smart_presence._ref_app.RefAppConfig(*, nominal_config: PresenceZoneConfig = NOTHING, wake_up_config: PresenceWakeUpConfig | None = NOTHING, wake_up_mode: bool = True, show_all_detected_zones: bool = False)#
nominal_config: PresenceZoneConfig#

Configuration used to keep detection.

wake_up_config: PresenceWakeUpConfig | None#

Configuration used for wake up.

wake_up_mode: bool#

Switch between two configurations based on presence detection.

show_all_detected_zones: bool#

Visualize all detected zones in the circle sector.

class acconeer.exptool.a121.algo.smart_presence._ref_app.PresenceZoneConfig(*, start_m: float = 0.3, end_m: float = 2.5, profile: Profile | None = None, step_length: int | None = None, frame_rate: float = 12.0, sweeps_per_frame: int = 16, automatic_subsweeps: bool = False, signal_quality: float = 15.0, hwaas: int = 32, inter_frame_idle_state: IdleState = IdleState.DEEP_SLEEP, intra_enable: bool = True, intra_detection_threshold: float = 1.3, intra_frame_time_const: float = 0.15, intra_output_time_const: float = 0.3, inter_enable: bool = True, inter_detection_threshold: float = 1, inter_frame_fast_cutoff: float = 6.0, inter_frame_slow_cutoff: float = 0.2, inter_frame_deviation_time_const: float = 0.5, inter_output_time_const: float = 2, inter_phase_boost: bool = False, inter_frame_presence_timeout: int | None = 3, num_zones: int = 7)#
num_zones: int#

Maximum number of detection zones.

automatic_subsweeps: bool#

Automatically select subsweeps and configure HWAAS.

end_m: float#

End point of measurement interval in meters.

frame_rate: float#

Frame rate in Hz.

hwaas: int#

Number of HWAAS.

inter_detection_threshold: float#

Detection threshold for the inter-frame presence detection.

inter_enable: bool#

Enables the inter-frame presence detection used for detecting slower movements between frames.

inter_frame_deviation_time_const: float#

Time constant of the low pass filter for the inter-frame deviation between fast and slow.

inter_frame_fast_cutoff: float#

Cutoff frequency of the low pass filter for the fast filtered absolute sweep mean. No filtering is applied if the cutoff is set over half the frame rate (Nyquist limit).

inter_frame_idle_state: IdleState#

Sets the inter frame idle state.

inter_frame_presence_timeout: int | None#

Number of seconds the inter-frame presence score needs to decrease before exponential scaling starts for faster decline.

inter_frame_slow_cutoff: float#

Cutoff frequency of the low pass filter for the slow filtered absolute sweep mean.

inter_output_time_const: float#

Time constant for the output in the inter-frame part.

inter_phase_boost: bool#

Enables the inter-frame phase boost. Used to increase slow motion detection.

intra_detection_threshold: float#

Detection threshold for the intra-frame presence detection.

intra_enable: bool#

Enables the intra-frame presence detection used for detecting faster movements inside frames.

intra_frame_time_const: float#

Time constant for the depthwise filtering in the intra-frame part.

intra_output_time_const: float#

Time constant for the output in the intra-frame part.

profile: Profile | None#

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

signal_quality: float#

Signal quality measurement (higher = better signal, lower = less power consumption).

start_m: float#

Start point of measurement interval in meters.

step_length: int | None#

Step length in points. If no argument is provided, the step length is automatically calculated based on the profile.

sweeps_per_frame: int#

Number of sweeps per frame.

class acconeer.exptool.a121.algo.smart_presence._ref_app.PresenceWakeUpConfig(*, start_m: float = 0.3, end_m: float = 2.5, profile: Profile | None = None, step_length: int | None = None, frame_rate: float = 12.0, sweeps_per_frame: int = 16, automatic_subsweeps: bool = False, signal_quality: float = 15.0, hwaas: int = 32, inter_frame_idle_state: IdleState = IdleState.DEEP_SLEEP, intra_enable: bool = True, intra_detection_threshold: float = 1.3, intra_frame_time_const: float = 0.15, intra_output_time_const: float = 0.3, inter_enable: bool = True, inter_detection_threshold: float = 1, inter_frame_fast_cutoff: float = 6.0, inter_frame_slow_cutoff: float = 0.2, inter_frame_deviation_time_const: float = 0.5, inter_output_time_const: float = 2, inter_phase_boost: bool = False, inter_frame_presence_timeout: int | None = 3, num_zones: int = 7, num_zones_for_wake_up: int = 1)#
num_zones_for_wake_up: int#

Number of detected zones needed for wake up.

automatic_subsweeps: bool#

Automatically select subsweeps and configure HWAAS.

end_m: float#

End point of measurement interval in meters.

frame_rate: float#

Frame rate in Hz.

hwaas: int#

Number of HWAAS.

inter_detection_threshold: float#

Detection threshold for the inter-frame presence detection.

inter_enable: bool#

Enables the inter-frame presence detection used for detecting slower movements between frames.

inter_frame_deviation_time_const: float#

Time constant of the low pass filter for the inter-frame deviation between fast and slow.

inter_frame_fast_cutoff: float#

Cutoff frequency of the low pass filter for the fast filtered absolute sweep mean. No filtering is applied if the cutoff is set over half the frame rate (Nyquist limit).

inter_frame_idle_state: IdleState#

Sets the inter frame idle state.

inter_frame_presence_timeout: int | None#

Number of seconds the inter-frame presence score needs to decrease before exponential scaling starts for faster decline.

inter_frame_slow_cutoff: float#

Cutoff frequency of the low pass filter for the slow filtered absolute sweep mean.

inter_output_time_const: float#

Time constant for the output in the inter-frame part.

inter_phase_boost: bool#

Enables the inter-frame phase boost. Used to increase slow motion detection.

intra_detection_threshold: float#

Detection threshold for the intra-frame presence detection.

intra_enable: bool#

Enables the intra-frame presence detection used for detecting faster movements inside frames.

intra_frame_time_const: float#

Time constant for the depthwise filtering in the intra-frame part.

intra_output_time_const: float#

Time constant for the output in the intra-frame part.

num_zones: int#

Maximum number of detection zones.

profile: Profile | None#

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

signal_quality: float#

Signal quality measurement (higher = better signal, lower = less power consumption).

start_m: float#

Start point of measurement interval in meters.

step_length: int | None#

Step length in points. If no argument is provided, the step length is automatically calculated based on the profile.

sweeps_per_frame: int#

Number of sweeps per frame.

Reference app result#

class acconeer.exptool.a121.algo.smart_presence._ref_app.RefAppResult(*, zone_limits: npt.NDArray[np.float64], presence_detected: bool, max_presence_zone: int | None, total_zone_detections: npt.NDArray[np.int_], inter_presence_score: float, inter_zone_detections: npt.NDArray[np.int_], max_inter_zone: int | None, intra_presence_score: float, intra_zone_detections: npt.NDArray[np.int_], max_intra_zone: int | None, used_config: _Mode, wake_up_detections: npt.NDArray[np.int_] | None, switch_delay: bool, service_result: Result)#
zone_limits: ndarray[Any, dtype[float64]]#

The upper limit for each zone.

presence_detected: bool#

True if presence was detected, False otherwise.

max_presence_zone: int | None#

The zone for maximum presence score if presence detected, else None.

total_zone_detections: ndarray[Any, dtype[int64]]#

Detection result for all zones.

inter_presence_score: float#

A measure of the amount of slow motion detected.

inter_zone_detections: ndarray[Any, dtype[int64]]#

Slow motion presence detection result for all zones.

max_inter_zone: int | None#

The zone for maximum slow motion presence score if slow presence detected, else None.

intra_presence_score: float#

A measure of the amount of fast motion detected.

intra_zone_detections: ndarray[Any, dtype[int64]]#

Fast motion presence detection result for all zones.

max_intra_zone: int | None#

The zone for maximum fast motion presence score if fast presence detected, else None.

used_config: _Mode#

The configuration used for the measurement.

wake_up_detections: ndarray[Any, dtype[int64]] | None#

Wake up detection result.

switch_delay: bool#

True if data was collected during switch delay.