Skip to main content

CLUTGen, an ADC LUT generator for fast aquisition and calibration.

Reason this release was yanked:

deprecated yaml dependencies and use

Project description


C Lookup Table (LUT) Generator

CLUTGen automates the creation of Look-Up Tables for embedded systems, specifically for converting raw ADC (Analog-to-Digital Converter) readings into calibrated physical units (like temperature, pressure, or distance).

Features

  • Curve Fitting: Automatically find your fit from many algorithms.
    • Linear Interpolation
    • Cubic Splines
    • Polynomial Interpolation (up to 7th degree)
    • Piecewise Interpolation
  • Visual Preview: Generates plots to compare calibration data against the calculated LUT.
  • C Code Generation: Outputs production-ready .c and .h files with Doxygen-style comments.

Requirements

  • Python 3.10+
  • numpy, pandas, matplotlib, pyyaml, openpyxl (for Excel support)

Usage

# From the root of the repository
pip install .
# Generate LUTs with cubic splines fit for every configuration yaml in the given paths.
clutgen -s -i ./examples/calibration/*.y*ml ./examples/temperature_copy.yml

YAML Configuration Template

Create a table mapping your POIs with the given schema, where raw is the measured ADC raw value, and calibration is the desired output for the LUT at that given raw value:

raw,calibration

With your CSV table done (or Excel one), create a configuration YAML:

# temperature.yaml

name: "temp_sensor"                  # Used for variable names (e.g., temp_sensor_lut)
description: "ambient temperature"   # Used for documentation and plot titles
table_resolution_bits: 12            # Resolution (e.g., 12 bits = 4096 entries)
lut_type: "int16_t"                  # C type (int8_t, uint16_t, etc.)
 
generator: "./data/calibration.csv"  # Path to CSV/Excel with 'raw' and 'calibration' columns. Global or relative to this file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clutgen-0.0.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clutgen-0.0.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file clutgen-0.0.1.tar.gz.

File metadata

  • Download URL: clutgen-0.0.1.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for clutgen-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8525ae25f3bde503251cbda899e08bf7deda74fd07a1d5bfc077bfc63a455796
MD5 b0d04707cb3bf75e9297d1b761c0ed99
BLAKE2b-256 64d718e27936c3f763072743a268f3f0b8870753e95421a063616a7dda331cc1

See more details on using hashes here.

File details

Details for the file clutgen-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: clutgen-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for clutgen-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6dce9e96e7fdec9c56059095bcb8fd314e925058da7bcf1de3a229de6fc19f79
MD5 c4c34ccfe23db12da5b9e93e04269b40
BLAKE2b-256 e42292ab3df365b8499c8bc52d25d7e364f4f98856632d30ac2db33ef0c65126

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page