51 put(timestamp, data, error_count_in, priority_in);
76 float lp_val = val[i] -
_lp[i];
78 float delta_val = lp_val -
_mean[i];
80 _M2[i] += delta_val * (lp_val - _mean[i]);
83 if (fabsf(
_value[i] - val[i]) < 0.000001
f) {
94 _lp[i] =
_lp[i] * 0.99f + 0.01f * val[i];
156 ECL_INFO(
"\tval: %8.4f, lp: %8.4f mean dev: %8.4f RMS: %8.4f conf: %8.4f",
static constexpr uint32_t ERROR_FLAG_NO_ERROR
Data validator error states.
Adapter / shim layer for system calls needed by ECL.
static constexpr uint32_t ERROR_FLAG_TIMEOUT
float _lp[dimensions]
low pass value
float _value[dimensions]
last value
float _vibe[dimensions]
vibration level, in sensor unit
static constexpr uint32_t ERROR_FLAG_STALE_DATA
#define ecl_absolute_time()
int _priority
sensor nominal priority
unsigned _value_equal_count
equal values in a row
static constexpr uint32_t ERROR_FLAG_HIGH_ERRCOUNT
float _rms[dimensions]
root mean square error
float _M2[dimensions]
RMS component value.
void print()
Print the validator value.
uint32_t _timeout_interval
interval in which the datastream times out in us
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
uint32_t _error_mask
sensor error state
uint64_t _event_count
total data counter
float _mean[dimensions]
mean of value
unsigned _value_equal_count_threshold
when to consider an equal count as a problem
static constexpr uint32_t ERROR_FLAG_NO_DATA
static constexpr uint32_t ERROR_FLAG_HIGH_ERRDENSITY
uint64_t _error_count
error count
int _error_density
ratio between successful reads and errors
void put(uint64_t timestamp, float val, uint64_t error_count, int priority)
Put an item into the validator.
uint64_t _time_last
last timestamp
A data validation class to identify anomalies in data streams.
static const constexpr unsigned NORETURN_ERRCOUNT
if the error count reaches this value, return sensor as invalid
float confidence(uint64_t timestamp)
Get the confidence of this validator.
static const constexpr float ERROR_DENSITY_WINDOW
window in measurement counts for errors
static const unsigned dimensions