acc_detector_presence_processing.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "acc_config.h"
#include "acc_definitions_common.h"

Go to the source code of this file.

Data Structures

struct  acc_detector_presence_processing_result_t
 Presence detector results container. More...
 

Typedefs

typedef struct acc_detector_presence_processing_handle acc_detector_presence_processing_handle_t
 
typedef struct acc_detector_presence_processing_config acc_detector_presence_processing_config_t
 

Functions

uint32_t acc_detector_presence_processing_get_buffer_size (const acc_config_t *sensor_config)
 Get the buffer size needed for presence processing. More...
 
acc_detector_presence_processing_config_tacc_detector_presence_processing_config_create (void)
 Create a configuration for a presence processor. More...
 
void acc_detector_presence_processing_config_destroy (acc_detector_presence_processing_config_t *processor_config)
 Destroy a presence processor configuration. More...
 
acc_detector_presence_processing_handle_tacc_detector_presence_processing_create (const acc_detector_presence_processing_config_t *processing_config, const acc_config_t *sensor_config)
 Create a processing handle with the provided base configuration. More...
 
void acc_detector_presence_processing_destroy (acc_detector_presence_processing_handle_t *processing_handle)
 Destroy a processing handle. More...
 
bool acc_detector_presence_processing_reset (acc_detector_presence_processing_handle_t *processing_handle)
 Reset existing processing buffers. More...
 
bool acc_detector_presence_processing_process (acc_detector_presence_processing_handle_t *processing_handle, void *buffer, const acc_int16_complex_t *frame, acc_detector_presence_processing_result_t *presence_result)
 Process sensor data. More...
 
void acc_detector_presence_processing_config_frame_rate_set (acc_detector_presence_processing_config_t *processing_config, float frame_rate)
 Set the frame rate. More...
 
float acc_detector_presence_processing_config_frame_rate_get (const acc_detector_presence_processing_config_t *processing_config)
 Get the frame rate. More...
 
void acc_detector_presence_processing_config_inter_frame_presence_timeout_set (acc_detector_presence_processing_config_t *processing_config, uint16_t inter_frame_presence_timeout)
 Set the inter-frame presence timeout in seconds. More...
 
uint16_t acc_detector_presence_processing_config_inter_frame_presence_timeout_get (const acc_detector_presence_processing_config_t *processing_config)
 Get the inter-frame presence timeout in seconds. More...
 
void acc_detector_presence_processing_config_intra_detection_set (acc_detector_presence_processing_config_t *processing_config, bool enable)
 Set intra-frame presence detection. More...
 
bool acc_detector_presence_processing_config_intra_detection_get (const acc_detector_presence_processing_config_t *processing_config)
 Get if frame intra-frame presence detection is enabled. More...
 
void acc_detector_presence_processing_config_intra_detection_threshold_set (acc_detector_presence_processing_config_t *processing_config, float intra_detection_threshold)
 Set the detection threshold for the intra-frame presence detection. More...
 
float acc_detector_presence_processing_config_intra_detection_threshold_get (const acc_detector_presence_processing_config_t *processing_config)
 Get the detection threshold for the intra-frame presence detection. More...
 
void acc_detector_presence_processing_config_inter_detection_set (acc_detector_presence_processing_config_t *processing_config, bool enable)
 Set inter-frame presence detection. More...
 
bool acc_detector_presence_processing_config_inter_detection_get (const acc_detector_presence_processing_config_t *processing_config)
 Get if inter-frame presence detection is enabled. More...
 
void acc_detector_presence_processing_config_inter_detection_threshold_set (acc_detector_presence_processing_config_t *processing_config, float inter_detection_threshold)
 Set the detection threshold for the inter-frame presence detection. More...
 
float acc_detector_presence_processing_config_inter_detection_threshold_get (const acc_detector_presence_processing_config_t *processing_config)
 Get the detection threshold for the inter-frame presence detection. More...
 
