example_processing_coherent_mean.c Example program that shows how to calculate the coherent mean of the values in an A121 sparse IQ frame with multiple sweeps.
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#define SENSOR_ID (1U)
#define SWEEPS_PER_FRAME 16
{
(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 = (current_sweep_coherent_mean_amplitude != NULL) && (point_vector != NULL);
if (!mem_ok)
{
printf("Memory allocation for vectors failed\n");
}
else
{
uint32_t iterations = 25U;
for (uint32_t i = 0U; i < iterations; i++)
{
{
printf("acc_control_helper_get_next() failed\n");
break;
}
for (uint32_t p = 0U; p < sweep_data_length; p++)
{
}
printf(
"Highest peak index: %" PRIu32
", peak ampliude %" PRIfloat "\n",
max_peak_index,
}
}
printf("Application finished OK\n");
return EXIT_SUCCESS;
}
{
int32_t start_point = 100;
uint16_t step_length = 2;
uint16_t num_points = 100;
}
void acc_config_start_point_set(acc_config_t *config, int32_t start_point)
Set the starting point of the sweep.
bool acc_control_helper_create(acc_control_helper_t *radar, acc_sensor_id_t sensor_id)
Create a helper instance.
float acc_vector_iq_coherent_mean_amplitude(const acc_vector_iq_t *vector_a)
Coherent mean amplitude of IQ vector.
void acc_get_iq_point_vector(const acc_control_helper_t *control_helper_state, uint32_t point, acc_vector_iq_t *vector_out)
Extract an IQ vector with sweep data for a specific point from a newly captured IQ frame with multipl...
void acc_vector_float_free(acc_vector_float_t *vector)
Free storage of data elements in a float vector.
void acc_vector_iq_free(acc_vector_iq_t *vector)
Free storage of data elements in an IQ vector.
void acc_config_profile_set(acc_config_t *config, acc_config_profile_t profile)
Set a profile.
void acc_config_sweeps_per_frame_set(acc_config_t *config, uint16_t sweeps)
Set sweeps per frame.
void acc_control_helper_destroy(acc_control_helper_t *radar)
Destroy a helper instance.
const acc_hal_a121_t * acc_hal_rss_integration_get_implementation(void)
Get hal implementation reference.
acc_processing_metadata_t proc_meta
int app_main(int argc, char *argv[])
Assembly test example.
void acc_config_hwaas_set(acc_config_t *config, uint16_t hwaas)
Set the hardware accelerated average samples (HWAAS)
static void update_configuration(acc_config_t *config)
const char * acc_version_get(void)
Get the version of the Acconeer software.
struct acc_config acc_config_t
void acc_config_step_length_set(acc_config_t *config, uint16_t step_length)
Set the step length in a sweep.
void acc_config_num_points_set(acc_config_t *config, uint16_t num_points)
Set the number of data points to measure.
#define ACC_LOG_FLOAT_TO_INTEGER(a)
acc_vector_iq_t * acc_vector_iq_alloc(uint32_t data_length)
Allocate storage for an IQ vector.
acc_vector_float_t * acc_vector_float_alloc(uint32_t data_length)
Allocate storage for a float vector.
void acc_vector_float_print(const char *label, acc_vector_float_t *vector_a)
Print float vector.
static const acc_hal_a121_t hal
bool acc_control_helper_activate(acc_control_helper_t *radar)
Activate the sensor.
void acc_config_prf_set(acc_config_t *config, acc_config_prf_t prf)
Set Pulse Repetition Frequency.
@ ACC_CONFIG_PRF_13_0_MHZ
#define PRIfloat
Specifier for printing float type using integers.
bool acc_control_helper_get_next(acc_control_helper_t *radar)
Perform a radar measurement and wait for the result.
uint32_t acc_vector_float_argmax(acc_vector_float_t *vector_a)
Index of element with maximum value in a float vector.