1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
// Copyright (c) Acconeer AB, 2020-2024
// All rights reserved
/**
* @defgroup processing Processing
* @ingroup service
*
* @brief Module to interpret and process data read from sensor
*
* @{
*/
/**
* @brief Generic processing handle
*/
;
typedef struct acc_processing_handle acc_processing_t;
/**
* @brief Metadata that will be populated by the processing module during creation
*/
typedef struct
acc_processing_metadata_t;
/**
* @brief Result provided by the processing module
*/
typedef struct
acc_processing_result_t;
/**
* @brief Create a processing instance with the provided configuration
*
* @param[in] config The configuration to create a processing instance with
* @param[out] processing_metadata The metadata of the created processing instance
* @return Processing handle, NULL if processing instance was not possible to create
*/
acc_processing_t *;
/**
* @brief Process the data according to the configuration used in create
*
* @param[in] handle A reference to the processing handle
* @param[in] buffer A reference to the buffer (populated by @ref acc_sensor_read) containing the
* data to be processed.
*
* @param[out] result Processing result
*/
void ;
/**
* @brief Destroy a processing instance identified with the provided processing handle
*
* @param[in] handle A reference to the processing handle to destroy, can be NULL
*/
void ;
/**
* @brief 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.
*
* @param[in] points Number of points to convert to meter
* @return The corresponding length in meters
*/
float ;
/**
* @brief 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.
*
* @param[in] length Length in meter to convert to points
* @return The corresponding length in points
*/
int32_t ;
/**
* @brief 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.
*
* @param[in] reference_temperature The reference temperature, usually taken at calibration
* @param[in] current_temperature The current temperature
* @param[in] profile Configured profile
* @param[out] signal_adjust_factor The calculated signal adjustment factor
* @param[out] deviation_adjust_factor The calculated deviation adjustment factor
*/
void ;
/**
* @}
*/