acc_detector_presence.h
Go to the documentation of this file.
1 // Copyright (c) Acconeer AB, 2022-2024
2 // All rights reserved
3 
4 #ifndef ACC_DETECTOR_PRESENCE_H_
5 #define ACC_DETECTOR_PRESENCE_H_
6 
7 #include <stdbool.h>
8 #include <stddef.h>
9 #include <stdint.h>
10 
11 #include "acc_definitions_a121.h"
12 #include "acc_definitions_common.h"
13 #include "acc_processing.h"
14 #include "acc_sensor.h"
15 
16 /**
17  * @defgroup Presence Presence Detector
18  * @ingroup Detectors
19  *
20  * @brief Presence detector API description
21  *
22  * For a detailed description of the presence detector algorithm and its
23  * configuration parameters, see
24  * <a href="https://docs.acconeer.com/en/latest/exploration_tool/algo/a121/detectors/presence_detection.html">
25  * docs.acconeer.com</a>
26  *
27  * @{
28  */
29 
30 
31 /**
32  * @brief Presence detector handle
33  */
34 struct acc_detector_presence_handle;
35 
36 typedef struct acc_detector_presence_handle acc_detector_presence_handle_t;
37 
38 
39 /**
40  * @brief Presence detector configuration container
41  */
42 struct acc_detector_presence_config;
43 
44 typedef struct acc_detector_presence_config acc_detector_presence_config_t;
45 
46 
47 /**
48  * @brief Presence detector results container
49  */
50 typedef struct
51 {
52  /**
53  * true if presence was detected, false otherwise
54  */
56  /**
57  * A measure of the amount of fast motion detected
58  */
60  /**
61  * A measure of the amount of slow motion detected
62  */
64  /**
65  * The distance, in meters, to the detected object
66  */
68  /**
69  * An array of measures of the amount of fast motion detected per distance point.
70  * This will point to memory in the buffer supplied to @ref acc_detector_presence_process
71  */
73  /**
74  * An array of measures of the amount of slow motion detected per distance point.
75  * This will point to memory in the buffer supplied to @ref acc_detector_presence_process
76  */
78  /**
79  * The number of elements in the depthwise presence scores arrays
80  */
82  /**
83  * Radar data that the presence detection is based on.
84  * This will point to memory in the buffer supplied to @ref acc_detector_presence_process
85  */
88 
89 
90 /**
91  * brief Metadata for presence detector
92  */
93 typedef struct
94 {
95  /**
96  * Actual start point of measurement in m.
97  * This can be useful to know the exact start point of the measurement in m.
98  * The resolution of each point is approximately 2.5mm
99  */
100  float start_m;
101  /**
102  * Actual end point of measurement in m.
103  * This can be useful to know the exact end point of the measurement in m.
104  * The resolution of each point is approximately 2.5mm
105  */
106  float end_m;
107  /**
108  * Actual step length between each data point of the measurement in m.
109  * This can be useful when automatic selection of step length based on the profile
110  * is enabled through @ref acc_detector_presence_config_auto_step_length_set
111  * NOTE! Only valid if automatic_subsweeps is disabled
112  */
114  /**
115  * Number of data points in measurement.
116  * This is calculated from the requested start and end point and the resulting
117  * step length. This corresponds to the length of the depthwise inter/intra
118  * presence score results, which can be useful to know already at detector creation.
119  */
120  uint16_t num_points;
121  /**
122  * Profile used.
123  * This can be useful when automatic selection of profile based on start point
124  * is enabled through @ref acc_detector_presence_config_auto_profile_set
125  * NOTE! Only valid if automatic_subsweeps is disabled
126  */
129 
130 
131 /**
132  * @brief Create a configuration for a presence detector
133  *
134  * @return Presence detector configuration, NULL if creation was not possible
135  */
137 
138 
139 /**
140  * @brief Destroy a presence detector configuration
141  *
142  * @param[in] presence_config The configuration to destroy
143  */
145 
146 
147 /**
148  * @brief Print a configuration to the log
149  *
150  * @param[in] presence_config The configuration to log
151  */
153 
154 
155 /**
156  * @brief Get the buffer size needed for the provided presence detector handle
157  *
158  * This buffer size can be used to allocate a memory buffer in the
159  * application, which is needed for several functions in the detector library.
160  * This size will also include memory for holding the depthwise inter/intra presence
161  * score arrays that will be part of the result, see @ref acc_detector_presence_result_t
162  *
163  * @param[in] presence_handle The presence detector handle to to get the buffer size for
164  * @param[out] buffer_size The buffer size
165  * @return true if successful, false otherwise
166  */
167 bool acc_detector_presence_get_buffer_size(const acc_detector_presence_handle_t *presence_handle, uint32_t *buffer_size);
168 
169 
170 /**
171  * @brief Create a presence detector with the provided configuration
172  *
173  * @param[in] presence_config The presence detector configuration to create a presence detector with
174  * @param[out] metadata Metadata for the presence detector given the presence_config
175  * @return Presence detector handle, NULL if presence detector was not possible to create
176  */
179 
180 
181 /**
182  * @brief Destroy a presence detector identified with the provided handle
183  *
184  * Destroy the context of a presence detector allowing another presence detector to be created using the
185  * same resources.
186  * If NULL is sent in, nothing happens.
187  *
188  * @param[in] presence_handle A reference to the presence detector handle to destroy
189  */
191 
192 
193 /**
194  * @brief Prepare the detector to do a measurement
195  *
196  * @param[in] presence_handle The presence detector handle to prepare for
197  * @param[in] presence_config The configuration to prepare with
198  * @param[in] sensor The sensor instance to prepare
199  * @param[in] cal_result The calibration result to prepare with
200  * @param[in] buffer Memory used by the detector to prepare the sensor for measurements
201  * The buffer will only be used during the duration of this call
202  * @param[in] buffer_size The size in bytes of the buffer, should be at least buffer_size
203  * from @ref acc_detector_presence_get_buffer_size
204  * @return true if successful, false otherwise
205  */
207  acc_sensor_t *sensor, const acc_cal_result_t *cal_result, void *buffer, uint32_t buffer_size);
208 
209 
210 /**
211  * @brief Process the data according to the configuration used in @ref acc_detector_presence_config_create
212  *
213  * @param[in] presence_handle The presence detector handle for the presence detector to get the next result for
214  * @param[in] buffer A reference to the buffer (populated by @ref acc_sensor_read) containing the
215  * data to be processed.
216  * After this function returns, the depthwise inter/intra presence that is part of the
217  * result (@ref acc_detector_presence_result_t) will point to memory located in this buffer.
218  * If these arrays are of interest for the application they need to be processed
219  * before the buffer is used in any other function.
220  * @param[out] result Presence detector results
221  * @return true if successful, otherwise false
222  */
223 bool acc_detector_presence_process(acc_detector_presence_handle_t *presence_handle, void *buffer,
225 
226 
227 /**
228  * @brief Set the start point of measurement interval in meters
229  *
230  * @param[in] presence_config The configuration
231  * @param[in] start The start point of measurement interval in meters
232  */
234 
235 
236 /**
237  * @brief Get the start point of measurement interval in meters
238  *
239  * @param[in] presence_config The configuration
240  * @return The start point of measurement interval in meters
241  */
243 
244 
245 /**
246  * @brief Set the end point of measurement interval in meters
247  *
248  * @param[in] presence_config The configuration
249  * @param[in] end The end point of measurement interval in meters
250  */
252 
253 
254 /**
255  * @brief Get the end point of measurement interval in meters
256  *
257  * @param[in] presence_config The configuration
258  * @return The end point of measurement interval in meters
259  */
261 
262 
263 /**
264  * @brief Set the step length in points
265  *
266  * This sets the number of steps between each data point.
267  *
268  * The set step length will only be used if step length auto selection was disabled
269  * through @ref acc_detector_presence_config_auto_step_length_set
270  *
271  * Sampling produces complex (IQ) data points with configurable distance spacing,
272  * starting from ~2.5mm.
273  *
274  * NOTE! Only used if automatic_subsweeps is set to false
275  *
276  * @param[in] presence_config The configuration
277  * @param[in] step_length The step length
278  */
279 void acc_detector_presence_config_step_length_set(acc_detector_presence_config_t *presence_config, uint16_t step_length);
280 
281 
282 /**
283  * @brief Get the step length in points
284  *
285  * @see acc_detector_presence_config_step_length_set
286  *
287  * @param[in] presence_config The configuration
288  * @return The step length
289  */
291 
292 
293 /**
294  * @brief Enable automatic selection of step length based on the profile
295  *
296  * The highest possible step length based on the fwhm of the set profile
297  * with the goal to achieve detection on the complete range with minimum number
298  * of sampling points
299  *
300  * NOTE! Only used if automatic_subsweeps is set to false
301  *
302  * @param[in] presence_config The configuration
303  * @param[in] enable true to enable auto selection, false to disable
304  */
306 
307 
308 /**
309  * @brief Get if automatic selection of step length based on the profile is enabled
310  *
311  * See @ref acc_detector_presence_config_auto_step_length_set
312  *
313  * @param[in] presence_config The configuration
314  * @return true if automatic selection of step length is enabled, false if disabled
315  */
317 
318 
319 /**
320  * @brief Set a profile
321  *
322  * Each profile consists of a number of settings for the sensor that configures
323  * the RX and TX paths. Lower profiles have higher depth resolution while
324  * higher profiles have higher SNR.
325  *
326  * The set profile will only be used if profile auto selection was disabled
327  * through @ref acc_detector_presence_config_auto_profile_set
328  *
329  * NOTE! Only used if automatic_subsweeps is set to false
330  *
331  * @param[in] presence_config The configuration
332  * @param[in] profile The profile to set
333  */
335 
336 
337 /**
338  * @brief Get the currently set profile
339  *
340  * See @ref acc_detector_presence_config_profile_set
341  *
342  * @param[in] presence_config The configuration
343  * @return The profile currently used
344  */
346 
347 
348 /**
349  * @brief Enable automatic selection of profile based on start point of measurement
350  *
351  * The highest possible profile without interference of direct leakage will used to maximize SNR
352  *
353  * NOTE! Only used if automatic_subsweeps is set to false
354  *
355  * @param[in] presence_config The configuration
356  * @param[in] enable true to enable auto selection, false to disable
357  */
359 
360 
361 /**
362  * @brief Get if automatic selection of profile based on start point of measurement is enabled
363  *
364  * See @ref acc_detector_presence_config_auto_profile_set
365  *
366  * @param[in] presence_config The configuration
367  * @return true if automatic selection of profile is enabled, false if disabled
368  */
370 
371 
372 /**
373  * @brief Set inter frame idle state
374  *
375  * The 'inter-frame idle state' is the state the sensor idles in between each frame.
376  *
377  * See also @ref acc_config_idle_state_t.
378  *
379  * @param[in] presence_config The configuration
380  * @param[in] idle_state The idle state to use between frames
381  */
383  acc_config_idle_state_t idle_state);
384 
385 
386 /**
387  * @brief Get inter frame idle state
388  *
389  * See @ref acc_detector_presence_config_inter_frame_idle_state_set
390  *
391  * @param[in] presence_config The configuration
392  * @return The idle state to use between frames
393  */
395 
396 
397 /**
398  * @brief Set the hardware accelerated average samples (HWAAS)
399  *
400  * See @ref acc_config_hwaas_set for more details
401  *
402  * @param[in] presence_config The configuration
403  * @param[in] hwaas Hardware accelerated average samples
404  */
405 void acc_detector_presence_config_hwaas_set(acc_detector_presence_config_t *presence_config, uint16_t hwaas);
406 
407 
408 /**
409  * @brief Get the hardware accelerated average samples (HWAAS)
410  *
411  * See @ref acc_detector_presence_config_hwaas_set
412  *
413  * @param[in] presence_config The configuration
414  * @return Hardware accelerated average samples
415  */
417 
418 
419 /**
420  * @brief Set the number of sweeps per frame
421  *
422  * Sets the number of sweeps that will be captured in each frame (measurement).
423  *
424  * @param[in] presence_config The configuration
425  * @param[in] sweeps_per_frame Sweeps per frame, must be at least 6
426  */
427 void acc_detector_presence_config_sweeps_per_frame_set(acc_detector_presence_config_t *presence_config, uint16_t sweeps_per_frame);
428 
429 
430 /**
431  * @brief Get the number of sweeps per frame
432  *
433  * See @ref acc_detector_presence_config_sweeps_per_frame_set
434  *
435  * @param[in] presence_config The configuration
436  * @return Sweeps per frame
437  */
439 
440 
441 /**
442  * @brief Set the frame rate
443  *
444  * This frame rate is maintained by the sensor if @ref acc_detector_presence_config_frame_rate_app_driven_set
445  * is invoked with false (default) and the application must maintain the given frame rate if invoked with true.
446  * If the application maintains the frame rate it is important that it doesn't deviate more than 10%
447  * from the set value for the presence algorithm to work optimally.
448  * See @ref acc_config_frame_rate_set for details
449  *
450  * @param[in] presence_config The configuration
451  * @param[in] frame_rate Frame rate in Hz. Must be > 0
452  */
453 void acc_detector_presence_config_frame_rate_set(acc_detector_presence_config_t *presence_config, float frame_rate);
454 
455 
456 /**
457  * @brief Get the frame rate
458  *
459  * See @ref acc_detector_presence_config_frame_rate_set
460  *
461  * @param[in] presence_config The configuration
462  * @return Frame rate in Hz
463  */
465 
466 
467 /**
468  * @brief Set if the application should maintain the requested frame rate
469  *
470  * If set to true, the application must maintain the frame rate set using
471  * @ref acc_detector_presence_config_frame_rate_set
472  * If set to false, the frame rate is maintained by the sensor at the frame rate given by
473  * @ref acc_detector_presence_config_frame_rate_set.
474  *
475  * @param[in] presence_config The configuration
476  * @param[in] enable true to enable application driven frame rate, false to disable
477  */
479 
480 
481 /**
482  * @brief Get if the application should maintain the requested frame rate
483  *
484  * See @ref acc_detector_presence_config_frame_rate_app_driven_set
485  *
486  * @param[in] presence_config The configuration
487  * @return true if application driven frame rate is enabled, false if disabled
488  */
490 
491 
492 /**
493  * @brief Set sensor ID
494  *
495  * @param[in] presence_config The configuration to set the sensor ID for
496  * @param[in] sensor_id The sensor ID
497  */
499 
500 
501 /**
502  * @brief Get sensor ID
503  *
504  * @param[in] presence_config The configuration to get the sensor ID for
505  * @return sensor ID
506  */
508 
509 
510 /**
511  * @brief Set if the presence filters should reset on prepare
512  *
513  * If set to true, the presence filters will be reset when
514  * @ref acc_detector_presence_prepare is invoked.
515  *
516  * @param[in] presence_config The configuration
517  * @param[in] enable true to reset the filters on prepare, false to not reset
518  */
520 
521 
522 /**
523  * @brief Get if the presence filters should reset on prepare
524  *
525  * See @ref acc_detector_presence_config_reset_filters_on_prepare_set
526  *
527  * @param[in] presence_config The configuration
528  * @return true if filters should reset on prepare, false otherwise
529  */
531 
532 
533 /**
534  * @brief Set the inter-frame presence timeout in seconds
535  *
536  * Number of seconds the inter-frame presence score needs to decrease before exponential
537  * scaling starts for faster decline. Should be between 0 and 30 where 0 means no timeout
538  *
539  * @param[in] presence_config The configuration
540  * @param[in] inter_frame_presence_timeout Timeout in seconds between 0 and 30
541  */
543  uint16_t inter_frame_presence_timeout);
544 
545 
546 /**
547  * @brief Get the inter-frame presence timeout in seconds
548  *
549  * See @ref acc_detector_presence_config_inter_frame_presence_timeout_set
550  *
551  * @param[in] presence_config The configuration
552  * @return Inter-frame presence timeout in s
553  */
555 
556 
557 /**
558  * @brief Set inter-frame phase boost
559  *
560  * Used to increase detection of slow motions by utilizing the phase information in the Sparse IQ data.
561  *
562  * @param[in] presence_config The configuration to set inter phase boost for
563  * @param[in] enable true if inter phase boost should be enabled
564  */
566 
567 
568 /**
569  * @brief Get if inter-frame phase boost is enabled
570  *
571  * See @ref acc_detector_presence_config_inter_phase_boost_set
572  *
573  * @param[in] presence_config The configuration to get inter phase boost for
574  * @return true if inter-frame phase boost is enabled, false otherwise
575  */
577 
578 
579 /**
580  * @brief Set intra-frame presence detection
581  *
582  * This is used for detecting faster movements inside frames
583  *
584  * @param[in] presence_config The configuration to set intra-frame detection for
585  * @param[in] enable true if intra-frame detection should be enabled
586  */
588 
589 
590 /**
591  * @brief Get if frame intra-frame presence detection is enabled
592  *
593  * See @ref acc_detector_presence_config_intra_detection_set
594  *
595  * @param[in] presence_config The configuration to get intra detection for
596  * @return true if intra-frame detection is enabled, false otherwise
597  */
599 
600 
601 /**
602  * @brief Set the detection threshold for the intra-frame presence detection
603  *
604  * This is the threshold for detecting faster movements inside frames
605  *
606  * @param[in] presence_config The configuration to set the detection threshold for
607  * @param[in] intra_detection_threshold The intra-frame detection threshold to set
608  */
610  float intra_detection_threshold);
611 
612 
613 /**
614  * @brief Get the detection threshold for the intra-frame presence detection
615  *
616  * See @ref acc_detector_presence_config_intra_detection_threshold_set
617  *
618  * @param[in] presence_config The configuration to get the detection threshold for
619  * @return The intra-frame detection threshold
620  */
622 
623 
624 /**
625  * @brief Set inter-frame presence detection
626  *
627  * This is used for detecting slower movements between frames
628  *
629  * @param[in] presence_config The configuration to set inter-frame detection for
630  * @param[in] enable true if inter-frame presence detection should be enabled
631  */
633 
634 
635 /**
636  * @brief Get if inter-frame presence detection is enabled
637  *
638  * See @ref acc_detector_presence_config_inter_detection_set
639  *
640  * @param[in] presence_config The configuration to get inter-frame presence detection for
641  * @return true if inter-frame presence detection is enabled, false otherwise
642  */
644 
645 
646 /**
647  * @brief Set the detection threshold for the inter-frame presence detection
648  *
649  * This is the threshold for detecting slower movements between frames
650  *
651  * @param[in] presence_config The configuration to set the detection threshold for
652  * @param[in] inter_detection_threshold The threshold
653  */
655  float inter_detection_threshold);
656 
657 
658 /**
659  * @brief Get the detection threshold for the inter-frame presence detection
660  *
661  * See @ref acc_detector_presence_config_inter_detection_threshold_set
662  *
663  * @param[in] presence_config The configuration to get the detection threshold for
664  * @return detection threshold
665  */
667 
668 
669 /**
670  * @brief Set the time constant of the low pass filter for the inter-frame deviation between fast and slow
671  *
672  * @param[in] presence_config The configuration
673  * @param[in] inter_frame_deviation_time_const Time constant to set
674  */
676  float inter_frame_deviation_time_const);
677 
678 
679 /**
680  * @brief Get the time constant of the low pass filter for the inter-frame deviation between fast and slow
681  *
682  * @param[in] presence_config The configuration to get the time constant for
683  * @return time constant in s
684  */
686 
687 
688 /**
689  * @brief Set the cutoff frequency of the low pass filter for the fast filtered absolute sweep mean
690  *
691  * No filtering is applied if the cutoff is set over half the frame rate (Nyquist limit).
692  *
693  * @param[in] presence_config The configuration
694  * @param[in] inter_frame_fast_cutoff Cutoff frequency to set
695  */
697  float inter_frame_fast_cutoff);
698 
699 
700 /**
701  * @brief Get the cutoff frequency of the low pass filter for the fast filtered absolute sweep mean
702  *
703  * @param[in] presence_config The configuration to get the cutoff frequency for
704  * @return the cutoff frequency in Hz
705  */
707 
708 
709 /**
710  * @brief Set the cutoff frequency of the low pass filter for the slow filtered absolute sweep mean
711  *
712  * @param[in] presence_config The configuration
713  * @param[in] inter_frame_slow_cutoff Cutoff frequency to set
714  */
716  float inter_frame_slow_cutoff);
717 
718 
719 /**
720  * @brief Get the cutoff frequency of the low pass filter for the slow filtered absolute sweep mean
721  *
722  * @param[in] presence_config The configuration to get the cutoff frequency for
723  * @return the cutoff frequency in Hz
724  */
726 
727 
728 /**
729  * @brief Set the time constant for the depthwise filtering in the intra-frame part
730  *
731  * @param[in] presence_config The configuration
732  * @param[in] intra_frame_time_const Time constant to set
733  */
735  float intra_frame_time_const);
736 
737 
738 /**
739  * @brief Get the time constant for the depthwise filtering in the intra-frame part
740  *
741  * @param[in] presence_config The configuration to get the time constant for
742  * @return time constant in s
743  */
745 
746 
747 /**
748  * @brief Set the time constant for the output in the intra-frame part
749  *
750  * @param[in] presence_config The configuration
751  * @param[in] intra_output_time_const Time constant to set
752  */
754  float intra_output_time_const);
755 
756 
757 /**
758  * @brief Get the time constant for the output in the intra-frame part
759  *
760  * @param[in] presence_config The configuration to get the time constant for
761  * @return time constant in s
762  */
764 
765 
766 /**
767  * @brief Set the time constant for the output in the inter-frame part
768  *
769  * @param[in] presence_config The configuration
770  * @param[in] inter_output_time_const Time constant to set
771  */
773  float inter_output_time_const);
774 
775 
776 /**
777  * @brief Get the time constant for the output in the inter-frame part
778  *
779  * @param[in] presence_config The configuration to get the time constant for
780  * @return time constant in s
781  */
783 
784 
785 /**
786  * @brief Set if automatic subsweeps should be used
787  *
788  * Enabling subsweeps will make the presence detector utilize subsweeps.
789  * This will automatically optimize settings for the selected range.
790  * This setting will disable other settings and automatically overwrite their values.
791  *
792  * @param[in] presence_config The configuration to set enable automatic subsweeps for
793  * @param[in] automatic_subsweeps Enable automatic subsweeps setting, true will enable the setting
794  */
795 void acc_detector_presence_config_automatic_subsweeps_set(acc_detector_presence_config_t *presence_config, bool automatic_subsweeps);
796 
797 
798 /**
799  * @brief Get if automatic subsweeps should be used
800  *
801  * @param[in] presence_config The configuration to get enable automatic subsweeps for
802  * @return Enable automatic subsweeps, true if enabled.
803  */
805 
806 
807 /**
808  * @brief Set signal quality
809  *
810  * Only used if automatic subsweeps is enabled.
811  *
812  * @param[in] presence_config The configuration to set signal quality for
813  * @param[in] signal_quality Signal quality to use
814  */
815 void acc_detector_presence_config_signal_quality_set(acc_detector_presence_config_t *presence_config, float signal_quality);
816 
817 
818 /**
819  * @brief Get signal quality
820  *
821  * @param[in] presence_config The configuration to get signal quality for
822  * @return Signal quality
823  */
825 
826 
827 /**
828  * @brief Calculate distance in meter for a point in a sweep (including subsweeps)
829  *
830  * @param[in] presence_handle The presence detector handle
831  * @param[in] point_idx Index for distance point in sweep
832  * @return Distance in meters
833  */
834 float acc_detector_presence_get_distance_m(const acc_detector_presence_handle_t *presence_handle, uint16_t point_idx);
835 
836 
837 /**
838  * @}
839  */
840 
841 #endif
acc_detector_presence_result_t::inter_presence_score
float inter_presence_score
Definition: acc_detector_presence.h:63
acc_detector_presence_config_inter_detection_set
void acc_detector_presence_config_inter_detection_set(acc_detector_presence_config_t *presence_config, bool enable)
Set inter-frame presence detection.
acc_detector_presence_config_sweeps_per_frame_set
void acc_detector_presence_config_sweeps_per_frame_set(acc_detector_presence_config_t *presence_config, uint16_t sweeps_per_frame)
Set the number of sweeps per frame.
acc_detector_presence_destroy
void acc_detector_presence_destroy(acc_detector_presence_handle_t *presence_handle)
Destroy a presence detector identified with the provided handle.
acc_detector_presence_config_hwaas_set
void acc_detector_presence_config_hwaas_set(acc_detector_presence_config_t *presence_config, uint16_t hwaas)
Set the hardware accelerated average samples (HWAAS)
acc_processing_result_t
Result provided by the processing module.
Definition: acc_processing.h:71
acc_detector_presence_result_t::depthwise_presence_scores_length
uint32_t depthwise_presence_scores_length
Definition: acc_detector_presence.h:81
acc_detector_presence_config_inter_phase_boost_set
void acc_detector_presence_config_inter_phase_boost_set(acc_detector_presence_config_t *presence_config, bool enable)
Set inter-frame phase boost.
acc_detector_presence_config_inter_frame_deviation_time_const_set
void acc_detector_presence_config_inter_frame_deviation_time_const_set(acc_detector_presence_config_t *presence_config, float inter_frame_deviation_time_const)
Set the time constant of the low pass filter for the inter-frame deviation between fast and slow.
acc_detector_presence_metadata_t::step_length_m
float step_length_m
Definition: acc_detector_presence.h:113
acc_detector_presence_config_reset_filters_on_prepare_get
bool acc_detector_presence_config_reset_filters_on_prepare_get(const acc_detector_presence_config_t *presence_config)
Get if the presence filters should reset on prepare.
acc_detector_presence_config_auto_profile_set
void acc_detector_presence_config_auto_profile_set(acc_detector_presence_config_t *presence_config, bool enable)
Enable automatic selection of profile based on start point of measurement.
acc_detector_presence_result_t::processing_result
acc_processing_result_t processing_result
Definition: acc_detector_presence.h:86
acc_detector_presence_config_start_get
float acc_detector_presence_config_start_get(const acc_detector_presence_config_t *presence_config)
Get the start point of measurement interval in meters.
acc_cal_result_t
The result from a completed calibration.
Definition: acc_definitions_a121.h:32
acc_detector_presence_config_frame_rate_set
void acc_detector_presence_config_frame_rate_set(acc_detector_presence_config_t *presence_config, float frame_rate)
Set the frame rate.
acc_detector_presence_config_inter_output_time_const_get
float acc_detector_presence_config_inter_output_time_const_get(const acc_detector_presence_config_t *presence_config)
Get the time constant for the output in the inter-frame part.
acc_detector_presence_metadata_t::start_m
float start_m
Definition: acc_detector_presence.h:100
acc_detector_presence_metadata_t::profile
acc_config_profile_t profile
Definition: acc_detector_presence.h:127
acc_detector_presence_get_buffer_size
bool acc_detector_presence_get_buffer_size(const acc_detector_presence_handle_t *presence_handle, uint32_t *buffer_size)
Get the buffer size needed for the provided presence detector handle.
acc_detector_presence_result_t::presence_detected
bool presence_detected
Definition: acc_detector_presence.h:55
acc_detector_presence_config_intra_detection_threshold_set
void acc_detector_presence_config_intra_detection_threshold_set(acc_detector_presence_config_t *presence_config, float intra_detection_threshold)
Set the detection threshold for the intra-frame presence detection.
acc_detector_presence_get_distance_m
float acc_detector_presence_get_distance_m(const acc_detector_presence_handle_t *presence_handle, uint16_t point_idx)
Calculate distance in meter for a point in a sweep (including subsweeps)
acc_detector_presence_config_inter_frame_slow_cutoff_get
float acc_detector_presence_config_inter_frame_slow_cutoff_get(const acc_detector_presence_config_t *presence_config)
Get the cutoff frequency of the low pass filter for the slow filtered absolute sweep mean.
acc_detector_presence_config_inter_frame_idle_state_get
acc_config_idle_state_t acc_detector_presence_config_inter_frame_idle_state_get(const acc_detector_presence_config_t *presence_config)
Get inter frame idle state.
acc_detector_presence_config_end_get
float acc_detector_presence_config_end_get(const acc_detector_presence_config_t *presence_config)
Get the end point of measurement interval in meters.
acc_detector_presence_config_inter_detection_get
bool acc_detector_presence_config_inter_detection_get(const acc_detector_presence_config_t *presence_config)
Get if inter-frame presence detection is enabled.
acc_detector_presence_config_hwaas_get
uint16_t acc_detector_presence_config_hwaas_get(const acc_detector_presence_config_t *presence_config)
Get the hardware accelerated average samples (HWAAS)
acc_sensor.h
acc_detector_presence_config_inter_frame_presence_timeout_get
uint16_t acc_detector_presence_config_inter_frame_presence_timeout_get(const acc_detector_presence_config_t *presence_config)
Get the inter-frame presence timeout in seconds.
acc_detector_presence_result_t
Presence detector results container.
Definition: acc_detector_presence.h:50
acc_detector_presence_config_inter_frame_presence_timeout_set
void acc_detector_presence_config_inter_frame_presence_timeout_set(acc_detector_presence_config_t *presence_config, uint16_t inter_frame_presence_timeout)
Set the inter-frame presence timeout in seconds.
acc_detector_presence_metadata_t::num_points
uint16_t num_points
Definition: acc_detector_presence.h:120
acc_detector_presence_config_destroy
void acc_detector_presence_config_destroy(acc_detector_presence_config_t *presence_config)
Destroy a presence detector configuration.
acc_detector_presence_metadata_t
Definition: acc_detector_presence.h:93
acc_detector_presence_config_intra_detection_get
bool acc_detector_presence_config_intra_detection_get(const acc_detector_presence_config_t *presence_config)
Get if frame intra-frame presence detection is enabled.
acc_detector_presence_config_end_set
void acc_detector_presence_config_end_set(acc_detector_presence_config_t *presence_config, float end)
Set the end point of measurement interval in meters.
acc_detector_presence_config_intra_output_time_const_set
void acc_detector_presence_config_intra_output_time_const_set(acc_detector_presence_config_t *presence_config, float intra_output_time_const)
Set the time constant for the output in the intra-frame part.
acc_detector_presence_metadata_t::end_m
float end_m
Definition: acc_detector_presence.h:106
acc_detector_presence_result_t::intra_presence_score
float intra_presence_score
Definition: acc_detector_presence.h:59
acc_detector_presence_config_inter_detection_threshold_get
float acc_detector_presence_config_inter_detection_threshold_get(const acc_detector_presence_config_t *presence_config)
Get the detection threshold for the inter-frame presence detection.
acc_detector_presence_config_inter_frame_idle_state_set
void acc_detector_presence_config_inter_frame_idle_state_set(acc_detector_presence_config_t *presence_config, acc_config_idle_state_t idle_state)
Set inter frame idle state.
acc_detector_presence_result_t::depthwise_intra_presence_scores
float * depthwise_intra_presence_scores
Definition: acc_detector_presence.h:72
acc_detector_presence_process
bool acc_detector_presence_process(acc_detector_presence_handle_t *presence_handle, void *buffer, acc_detector_presence_result_t *result)
Process the data according to the configuration used in acc_detector_presence_config_create.
acc_detector_presence_config_inter_output_time_const_set
void acc_detector_presence_config_inter_output_time_const_set(acc_detector_presence_config_t *presence_config, float inter_output_time_const)
Set the time constant for the output in the inter-frame part.
acc_detector_presence_config_automatic_subsweeps_get
bool acc_detector_presence_config_automatic_subsweeps_get(const acc_detector_presence_config_t *presence_config)
Get if automatic subsweeps should be used.
acc_detector_presence_config_reset_filters_on_prepare_set
void acc_detector_presence_config_reset_filters_on_prepare_set(acc_detector_presence_config_t *presence_config, bool enable)
Set if the presence filters should reset on prepare.
acc_detector_presence_config_inter_frame_deviation_time_const_get
float acc_detector_presence_config_inter_frame_deviation_time_const_get(const acc_detector_presence_config_t *presence_config)
Get the time constant of the low pass filter for the inter-frame deviation between fast and slow.
acc_detector_presence_prepare
bool acc_detector_presence_prepare(const acc_detector_presence_handle_t *presence_handle, acc_detector_presence_config_t *presence_config, acc_sensor_t *sensor, const acc_cal_result_t *cal_result, void *buffer, uint32_t buffer_size)
Prepare the detector to do a measurement.
acc_detector_presence_config_sensor_set
void acc_detector_presence_config_sensor_set(acc_detector_presence_config_t *presence_config, acc_sensor_id_t sensor_id)
Set sensor ID.
acc_detector_presence_config_intra_detection_set
void acc_detector_presence_config_intra_detection_set(acc_detector_presence_config_t *presence_config, bool enable)
Set intra-frame presence detection.
acc_detector_presence_result_t::depthwise_inter_presence_scores
float * depthwise_inter_presence_scores
Definition: acc_detector_presence.h:77
acc_detector_presence_config_step_length_get
uint16_t acc_detector_presence_config_step_length_get(const acc_detector_presence_config_t *presence_config)
Get the step length in points.
acc_detector_presence_config_t
struct acc_detector_presence_config acc_detector_presence_config_t
Definition: acc_detector_presence.h:44
acc_detector_presence_config_auto_profile_get
bool acc_detector_presence_config_auto_profile_get(const acc_detector_presence_config_t *presence_config)
Get if automatic selection of profile based on start point of measurement is enabled.
acc_detector_presence_config_auto_step_length_get
bool acc_detector_presence_config_auto_step_length_get(const acc_detector_presence_config_t *presence_config)
Get if automatic selection of step length based on the profile is enabled.
acc_sensor_id_t
uint32_t acc_sensor_id_t
Type representing a sensor ID.
Definition: acc_definitions_common.h:14
acc_detector_presence_config_signal_quality_get
float acc_detector_presence_config_signal_quality_get(const acc_detector_presence_config_t *presence_config)
Get signal quality.
acc_detector_presence_config_inter_frame_slow_cutoff_set
void acc_detector_presence_config_inter_frame_slow_cutoff_set(acc_detector_presence_config_t *presence_config, float inter_frame_slow_cutoff)
Set the cutoff frequency of the low pass filter for the slow filtered absolute sweep mean.
acc_detector_presence_config_sweeps_per_frame_get
uint16_t acc_detector_presence_config_sweeps_per_frame_get(const acc_detector_presence_config_t *presence_config)
Get the number of sweeps per frame.
acc_detector_presence_config_frame_rate_app_driven_get
bool acc_detector_presence_config_frame_rate_app_driven_get(const acc_detector_presence_config_t *presence_config)
Get if the application should maintain the requested frame rate.
acc_detector_presence_config_log
void acc_detector_presence_config_log(acc_detector_presence_config_t *presence_config)
Print a configuration to the log.
acc_detector_presence_config_frame_rate_get
float acc_detector_presence_config_frame_rate_get(const acc_detector_presence_config_t *presence_config)
Get the frame rate.
acc_detector_presence_config_profile_set
void acc_detector_presence_config_profile_set(acc_detector_presence_config_t *presence_config, acc_config_profile_t profile)
Set a profile.
acc_detector_presence_result_t::presence_distance
float presence_distance
Definition: acc_detector_presence.h:67
acc_config_profile_t
acc_config_profile_t
Profile.
Definition: acc_definitions_a121.h:52
acc_definitions_common.h
acc_detector_presence_create
acc_detector_presence_handle_t * acc_detector_presence_create(acc_detector_presence_config_t *presence_config, acc_detector_presence_metadata_t *metadata)
Create a presence detector with the provided configuration.
acc_detector_presence_config_intra_detection_threshold_get
float acc_detector_presence_config_intra_detection_threshold_get(const acc_detector_presence_config_t *presence_config)
Get the detection threshold for the intra-frame presence detection.
acc_detector_presence_config_inter_frame_fast_cutoff_get
float acc_detector_presence_config_inter_frame_fast_cutoff_get(const acc_detector_presence_config_t *presence_config)
Get the cutoff frequency of the low pass filter for the fast filtered absolute sweep mean.
acc_detector_presence_config_profile_get
acc_config_profile_t acc_detector_presence_config_profile_get(const acc_detector_presence_config_t *presence_config)
Get the currently set profile.
acc_detector_presence_handle_t
struct acc_detector_presence_handle acc_detector_presence_handle_t
Definition: acc_detector_presence.h:36
acc_detector_presence_config_inter_phase_boost_get
bool acc_detector_presence_config_inter_phase_boost_get(const acc_detector_presence_config_t *presence_config)
Get if inter-frame phase boost is enabled.
acc_detector_presence_config_create
acc_detector_presence_config_t * acc_detector_presence_config_create(void)
Create a configuration for a presence detector.
acc_detector_presence_config_intra_frame_time_const_get
float acc_detector_presence_config_intra_frame_time_const_get(const acc_detector_presence_config_t *presence_config)
Get the time constant for the depthwise filtering in the intra-frame part.
acc_detector_presence_config_signal_quality_set
void acc_detector_presence_config_signal_quality_set(acc_detector_presence_config_t *presence_config, float signal_quality)
Set signal quality.
acc_detector_presence_config_start_set
void acc_detector_presence_config_start_set(acc_detector_presence_config_t *presence_config, float start)
Set the start point of measurement interval in meters.
acc_detector_presence_config_intra_output_time_const_get
float acc_detector_presence_config_intra_output_time_const_get(const acc_detector_presence_config_t *presence_config)
Get the time constant for the output in the intra-frame part.
acc_detector_presence_config_inter_detection_threshold_set
void acc_detector_presence_config_inter_detection_threshold_set(acc_detector_presence_config_t *presence_config, float inter_detection_threshold)
Set the detection threshold for the inter-frame presence detection.
acc_detector_presence_config_auto_step_length_set
void acc_detector_presence_config_auto_step_length_set(acc_detector_presence_config_t *presence_config, bool enable)
Enable automatic selection of step length based on the profile.
acc_processing.h
acc_sensor_t
struct acc_sensor acc_sensor_t
Definition: acc_sensor.h:31
acc_detector_presence_config_sensor_get
acc_sensor_id_t acc_detector_presence_config_sensor_get(const acc_detector_presence_config_t *presence_config)
Get sensor ID.
acc_detector_presence_config_intra_frame_time_const_set
void acc_detector_presence_config_intra_frame_time_const_set(acc_detector_presence_config_t *presence_config, float intra_frame_time_const)
Set the time constant for the depthwise filtering in the intra-frame part.
acc_detector_presence_config_step_length_set
void acc_detector_presence_config_step_length_set(acc_detector_presence_config_t *presence_config, uint16_t step_length)
Set the step length in points.
acc_detector_presence_config_automatic_subsweeps_set
void acc_detector_presence_config_automatic_subsweeps_set(acc_detector_presence_config_t *presence_config, bool automatic_subsweeps)
Set if automatic subsweeps should be used.
acc_definitions_a121.h
acc_config_idle_state_t
acc_config_idle_state_t
Idle state.
Definition: acc_definitions_a121.h:74
acc_detector_presence_config_frame_rate_app_driven_set
void acc_detector_presence_config_frame_rate_app_driven_set(acc_detector_presence_config_t *presence_config, bool enable)
Set if the application should maintain the requested frame rate.
acc_detector_presence_config_inter_frame_fast_cutoff_set
void acc_detector_presence_config_inter_frame_fast_cutoff_set(acc_detector_presence_config_t *presence_config, float inter_frame_fast_cutoff)
Set the cutoff frequency of the low pass filter for the fast filtered absolute sweep mean.