example_processing_ampliude.c Example program that shows how to calculate the amplitude of the values in an A121 sparse IQ frame with one sweep. The result is similar to the output from A111 envelope and powerbin service.
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#define SENSOR_ID (1U)
{
(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 != NULL) && (current_sweep_amplitude != 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;
}
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.
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.
static void update_configuration(acc_config_t *config)
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
void acc_vector_iq_amplitude(const acc_vector_iq_t *vector_a, acc_vector_float_t *vector_out)
Amplitude of an IQ vector.
void acc_config_hwaas_set(acc_config_t *config, uint16_t hwaas)
Set the hardware accelerated average samples (HWAAS)
int app_main(int argc, char *argv[])
Assembly test example.
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.
void acc_get_iq_sweep_vector(const acc_control_helper_t *control_helper_state, acc_vector_iq_t *vector_out)
Converts a newly captured IQ frame with one sweep to an IQ vector.
uint32_t acc_vector_float_argmax(acc_vector_float_t *vector_a)
Index of element with maximum value in a float vector.