|
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_t * | acc_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... | |
Module to interpret and process data read from sensor.
typedef struct acc_processing_handle acc_processing_t |
Definition at line 30 of file acc_processing.h.
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.
[in] | config | The configuration to create a processing instance with |
[out] | processing_metadata | The metadata of the created processing instance |
void acc_processing_destroy | ( | acc_processing_t * | handle | ) |
Destroy a processing instance identified with the provided processing handle.
[in] | handle | A reference to the processing handle to destroy, can be NULL |
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.
[in] | handle | A reference to the processing handle |
[in] | buffer | A reference to the buffer (populated by acc_sensor_read) containing the data to be processed. |
[out] | result | Processing result |
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.
[in] | reference_temperature | The reference temperature, usually taken at calibration |
[in] | current_temperature | The current temperature |
[in] | profile | Configured profile |
[out] | signal_adjust_factor | The calculated signal adjustment factor |
[out] | deviation_adjust_factor | The calculated deviation adjustment factor |
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.
[in] | length | Length in meter to convert to points |
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.
[in] | points | Number of points to convert to meter |