ECG Compression Benchmark
Verified browser-codec result for the bundled 500 Hz / 2 s sample
Lossless test
Samples1,000
Sampling rate500 Hz
Raw size3,000 B
Target≤1,000 B
Actual test result
The bundled file sample_ecg_500hz_2s.csv was run through the same compression/decompression logic used by the lab. Reconstruction was compared sample-by-sample against the original integer sequence.
| Codec | Compressed | Reduction | Exact reconstruction | 1 KB target |
|---|---|---|---|---|
| Delta + ZigZag Varint | 2,098 B | 30.1% | PASS | NOT MET |
| Delta-of-Delta + ZigZag Varint | 1,717 B | 42.8% | PASS | NOT MET |
Compression ratio
The best of the two tested modes reduced the 3,000-byte raw representation to 1,717 bytes.
57.2% of the raw size remains • 42.8% reduction • 717 B above the 1,000 B target
What this tells us
- The codec is lossless on this sample: every one of the 1,000 reconstructed samples matched exactly.
- Delta-of-delta performs better than first-order delta on this sample.
- The current two codecs do not satisfy the 1,000-byte-per-lead target.
- This bundled dataset is synthetic, so this result is a codec benchmark, not evidence of performance on real ADS1292R recordings.
- The next engineering step should be testing real ADS1292R 24-bit captures and evaluating stronger entropy/bit-packing schemes before firmware implementation.