example_processing_static_presence.c Example program that shows how the spread of the phase values can be used to determine if there is a static object in front of the radar.In this example we use the the ratio of the coherent average to the noncoherent average to calculate the spread and determine if the phase values are aligned or not. It is also possible to measure the spread in other way, for example by calculating the standard deviation of the phase values.
Note that this example is mainly intended for detecting the precense of static objects in front of the radar sensor, while Acconeer's presence detector detects objects that moves or vibrates sligtly, ignoring static objects.
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#define SENSOR_ID (1U)
#define SWEEPS_PER_FRAME 16
#define PHASE_SPREAD_TRESHOLD (0.01f)
{
(void)argc;
(void)argv;
{
return EXIT_FAILURE;
}
if (!res)
{
printf("acc_control_helper_create() failed\n");
return EXIT_FAILURE;
}
if (!res)
{
printf("acc_control_helper_activate() failed\n");
return EXIT_FAILURE;
}
bool mem_ok = (phase_spread != NULL) && (point_vector != NULL);
if (!mem_ok)
{
printf("Memory allocation for vectors failed\n");
goto clean_up;
}
uint32_t iterations = 5U;
for (uint32_t i = 0U; i < iterations; i++)
{
if (!res)
{
printf("acc_control_helper_get_next() failed\n");
break;
}
for (uint32_t p = 0U; p < sweep_data_length; p++)
{
phase_spread->
data[p] = 1 - coherent_mean / noncoherent_mean;
}
for (uint32_t p = 0U; p < sweep_data_length; p++)
{
}
printf("\n");
}
clean_up:
if (res && mem_ok)
{
printf("Application finished OK\n");
return EXIT_SUCCESS;
}
else
{
return EXIT_FAILURE;
}
}
{
int32_t start_point = 100;
uint16_t step_length = 24;
uint16_t num_points = 20;
}