void acc_detector_presence_processing_config_inter_frame_deviation_time_const_set (acc_detector_presence_processing_config_t *processing_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. More...
 
float acc_detector_presence_processing_config_inter_frame_deviation_time_const_get (const acc_detector_presence_processing_config_t *processing_config)
 Get the time constant of the low pass filter for the inter-frame deviation between fast and slow. More...
 
void acc_detector_presence_processing_config_inter_frame_fast_cutoff_set (acc_detector_presence_processing_config_t *processing_config, float inter_frame_fast_cutoff)
 Set the cutoff frequency of the low pass filter for the fast filtered absolute sweep mean. More...
 
float acc_detector_presence_processing_config_inter_frame_fast_cutoff_get (const acc_detector_presence_processing_config_t *processing_config)
 Get the cutoff frequency of the low pass filter for the fast filtered absolute sweep mean. More...
 
void acc_detector_presence_processing_config_inter_frame_slow_cutoff_set (acc_detector_presence_processing_config_t *processing_config, float inter_frame_slow_cutoff)
 Set the cutoff frequency of the low pass filter for the slow filtered absolute sweep mean. More...
 
float acc_detector_presence_processing_config_inter_frame_slow_cutoff_get (const acc_detector_presence_processing_config_t *processing_config)
 Get the cutoff frequency of the low pass filter for the slow filtered absolute sweep mean. More...
 
void acc_detector_presence_processing_config_intra_frame_time_const_set (acc_detector_presence_processing_config_t *processing_config, float intra_frame_time_const)
 Set the time constant for the depthwise filtering in the intra-frame part. More...
 
float acc_detector_presence_processing_config_intra_frame_time_const_get (const acc_detector_presence_processing_config_t *processing_config)
 Get the time constant for the depthwise filtering in the intra-frame part. More...
 
void acc_detector_presence_processing_config_intra_output_time_const_set (acc_detector_presence_processing_config_t *processing_config, float intra_output_time_const)
 Set the time constant for the output in the intra-frame part. More...
 
float acc_detector_presence_processing_config_intra_output_time_const_get (const acc_detector_presence_processing_config_t *processing_config)
 Get the time constant for the output in the intra-frame part. More...
 
void acc_detector_presence_processing_config_inter_output_time_const_set (acc_detector_presence_processing_config_t *processing_config, float inter_output_time_const)
 Set the time constant for the output in the inter-frame part. More...
 
float acc_detector_presence_processing_config_inter_output_time_const_get (const acc_detector_presence_processing_config_t *processing_config)
 Get the time constant for the output in the inter-frame part. More...
 

Typedef Documentation

◆ acc_detector_presence_processing_config_t

typedef struct acc_detector_presence_processing_config acc_detector_presence_processing_config_t

Definition at line 25 of file acc_detector_presence_processing.h.

◆ acc_detector_presence_processing_handle_t

typedef struct acc_detector_presence_processing_handle acc_detector_presence_processing_handle_t

Definition at line 18 of file acc_detector_presence_processing.h.

Function Documentation

◆ acc_detector_presence_processing_config_create()

acc_detector_presence_processing_config_t* acc_detector_presence_processing_config_create ( void  )

Create a configuration for a presence processor.

Returns
Presence processor configuration, NULL if creation was not possible

◆ acc_detector_presence_processing_config_destroy()

void acc_detector_presence_processing_config_destroy ( acc_detector_presence_processing_config_t processor_config)

Destroy a presence processor configuration.

Parameters
[in]processor_configThe configuration to destroy

◆ acc_detector_presence_processing_config_frame_rate_get()

float acc_detector_presence_processing_config_frame_rate_get ( const acc_detector_presence_processing_config_t processing_config)

Get the frame rate.

See acc_detector_presence_config_frame_rate_set

Parameters
[in]processing_configThe configuration
Returns
Frame rate in Hz

◆ acc_detector_presence_processing_config_frame_rate_set()

void acc_detector_presence_processing_config_frame_rate_set ( acc_detector_presence_processing_config_t processing_config,
float  frame_rate 
)

Set the frame rate.

See acc_config_frame_rate_set for details

Parameters
[in]processing_configThe configuration
[in]frame_rateFrame rate in Hz. Must be > 0

◆ acc_detector_presence_processing_config_inter_detection_get()

bool acc_detector_presence_processing_config_inter_detection_get ( const acc_detector_presence_processing_config_t processing_config)

Get if inter-frame presence detection is enabled.

See acc_detector_presence_processing_config_inter_detection_set

Parameters
[in]processing_configThe configuration to get inter-frame presence detection for
Returns
true if inter-frame presence detection is enabled, false otherwise

◆ acc_detector_presence_processing_config_inter_detection_set()

void acc_detector_presence_processing_config_inter_detection_set ( acc_detector_presence_processing_config_t processing_config,
bool  enable 
)

Set inter-frame presence detection.

This is used for detecting slower movements between frames

Parameters
[in]processing_configThe configuration to set inter-frame detection for
[in]enabletrue if inter-frame presence detection should be enabled

◆ acc_detector_presence_processing_config_inter_detection_threshold_get()

float acc_detector_presence_processing_config_inter_detection_threshold_get ( const acc_detector_presence_processing_config_t processing_config)

Get the detection threshold for the inter-frame presence detection.

See acc_detector_presence_processing_config_inter_detection_threshold_set

Parameters
[in]processing_configThe configuration to get the detection threshold for
Returns
detection threshold

◆ acc_detector_presence_processing_config_inter_detection_threshold_set()

void acc_detector_presence_processing_config_inter_detection_threshold_set ( acc_detector_presence_processing_config_t processing_config,
float  inter_detection_threshold 
)

Set the detection threshold for the inter-frame presence detection.

This is the threshold for detecting slower movements between frames

Parameters
[in]processing_configThe configuration to set the detection threshold for
[in]inter_detection_thresholdThe threshold

◆ acc_detector_presence_processing_config_inter_frame_deviation_time_const_get()

float acc_detector_presence_processing_config_inter_frame_deviation_time_const_get ( const acc_detector_presence_processing_config_t processing_config)

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

Parameters
[in]processing_configThe configuration to get the time constant for
Returns
time constant in s

◆ acc_detector_presence_processing_config_inter_frame_deviation_time_const_set()

void acc_detector_presence_processing_config_inter_frame_deviation_time_const_set ( acc_detector_presence_processing_config_t processing_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.

Parameters
[in]processing_configThe configuration
[in]inter_frame_deviation_time_constTime constant to set

◆ acc_detector_presence_processing_config_inter_frame_fast_cutoff_get()

float acc_detector_presence_processing_config_inter_frame_fast_cutoff_get ( const acc_detector_presence_processing_config_t processing_config)

Get the cutoff frequency of the low pass filter for the fast filtered absolute sweep mean.

Parameters
[in]processing_configThe configuration to get the cutoff frequency for
Returns
the cutoff frequency in Hz

◆ acc_detector_presence_processing_config_inter_frame_fast_cutoff_set()

void acc_detector_presence_processing_config_inter_frame_fast_cutoff_set ( acc_detector_presence_processing_config_t processing_config,
float  inter_frame_fast_cutoff 
)

Set the 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).

Parameters
[in]processing_configThe configuration
[in]inter_frame_fast_cutoffCutoff frequency to set

◆ acc_detector_presence_processing_config_inter_frame_presence_timeout_get()

uint16_t acc_detector_presence_processing_config_inter_frame_presence_timeout_get ( const acc_detector_presence_processing_config_t processing_config)

Get the inter-frame presence timeout in seconds.

See acc_detector_presence_processing_config_inter_frame_presence_timeout_set

Parameters
[in]processing_configThe configuration
Returns
Inter-frame presence timeout in s

◆ acc_detector_presence_processing_config_inter_frame_presence_timeout_set()

void acc_detector_presence_processing_config_inter_frame_presence_timeout_set ( acc_detector_presence_processing_config_t processing_config,
uint16_t  inter_frame_presence_timeout 
)

Set the inter-frame presence timeout in seconds.

Number of seconds the inter-frame presence score needs to decrease before exponential scaling starts for faster decline. Should be between 0 and 30 where 0 means no timeout

Parameters
[in]processing_configThe configuration
[in]inter_frame_presence_timeoutTimeout in seconds between 0 and 30

◆ acc_detector_presence_processing_config_inter_frame_slow_cutoff_get()

float acc_detector_presence_processing_config_inter_frame_slow_cutoff_get ( const acc_detector_presence_processing_config_t processing_config)

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

Parameters
[in]processing_configThe configuration to get the cutoff frequency for
Returns
the cutoff frequency in Hz

◆ acc_detector_presence_processing_config_inter_frame_slow_cutoff_set()

void acc_detector_presence_processing_config_inter_frame_slow_cutoff_set ( acc_detector_presence_processing_config_t processing_config,
float  inter_frame_slow_cutoff 
)

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

Parameters
[in]processing_configThe configuration
[in]inter_frame_slow_cutoffCutoff frequency to set

◆ acc_detector_presence_processing_config_inter_output_time_const_get()

float acc_detector_presence_processing_config_inter_output_time_const_get ( const acc_detector_presence_processing_config_t processing_config)

Get the time constant for the output in the inter-frame part.

Parameters
[in]processing_configThe configuration to get the time constant for
Returns
time constant in s

◆ acc_detector_presence_processing_config_inter_output_time_const_set()

void acc_detector_presence_processing_config_inter_output_time_const_set ( acc_detector_presence_processing_config_t processing_config,
float  inter_output_time_const 
)

Set the time constant for the output in the inter-frame part.

Parameters
[in]processing_configThe configuration
[in]inter_output_time_constTime constant to set

◆ acc_detector_presence_processing_config_intra_detection_get()

bool acc_detector_presence_processing_config_intra_detection_get ( const acc_detector_presence_processing_config_t processing_config)

Get if frame intra-frame presence detection is enabled.

See acc_detector_presence_processing_config_intra_detection_set

Parameters
[in]processing_configThe configuration to get intra detection for
Returns
true if intra-frame detection is enabled, false otherwise

◆ acc_detector_presence_processing_config_intra_detection_set()

void acc_detector_presence_processing_config_intra_detection_set ( acc_detector_presence_processing_config_t processing_config,
bool  enable 
)

Set intra-frame presence detection.

This is used for detecting faster movements inside frames

Parameters
[in]processing_configThe configuration to set intra-frame detection for
[in]enabletrue if intra-frame detection should be enabled

◆ acc_detector_presence_processing_config_intra_detection_threshold_get()

float acc_detector_presence_processing_config_intra_detection_threshold_get ( const acc_detector_presence_processing_config_t processing_config)

Get the detection threshold for the intra-frame presence detection.

See acc_detector_presence_processing_config_intra_detection_threshold_set

Parameters
[in]processing_configThe configuration to get the detection threshold for
Returns
The intra-frame detection threshold

◆ acc_detector_presence_processing_config_intra_detection_threshold_set()

void acc_detector_presence_processing_config_intra_detection_threshold_set ( acc_detector_presence_processing_config_t processing_config,
float  intra_detection_threshold 
)

Set the detection threshold for the intra-frame presence detection.

This is the threshold for detecting faster movements inside frames

Parameters
[in]processing_configThe configuration to set the detection threshold for
[in]intra_detection_thresholdThe intra-frame detection threshold to set

◆ acc_detector_presence_processing_config_intra_frame_time_const_get()

float acc_detector_presence_processing_config_intra_frame_time_const_get ( const acc_detector_presence_processing_config_t processing_config)

Get the time constant for the depthwise filtering in the intra-frame part.

Parameters
[in]processing_configThe configuration to get the time constant for
Returns
time constant in s

◆ acc_detector_presence_processing_config_intra_frame_time_const_set()

void acc_detector_presence_processing_config_intra_frame_time_const_set ( acc_detector_presence_processing_config_t processing_config,
float  intra_frame_time_const 
)

Set the time constant for the depthwise filtering in the intra-frame part.

Parameters
[in]processing_configThe configuration
[in]intra_frame_time_constTime constant to set

◆ acc_detector_presence_processing_config_intra_output_time_const_get()

float acc_detector_presence_processing_config_intra_output_time_const_get ( const acc_detector_presence_processing_config_t processing_config)

Get the time constant for the output in the intra-frame part.

Parameters
[in]processing_configThe configuration to get the time constant for
Returns
time constant in s

◆ acc_detector_presence_processing_config_intra_output_time_const_set()

void acc_detector_presence_processing_config_intra_output_time_const_set ( acc_detector_presence_processing_config_t processing_config,
float  intra_output_time_const 
)

Set the time constant for the output in the intra-frame part.

Parameters
[in]processing_configThe configuration
[in]intra_output_time_constTime constant to set

◆ acc_detector_presence_processing_create()

acc_detector_presence_processing_handle_t* acc_detector_presence_processing_create ( const acc_detector_presence_processing_config_t processing_config,
const acc_config_t sensor_config 
)

Create a processing handle with the provided base configuration.

Parameters
[in]processing_configThe presence processing configuration to create a processing handle with
[in]sensor_configThe sensor config to create a processing handle with
Returns
processing handle, NULL if creation was not possible

◆ acc_detector_presence_processing_destroy()

void acc_detector_presence_processing_destroy ( acc_detector_presence_processing_handle_t processing_handle)

Destroy a processing handle.

Parameters
[in]processing_handleA reference to the processing handle to destroy

◆ acc_detector_presence_processing_get_buffer_size()

uint32_t acc_detector_presence_processing_get_buffer_size ( const acc_config_t sensor_config)

Get the buffer size needed for presence processing.

Parameters
[in]sensor_configSensor config to get size for
Returns
The buffer size

◆ acc_detector_presence_processing_process()

bool acc_detector_presence_processing_process ( acc_detector_presence_processing_handle_t processing_handle,
void *  buffer,
const acc_int16_complex_t frame,
acc_detector_presence_processing_result_t presence_result 
)

Process sensor data.

This function process the sensor data and tries to find presence.

Parameters
[in]processing_handleThe presence detector processing handle to get the next result for
[in]bufferWorking memory for process, must be at least 32-bit aligned
[in]frameThe radar data to be processed, must be of the length provided at processing creation
[out]presence_resultThe result container with presence information for the user
Returns
true if successful, false otherwise

◆ acc_detector_presence_processing_reset()

bool acc_detector_presence_processing_reset ( acc_detector_presence_processing_handle_t processing_handle)

Reset existing processing buffers.

Parameters
[in]processing_handleA reference to the processing handle to reset existing processing buffers for
Returns
true if successful, false otherwise