Go to the documentation of this file.
24 #define SENSOR_ID (1U)
41 int app_main(
int argc,
char *argv[]);
51 const uint32_t peak_width_points = 104;
66 printf(
"acc_control_helper_create ()failed \n");
76 printf(
"acc_control_helper_activate ()failed\n");
91 bool mem_ok = (current_sweep_iq != NULL) && (filtered_sweep_iq != NULL) &&
92 (filter_vector != NULL) && (filtered_sweep_amplitude != NULL);
95 printf(
"Memory allocation for vectors failed\n");
101 uint32_t iterations = 50U;
102 for (uint32_t i = 0U; i < iterations; i++)
106 printf(
"acc_control_helper_get_next() failed\n");
128 filtered_sweep_amplitude->
data[max_peak_index],
129 filtered_sweep_amplitude->
data[max_peak_index + 1]);
138 float distance = start + (max_peak_index + peak_offset) * step_length;
140 printf(
"Interpolated distance: %d mm\n", (
int)(distance * 1000 + .5f));
151 printf(
"Application finished OK\n");
159 int32_t start_point = 100;
160 uint16_t step_length = 8;
161 uint16_t num_points = 50;
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.
uint32_t acc_vector_float_argmax_skip_edges(acc_vector_float_t *vector_a, uint32_t elements_to_skip)
Index of element with maximum value in a float vector disregarding edge elements.
int app_main(int argc, char *argv[])
Assembly test example.
uint32_t acc_processing_helper_get_filter_length(uint32_t peak_width_points, uint32_t step_length)
Calculate filter vector length.
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.
void acc_config_frame_rate_set(acc_config_t *config, float frame_rate)
Set the frame rate.
int32_t acc_config_start_point_get(const acc_config_t *config)
Get the starting point of the sweep.
acc_processing_metadata_t proc_meta
void acc_vector_iq_apply_filter(const acc_vector_iq_t *vector_a, acc_vector_float_t *filter_vector, acc_vector_iq_t *vector_out)
Apply a FIR filter to an IQ vector.
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)
const char * acc_version_get(void)
Get the version of the Acconeer software.
struct acc_config acc_config_t
uint16_t acc_config_step_length_get(const acc_config_t *config)
Get the step length in a sweep.
float acc_processing_points_to_meter(int32_t points)
Convert a distance or step length in points to meter.
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.
void acc_vector_float_create_depth_filter_vector(acc_vector_float_t *vector_out)
Create a distance filter vector.
void acc_config_phase_enhancement_set(acc_config_t *config, bool enable)
Enable or disable phase enhancement.
static void update_configuration(acc_config_t *config)
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.
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
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.
float acc_processing_helper_interpolate_peak_position(float y1, float y2, float y3)
Interpolate peak position.