Skip to main content

Sensirion Gas Index Algorithm

Sensirion’s Gas Index Algorithm software provides a VOC and an NOx Index output signal calculated from the SGP40/41 raw signal inputs SRAW_VOC and SRAW_NOX. Note: for SGP40, only SRAW_VOC is available. This algorithm enables robust detection of ambient changes of VOCs and NOx with minimal sensor-to-sensor variation. The algorithm is based on a statistical gain-offset normalization and adapts both parameters constantly applying an exponentially decaying function of the learned parameters to be able to adapt to changing environments.

For the VOC Index output, the software must be instanced as VOC Algorithm while for the NOx Index output, the software must be instanced as NOx Algorithm. It is important to feed the raw signals to the corresponding algorithm (i.e., SRAW_VOC to the VOC Algorithm and SRAW_NOX to the NOx Algorithm) at a constant sampling interval which must coincide with the sampling interval that is used to read out the raw signals from the SGP40/41 sensor. The default sampling interval applied in the algorithm is 1 s. In case, a different sampling interval should be used the definition of the sampling interval in the h.file of the algorithm must be changed, too.

The algorithm calculates the VOC and NOx Index signals recursively from a single raw tick value of SRAW_VOC and SRAW_NOX, respectively, which are both measured by the SGP40/41 sensor at each time step, as well as internal states that are updated at each time step. These internal states are most importantly the recursively estimated mean and variance of the corresponding SRAW signal as well as some additional internal states such as uptime and other counters. After estimating the states, the algorithm converts the raw signals in ticks into either VOC or NOx Index, respectively, and applies an adaptive low-pass filter.

Install

pip install sensirion-gas-index-algorithm

Recommended usage is within a virtualenv.

Usage VOC Algorithm

from sensirion_gas_index_algorithm.voc_algorithm import VocAlgorithm

voc_algorithm = VocAlgorithm()
s_voc_raw = 27000  # read out from SGP41
for _ in range(100):
    voc_index = voc_algorithm.process(s_voc_raw)
    print(voc_index)

Usage NOx Algorithm

from sensirion_gas_index_algorithm.nox_algorithm import NoxAlgorithm

nox_algorithm = NoxAlgorithm()
s_nox_raw = 18000  # read out from SGP41
for _ in range(100):
    nox_index = nox_algorithm.process(s_voc_raw)
    print(nox_index)

CHANGELOG

3.2.1

  • Use floating point version of Gas Index Algorithm

3.2.0

  • Add low power examples

  • Allow chaning of sampling interval

3.1.0

  • Add VOC gas index algorithm version 3.1.0

  • Add NOx gas index algorithm version 3.1.0

Metadata

Release files for sensirion-gas-index-algorithm 3.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sensirion-gas-index-algorithm 3.2.2
File Size Uploaded Provenance Actions
sensirion-gas-index-algorithm-3.2.2.tar.gz 49.4 kB Without provenance Details for sensirion-gas-index-algorithm-3.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sensirion-gas-index-algorithm 3.2.2
File Interpreter ABI Platform Actions
sensirion_gas_index_algorithm-3.2.2-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details for sensirion_gas_index_algorithm-3.2.2-cp38-cp38-win_amd64.whl

Total release size: 92.4 kB

Release files / sensirion-gas-index-algorithm-3.2.2.tar.gz

Download URL sensirion-gas-index-algorithm-3.2.2.tar.gz
Size 49.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a7c1de5ffef8f2245b35ad3c5a426747bbbfa5b3803534bc27ba88d77dbcaf2e
BLAKE2b-256 checksum
How to use checksums
46672469ae7f760281a8ad06b79bb8b1886877c2b40c94b2516a36459d096022
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.9.2 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/3.6.9

Release files / sensirion_gas_index_algorithm-3.2.2-cp38-cp38-win_amd64.whl

Download URL sensirion_gas_index_algorithm-3.2.2-cp38-cp38-win_amd64.whl
Size 43.0 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
b26feabb8662366394ae73aee1143e402a6bf756ac664cd0a9aa4eece3c1f01c
BLAKE2b-256 checksum
How to use checksums
21735deeb0bcc2455064ec7d61fe21ba3fde2b4b57a65c9e62f2d8204e017598
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.9.2 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/3.6.9

Security for sensirion-gas-index-algorithm 3.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page