![]() |
LibDriver SGP41
|
driver sgp41 algorithm source file More...
#include "driver_sgp41_algorithm.h"Go to the source code of this file.
Functions | |
| void | sgp41_algorithm_reset (sgp41_gas_index_algorithm_t *params) |
| algorithm reset | |
| void | sgp41_algorithm_init_with_sampling_interval (sgp41_gas_index_algorithm_t *params, int32_t algorithm_type, float sampling_interval) |
| algorithm init with sampling interval | |
| void | sgp41_algorithm_init (sgp41_gas_index_algorithm_t *params, int32_t algorithm_type) |
| algorithm init | |
| void | sgp41_algorithm_get_sampling_interval (const sgp41_gas_index_algorithm_t *params, float *sampling_interval) |
| algorithm get sampling interval | |
| void | sgp41_algorithm_get_states (const sgp41_gas_index_algorithm_t *params, float *state0, float *state1) |
| algorithm get states | |
| void | sgp41_algorithm_set_states (sgp41_gas_index_algorithm_t *params, float state0, float state1) |
| algorithm set states | |
| void | sgp41_algorithm_set_tuning_parameters (sgp41_gas_index_algorithm_t *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) |
| algorithm set tuning parameters | |
| void | sgp41_algorithm_get_tuning_parameters (const sgp41_gas_index_algorithm_t *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) |
| algorithm get tuning parameters | |
| void | sgp41_algorithm_process (sgp41_gas_index_algorithm_t *params, int32_t sraw, int32_t *gas_index) |
| algorithm process | |
driver sgp41 algorithm source file
Copyright (c) 2022 - present Sensirion AG All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of Sensirion AG nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| Date | Version | Author | Description |
|---|---|---|---|
| 2023/08/30 | 1.0 | Sensirion | first upload |
Definition in file driver_sgp41_algorithm.c.
| #define DEFAULT_SAMPLING_INTERVAL (1.f) |
algorithm params definition
default sampling interval
Definition at line 48 of file driver_sgp41_algorithm.c.
| #define GATING_MAX_RATIO (0.3f) |
gating max ratio
Definition at line 71 of file driver_sgp41_algorithm.c.
| #define GATING_NOX_MAX_DURATION_MINUTES ((60.f * 12.f)) |
gating nox max duration minutes
Definition at line 70 of file driver_sgp41_algorithm.c.
| #define GATING_THRESHOLD_INITIAL (510.f) |
gating threshold initial
Definition at line 67 of file driver_sgp41_algorithm.c.
| #define GATING_THRESHOLD_NOX (30.f) |
gating threshold nox
Definition at line 66 of file driver_sgp41_algorithm.c.
| #define GATING_THRESHOLD_TRANSITION (0.09f) |
gating threshold transition
Definition at line 68 of file driver_sgp41_algorithm.c.
| #define GATING_THRESHOLD_VOC (340.f) |
gating threshold voc
Definition at line 65 of file driver_sgp41_algorithm.c.
| #define GATING_VOC_MAX_DURATION_MINUTES ((60.f * 3.f)) |
gating voc max duration minutes
Definition at line 69 of file driver_sgp41_algorithm.c.
| #define INDEX_GAIN (230.f) |
index gain
Definition at line 50 of file driver_sgp41_algorithm.c.
| #define INIT_DURATION_MEAN_NOX ((3600.f * 4.75f)) |
init duration mean nox
Definition at line 59 of file driver_sgp41_algorithm.c.
| #define INIT_DURATION_MEAN_VOC ((3600.f * 0.75f)) |
init duration mean voc
Definition at line 58 of file driver_sgp41_algorithm.c.
| #define INIT_DURATION_VARIANCE_NOX ((3600.f * 5.70f)) |
init duration variance nox
Definition at line 63 of file driver_sgp41_algorithm.c.
| #define INIT_DURATION_VARIANCE_VOC ((3600.f * 1.45f)) |
init duration variance voc
Definition at line 62 of file driver_sgp41_algorithm.c.
| #define INIT_TRANSITION_MEAN (0.01f) |
init transition mean
Definition at line 60 of file driver_sgp41_algorithm.c.
| #define INIT_TRANSITION_VARIANCE (0.01f) |
init transition variance
Definition at line 64 of file driver_sgp41_algorithm.c.
| #define INITIAL_BLACKOUT (45.f) |
initial blackout
Definition at line 49 of file driver_sgp41_algorithm.c.
| #define LP_ALPHA (-0.2f) |
lp alpha
Definition at line 81 of file driver_sgp41_algorithm.c.
| #define LP_TAU_FAST (20.0f) |
lp tau fast
Definition at line 79 of file driver_sgp41_algorithm.c.
| #define LP_TAU_SLOW (500.0f) |
lp tau slow
Definition at line 80 of file driver_sgp41_algorithm.c.
| #define MEAN_VARIANCE_ESTIMATOR_ADDITIONAL_GAMMA_MEAN_SCALING (8.f) |
mean variance estimator additional gamma mean scaling
Definition at line 98 of file driver_sgp41_algorithm.c.
| #define MEAN_VARIANCE_ESTIMATOR_FIX16_MAX (32767.f) |
mean variance estimator fix16 max
Definition at line 99 of file driver_sgp41_algorithm.c.
| #define MEAN_VARIANCE_ESTIMATOR_GAMMA_SCALING (64.f) |
mean variance estimator gamma scaling
Definition at line 97 of file driver_sgp41_algorithm.c.
| #define NOX_INDEX_OFFSET_DEFAULT (1.f) |
nox index offset default
Definition at line 78 of file driver_sgp41_algorithm.c.
| #define NOX_SRAW_MINIMUM (10000) |
nox sraw minimum
Definition at line 83 of file driver_sgp41_algorithm.c.
| #define PERSISTENCE_UPTIME_GAMMA ((3.f * 3600.f)) |
persistence uptime gamma
Definition at line 84 of file driver_sgp41_algorithm.c.
| #define SIGMOID_K_NOX (-0.0101f) |
sigmoid k nox
Definition at line 75 of file driver_sgp41_algorithm.c.
| #define SIGMOID_K_VOC (-0.0065f) |
sigmoid k voc
Definition at line 73 of file driver_sgp41_algorithm.c.
| #define SIGMOID_L (500.f) |
sigmoid l
Definition at line 72 of file driver_sgp41_algorithm.c.
| #define SIGMOID_X0_NOX (614.f) |
sigmoid x0 nox
Definition at line 76 of file driver_sgp41_algorithm.c.
| #define SIGMOID_X0_VOC (213.f) |
sigmoid x0 voc
Definition at line 74 of file driver_sgp41_algorithm.c.
| #define SRAW_STD_BONUS_VOC (220.f) |
sraw std bonus voc
Definition at line 52 of file driver_sgp41_algorithm.c.
| #define SRAW_STD_INITIAL (50.f) |
sraw std initial
Definition at line 51 of file driver_sgp41_algorithm.c.
| #define SRAW_STD_NOX (2000.f) |
sraw std nox
Definition at line 53 of file driver_sgp41_algorithm.c.
| #define TAU_INITIAL_MEAN_NOX (1200.f) |
tau initial mean nox
Definition at line 57 of file driver_sgp41_algorithm.c.
| #define TAU_INITIAL_MEAN_VOC (20.f) |
tau initial mean voc
Definition at line 56 of file driver_sgp41_algorithm.c.
| #define TAU_INITIAL_VARIANCE (2500.f) |
tau initial variance
Definition at line 61 of file driver_sgp41_algorithm.c.
| #define TAU_MEAN_HOURS (12.f) |
tau mean hours
Definition at line 54 of file driver_sgp41_algorithm.c.
| #define TAU_VARIANCE_HOURS (12.f) |
tau variance hours
Definition at line 55 of file driver_sgp41_algorithm.c.
| #define TUNING_GAIN_FACTOR_MAX (1000) |
tuning gain factor max
Definition at line 96 of file driver_sgp41_algorithm.c.
| #define TUNING_GAIN_FACTOR_MIN (1) |
tuning gain factor min
Definition at line 95 of file driver_sgp41_algorithm.c.
| #define TUNING_GATING_MAX_DURATION_MINUTES_MAX (3000) |
tuning gating max duration minutes max
Definition at line 92 of file driver_sgp41_algorithm.c.
| #define TUNING_GATING_MAX_DURATION_MINUTES_MIN (0) |
tuning gating max duration minutes min
Definition at line 91 of file driver_sgp41_algorithm.c.
| #define TUNING_INDEX_OFFSET_MAX (250) |
tuning index offset max
Definition at line 86 of file driver_sgp41_algorithm.c.
| #define TUNING_INDEX_OFFSET_MIN (1) |
tuning index offset min
Definition at line 85 of file driver_sgp41_algorithm.c.
| #define TUNING_LEARNING_TIME_GAIN_HOURS_MAX (1000) |
tuning learning time gain hours max
Definition at line 90 of file driver_sgp41_algorithm.c.
| #define TUNING_LEARNING_TIME_GAIN_HOURS_MIN (1) |
tuning learning time gain hours min
Definition at line 89 of file driver_sgp41_algorithm.c.
| #define TUNING_LEARNING_TIME_OFFSET_HOURS_MAX (1000) |
tuning learning time offset hours max
Definition at line 88 of file driver_sgp41_algorithm.c.
| #define TUNING_LEARNING_TIME_OFFSET_HOURS_MIN (1) |
tuning learning time offset hours min
Definition at line 87 of file driver_sgp41_algorithm.c.
| #define TUNING_STD_INITIAL_MAX (5000) |
tuning std initial max
Definition at line 94 of file driver_sgp41_algorithm.c.
| #define TUNING_STD_INITIAL_MIN (10) |
tuning std initial min
Definition at line 93 of file driver_sgp41_algorithm.c.
| #define VOC_INDEX_OFFSET_DEFAULT (100.f) |
voc index offset default
Definition at line 77 of file driver_sgp41_algorithm.c.
| #define VOC_SRAW_MINIMUM (20000) |
voc sraw minimum
Definition at line 82 of file driver_sgp41_algorithm.c.