Go to the documentation of this file.
32 #ifndef GASINDEXALGORITHM_H_
33 #define GASINDEXALGORITHM_H_
39 #if __STDC_VERSION__ >= 199901L
49 #endif // __STDC_VERSION__
54 #ifndef LIBRARY_VERSION_NAME
55 #define LIBRARY_VERSION_NAME "3.2.0"
58 #define GasIndexAlgorithm_ALGORITHM_TYPE_VOC (0)
59 #define GasIndexAlgorithm_ALGORITHM_TYPE_NOX (1)
60 #define GasIndexAlgorithm_DEFAULT_SAMPLING_INTERVAL (1.f)
61 #define GasIndexAlgorithm_INITIAL_BLACKOUT (45.f)
62 #define GasIndexAlgorithm_INDEX_GAIN (230.f)
63 #define GasIndexAlgorithm_SRAW_STD_INITIAL (50.f)
64 #define GasIndexAlgorithm_SRAW_STD_BONUS_VOC (220.f)
65 #define GasIndexAlgorithm_SRAW_STD_NOX (2000.f)
66 #define GasIndexAlgorithm_TAU_MEAN_HOURS (12.f)
67 #define GasIndexAlgorithm_TAU_VARIANCE_HOURS (12.f)
68 #define GasIndexAlgorithm_TAU_INITIAL_MEAN_VOC (20.f)
69 #define GasIndexAlgorithm_TAU_INITIAL_MEAN_NOX (1200.f)
70 #define GasIndexAlgorithm_INIT_DURATION_MEAN_VOC ((3600.f * 0.75f))
71 #define GasIndexAlgorithm_INIT_DURATION_MEAN_NOX ((3600.f * 4.75f))
72 #define GasIndexAlgorithm_INIT_TRANSITION_MEAN (0.01f)
73 #define GasIndexAlgorithm_TAU_INITIAL_VARIANCE (2500.f)
74 #define GasIndexAlgorithm_INIT_DURATION_VARIANCE_VOC ((3600.f * 1.45f))
75 #define GasIndexAlgorithm_INIT_DURATION_VARIANCE_NOX ((3600.f * 5.70f))
76 #define GasIndexAlgorithm_INIT_TRANSITION_VARIANCE (0.01f)
77 #define GasIndexAlgorithm_GATING_THRESHOLD_VOC (340.f)
78 #define GasIndexAlgorithm_GATING_THRESHOLD_NOX (30.f)
79 #define GasIndexAlgorithm_GATING_THRESHOLD_INITIAL (510.f)
80 #define GasIndexAlgorithm_GATING_THRESHOLD_TRANSITION (0.09f)
81 #define GasIndexAlgorithm_GATING_VOC_MAX_DURATION_MINUTES ((60.f * 3.f))
82 #define GasIndexAlgorithm_GATING_NOX_MAX_DURATION_MINUTES ((60.f * 12.f))
83 #define GasIndexAlgorithm_GATING_MAX_RATIO (0.3f)
84 #define GasIndexAlgorithm_SIGMOID_L (500.f)
85 #define GasIndexAlgorithm_SIGMOID_K_VOC (-0.0065f)
86 #define GasIndexAlgorithm_SIGMOID_X0_VOC (213.f)
87 #define GasIndexAlgorithm_SIGMOID_K_NOX (-0.0101f)
88 #define GasIndexAlgorithm_SIGMOID_X0_NOX (614.f)
89 #define GasIndexAlgorithm_VOC_INDEX_OFFSET_DEFAULT (100.f)
90 #define GasIndexAlgorithm_NOX_INDEX_OFFSET_DEFAULT (1.f)
91 #define GasIndexAlgorithm_LP_TAU_FAST (20.0f)
92 #define GasIndexAlgorithm_LP_TAU_SLOW (500.0f)
93 #define GasIndexAlgorithm_LP_ALPHA (-0.2f)
94 #define GasIndexAlgorithm_VOC_SRAW_MINIMUM (20000)
95 #define GasIndexAlgorithm_NOX_SRAW_MINIMUM (10000)
96 #define GasIndexAlgorithm_PERSISTENCE_UPTIME_GAMMA ((3.f * 3600.f))
97 #define GasIndexAlgorithm_TUNING_INDEX_OFFSET_MIN (1)
98 #define GasIndexAlgorithm_TUNING_INDEX_OFFSET_MAX (250)
99 #define GasIndexAlgorithm_TUNING_LEARNING_TIME_OFFSET_HOURS_MIN (1)
100 #define GasIndexAlgorithm_TUNING_LEARNING_TIME_OFFSET_HOURS_MAX (1000)
101 #define GasIndexAlgorithm_TUNING_LEARNING_TIME_GAIN_HOURS_MIN (1)
102 #define GasIndexAlgorithm_TUNING_LEARNING_TIME_GAIN_HOURS_MAX (1000)
103 #define GasIndexAlgorithm_TUNING_GATING_MAX_DURATION_MINUTES_MIN (0)
104 #define GasIndexAlgorithm_TUNING_GATING_MAX_DURATION_MINUTES_MAX (3000)
105 #define GasIndexAlgorithm_TUNING_STD_INITIAL_MIN (10)
106 #define GasIndexAlgorithm_TUNING_STD_INITIAL_MAX (5000)
107 #define GasIndexAlgorithm_TUNING_GAIN_FACTOR_MIN (1)
108 #define GasIndexAlgorithm_TUNING_GAIN_FACTOR_MAX (1000)
109 #define GasIndexAlgorithm_MEAN_VARIANCE_ESTIMATOR__GAMMA_SCALING (64.f)
110 #define GasIndexAlgorithm_MEAN_VARIANCE_ESTIMATOR__ADDITIONAL_GAMMA_MEAN_SCALING \
112 #define GasIndexAlgorithm_MEAN_VARIANCE_ESTIMATOR__FIX16_MAX (32767.f)
169 int32_t algorithm_type);
182 float sampling_interval);
203 float* state0,
float* state1);
258 int32_t learning_time_offset_hours, int32_t learning_time_gain_hours,
259 int32_t gating_max_duration_minutes, int32_t std_initial,
260 int32_t gain_factor);
269 int32_t* learning_time_offset_hours, int32_t* learning_time_gain_hours,
270 int32_t* gating_max_duration_minutes, int32_t* std_initial,
271 int32_t* gain_factor);
float mTau_Variance_Hours
Definition: sensirion_gas_index_algorithm.h:128
float m_Mean_Variance_Estimator__Gamma_Mean
Definition: sensirion_gas_index_algorithm.h:141
int32_t mAlgorithm_Type
Definition: sensirion_gas_index_algorithm.h:118
Definition: sensirion_gas_index_algorithm.h:117
float m_Adaptive_Lowpass___X2
Definition: sensirion_gas_index_algorithm.h:157
int32_t mSraw_Minimum
Definition: sensirion_gas_index_algorithm.h:121
float m_Mean_Variance_Estimator___Gamma_Initial_Mean
Definition: sensirion_gas_index_algorithm.h:139
float m_Sigmoid_Scaled__K
Definition: sensirion_gas_index_algorithm.h:150
float m_Mean_Variance_Estimator___Mean
Definition: sensirion_gas_index_algorithm.h:134
void GasIndexAlgorithm_set_states(GasIndexAlgorithmParams *params, float state0, float state1)
float m_Mean_Variance_Estimator___Sraw_Offset
Definition: sensirion_gas_index_algorithm.h:135
float m_Mox_Model__Sraw_Mean
Definition: sensirion_gas_index_algorithm.h:149
float mSamplingInterval
Definition: sensirion_gas_index_algorithm.h:119
float m_Adaptive_Lowpass__A2
Definition: sensirion_gas_index_algorithm.h:154
void GasIndexAlgorithm_init_with_sampling_interval(GasIndexAlgorithmParams *params, int32_t algorithm_type, float sampling_interval)
float m_Sigmoid_Scaled__X0
Definition: sensirion_gas_index_algorithm.h:151
void GasIndexAlgorithm_reset(GasIndexAlgorithmParams *params)
float mIndex_Gain
Definition: sensirion_gas_index_algorithm.h:126
float m_Mean_Variance_Estimator___Uptime_Gamma
Definition: sensirion_gas_index_algorithm.h:143
void GasIndexAlgorithm_process(GasIndexAlgorithmParams *params, int32_t sraw, int32_t *gas_index)
float mTau_Mean_Hours
Definition: sensirion_gas_index_algorithm.h:127
int32_t m_Mean_Variance_Estimator___Initialized
Definition: sensirion_gas_index_algorithm.h:133
float mInit_Duration_Mean
Definition: sensirion_gas_index_algorithm.h:123
float m_Adaptive_Lowpass___X1
Definition: sensirion_gas_index_algorithm.h:156
float mGas_Index
Definition: sensirion_gas_index_algorithm.h:132
float m_Mean_Variance_Estimator___Gating_Duration_Minutes
Definition: sensirion_gas_index_algorithm.h:145
float m_Mean_Variance_Estimator___Std
Definition: sensirion_gas_index_algorithm.h:136
float mSraw
Definition: sensirion_gas_index_algorithm.h:131
float mGating_Max_Duration_Minutes
Definition: sensirion_gas_index_algorithm.h:122
float m_Mean_Variance_Estimator___Gamma_Initial_Variance
Definition: sensirion_gas_index_algorithm.h:140
float m_Sigmoid_Scaled__Offset_Default
Definition: sensirion_gas_index_algorithm.h:152
void GasIndexAlgorithm_get_tuning_parameters(GasIndexAlgorithmParams *params, int32_t *index_offset, int32_t *learning_time_offset_hours, int32_t *learning_time_gain_hours, int32_t *gating_max_duration_minutes, int32_t *std_initial, int32_t *gain_factor)
float mSraw_Std_Initial
Definition: sensirion_gas_index_algorithm.h:129
float m_Mean_Variance_Estimator___Uptime_Gating
Definition: sensirion_gas_index_algorithm.h:144
void GasIndexAlgorithm_init(GasIndexAlgorithmParams *params, int32_t algorithm_type)
float m_Mean_Variance_Estimator___Sigmoid__X0
Definition: sensirion_gas_index_algorithm.h:147
float mInit_Duration_Variance
Definition: sensirion_gas_index_algorithm.h:124
float m_Mean_Variance_Estimator___Sigmoid__K
Definition: sensirion_gas_index_algorithm.h:146
float m_Adaptive_Lowpass__A1
Definition: sensirion_gas_index_algorithm.h:153
void GasIndexAlgorithm_get_states(GasIndexAlgorithmParams *params, float *state0, float *state1)
float m_Mox_Model__Sraw_Std
Definition: sensirion_gas_index_algorithm.h:148
int32_t m_Adaptive_Lowpass___Initialized
Definition: sensirion_gas_index_algorithm.h:155
float mIndex_Offset
Definition: sensirion_gas_index_algorithm.h:120
void GasIndexAlgorithm_set_tuning_parameters(GasIndexAlgorithmParams *params, int32_t index_offset, int32_t learning_time_offset_hours, int32_t learning_time_gain_hours, int32_t gating_max_duration_minutes, int32_t std_initial, int32_t gain_factor)
float m_Mean_Variance_Estimator___Gamma_Mean
Definition: sensirion_gas_index_algorithm.h:137
float mGating_Threshold
Definition: sensirion_gas_index_algorithm.h:125
float m_Adaptive_Lowpass___X3
Definition: sensirion_gas_index_algorithm.h:158
float mUptime
Definition: sensirion_gas_index_algorithm.h:130
void GasIndexAlgorithm_get_sampling_interval(GasIndexAlgorithmParams *params, float *sampling_interval)
float m_Mean_Variance_Estimator___Gamma_Variance
Definition: sensirion_gas_index_algorithm.h:138
float m_Mean_Variance_Estimator__Gamma_Variance
Definition: sensirion_gas_index_algorithm.h:142