Processing

Module to interpret and process data read from sensor. More...

Data Structures

struct  acc_processing_metadata_t
 Metadata that will be populated by the processing module during creation. More...
 
struct  acc_processing_result_t
 Result provided by the processing module. More...
 

Typedefs

typedef struct acc_processing_handle acc_processing_t
 

Functions

acc_processing_tacc_processing_create (const acc_config_t *config, acc_processing_metadata_t *processing_metadata)
 Create a processing instance with the provided configuration. More...
 
void acc_processing_execute (acc_processing_t *handle, void *buffer, acc_processing_result_t *result)
 Process the data according to the configuration used in create. More...
 
void acc_processing_destroy (acc_processing_t *handle)
 Destroy a processing instance identified with the provided processing handle. More...
 
float acc_processing_points_to_meter (int32_t points)
 Convert a distance or step length in points to meter. More...
 
int32_t acc_processing_meter_to_points (float length)
 Convert a distance or step length in meter to points. More...
 
void acc_processing_get_temperature_adjustment_factors (int16_t reference_temperature, int16_t current_temperature, acc_config_profile_t profile, float *signal_adjust_factor, float *deviation_adjust_factor)
 Calculate temperature compensation for mean sweep and background noise (tx off) standard deviation. More...
 

Detailed Description

Module to interpret and process data read from sensor.

Typedef Documentation

◆ acc_processing_t

typedef struct acc_processing_handle acc_processing_t

Definition at line 30 of file acc_processing.h.

Function Documentation

◆ acc_processing_create()

acc_processing_t* acc_processing_create ( const acc_config_t config,
acc_processing_metadata_t processing_metadata 
)

Create a processing instance with the provided configuration.

Parameters
[in]configThe configuration to create a processing instance with
[out]processing_metadataThe metadata of the created processing instance
Returns
Processing handle, NULL if processing instance was not possible to create
Examples
acc_control_helper.c, example_service.c, example_service_calibration_caching.c, example_service_multiple_configurations.c, example_service_sensor_disable.c, example_service_sensor_hibernate.c, example_service_sensor_off.c, and example_service_subsweeps.c.

◆ acc_processing_destroy()

void acc_processing_destroy ( acc_processing_t handle)

Destroy a processing instance identified with the provided processing handle.

Parameters
[in]handleA reference to the processing handle to destroy, can be NULL
Examples
acc_control_helper.c, example_service.c, example_service_calibration_caching.c, example_service_multiple_configurations.c, example_service_sensor_disable.c, example_service_sensor_hibernate.c, example_service_sensor_off.c, and example_service_subsweeps.c.

◆ acc_processing_execute()

void acc_processing_execute ( acc_processing_t handle,
void *  buffer,
acc_processing_result_t result 
)

Process the data according to the configuration used in create.

Parameters
[in]handleA reference to the processing handle
[in]bufferA reference to the buffer (populated by acc_sensor_read) containing the data to be processed.
[out]resultProcessing result
Examples
acc_control_helper.c, example_service.c, example_service_calibration_caching.c, example_service_multiple_configurations.c, example_service_sensor_disable.c, example_service_sensor_hibernate.c, example_service_sensor_off.c, and example_service_subsweeps.c.

◆ acc_processing_get_temperature_adjustment_factors()

void acc_processing_get_temperature_adjustment_factors ( int16_t  reference_temperature,
int16_t  current_temperature,
acc_config_profile_t  profile,
float *  signal_adjust_factor,
float *  deviation_adjust_factor 
)

Calculate temperature compensation for mean sweep and background noise (tx off) standard deviation.

The signal adjustment models how the amplitude level fluctuates with temperature. If the same object is measured against while the temperature changes, the amplitude level should be multiplied with this factor.

Example of usage: int16_t reference_temperature (recorded temperature during calibration) float reference_amplitude (recorded amplitude during calibration)

int16_t current_temperature (temperature at current measurement time)

float signal_adjust_factor float deviation_adjust_factor

acc_processing_get_temperature_adjustment_factors(reference_temperature, current_temperature, profile, &signal_adjust_factor, &deviation_adjust_factor)

reference_amplitude_new = reference_amplitude * signal_adjust_factor

The reference_amplitude_new is an approximation of what the calibrated amplitude would be at the new temperature.

Eg. When the temperature falls 60 degrees, the amplitude (roughly) doubles. This yields a signal_adjust_factor of (about) 2.

The signal adjustment model follows 2 ^ -(temperature_diff / model_parameter), where model_parameter reflects the temperature difference relative the reference temperature, required for the amplitude to double/halve.

The deviation_adjust_factor works the same way, but is applied to a measurement taken with the Tx off. So instead of a measurement of amplitude, we have a measurement of tx_off. The procedure for calculating this is to take the same configuration as the application will use, but turning off the Tx. This calibration value is multiplied with the deviation_adjust_factor.

Parameters
[in]reference_temperatureThe reference temperature, usually taken at calibration
[in]current_temperatureThe current temperature
[in]profileConfigured profile
[out]signal_adjust_factorThe calculated signal adjustment factor
[out]deviation_adjust_factorThe calculated deviation adjustment factor

◆ acc_processing_meter_to_points()

int32_t acc_processing_meter_to_points ( float  length)

Convert a distance or step length in meter to points.

Does not include any zero-point offset since it is highly integration dependant. In other words, calling this function with a 0.0 always returns 0.

Parameters
[in]lengthLength in meter to convert to points
Returns
The corresponding length in points

◆ acc_processing_points_to_meter()

float acc_processing_points_to_meter ( int32_t  points)

Convert a distance or step length in points to meter.

Does not include any zero-point offset since it is highly integration dependant. In other words, calling this function with a 0 always returns 0.0.

Parameters
[in]pointsNumber of points to convert to meter
Returns
The corresponding length in meters
Examples
example_detector_distance_with_iq_data_print.c, and example_processing_peak_interpolation.c.