C3: An Ultra-Lightweight, Self-Healing Time-Series Compression Algorithm for Resource-Constrained Embedded Telemetry.
Abstract
This revision presents the mathematical formalisation of C3 version 4, a hybridpredictive-entropy codec, and accompanies the released portable C99 library (c3.c / c3.h)together with prebuilt artifacts for Windows (c3.dll), Linux (libc3.so) and ESP32/Xtensa(libc3.a). The codec state is a quadruple St= ⟨Ht, Ct, lt, at⟩: a 256-entry context history table Htpredicts each byte from its predecessor (a correct prediction costs 1 bit), a per-contextconfidence map Ct decides whether the hit bit is worthwhile, and a prediction miss is coded withan adaptive Golomb-Rice coder whose parameter kt follows an exponential moving average at ofthe residual magnitude. We prove (i) exact encoder/decoder lock-step by induction, (ii) strictfault containment of lost or corrupted packets, and (iii) a 24-bit worst-case bound per byte. Onthe target domain (non-repeating low-amplitude telemetry) C3 v4 compresses 30–55% betterthan the HeatShrink w8 baseline and the delta+HeatShrink pipeline; on perfectly periodicsignals LZSS-based codecs remain superior, a limitation stated honestly herein.
// Source
Authors: Daniele Rufo