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
.cand.hfiles 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8525ae25f3bde503251cbda899e08bf7deda74fd07a1d5bfc077bfc63a455796
|
|
| MD5 |
b0d04707cb3bf75e9297d1b761c0ed99
|
|
| BLAKE2b-256 |
64d718e27936c3f763072743a268f3f0b8870753e95421a063616a7dda331cc1
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dce9e96e7fdec9c56059095bcb8fd314e925058da7bcf1de3a229de6fc19f79
|
|
| MD5 |
c4c34ccfe23db12da5b9e93e04269b40
|
|
| BLAKE2b-256 |
e42292ab3df365b8499c8bc52d25d7e364f4f98856632d30ac2db33ef0c65126
|