A Proposed Lossless ECG Compression Method Using Second-Order Delta Encoding and Arithmetic Coding on a Raspberry Pi-Based Embedded System
Downloads
Portable electrocardiogram (ECG) recorders have limited memory, yet their recordings must be stored without any loss of diagnostic information. This study aims to develop and validate a lossless ECG compression method simple enough for a low-cost embedded device. The main contribution is a compression method that combines second-order delta encoding with arithmetic coding, together with a mathematical rule that predicts when second-order delta encoding compresses better than first-order delta encoding. The method was implemented on a Raspberry Pi Zero 2 W with an AD8232 ECG sensor and an ADS1115 analog-to-digital converter, and it was compared with Huffman, Lempel-Ziv-Welch, and run-length coding, with and without delta encoding. The evaluation used hardware recordings from a single volunteer and 687 records from three public databases (MIT-BIH Arrhythmia, European ST-T, and PTB Diagnostic). All 8,244 tested combinations were reconstructed exactly, bit for bit. The proposed method achieved a mean compression ratio of 3.248 on the MIT-BIH database, whereas first-order delta encoding performed better on the European ST-T (2.969) and PTB (4.964) databases, as predicted by the derived rule. On hardware recordings, the compression ratio was about 2.0, and a standing posture raised 50 Hz power-line noise and lowered the compression ratio by up to 23%. Heartbeat detection on 745 beats showed 100% sensitivity and 100% positive predictivity, with no significant timing difference caused by 8-bit quantization (p = 0.361). In conclusion, the proposed method can roughly double the recording time of a memory-limited ECG device without additional hardware, which makes it a practical option for long-term wearable heart monitoring. Future work will extend the validation to multiple subjects and multi-lead recordings.
World Health Organization, “Cardiovascular diseases (CVDs).” Accessed: Sep. 21, 2026. [Online]. Available: https://www.who.int/news-room/fact-sheets/detail/cardiovascular-diseases-(cvds)
[2] A. Němcová, R. Smíšek, L. Maršánová, L. Smital, and M. Vítek, “A comparative analysis of methods for evaluation of ECG signal quality after compression,” Biomed Res. Int., vol. 2018, 2018, doi: 10.1155/2018/1868519.
[3] M. A. Serhani, H. T. El Kassabi, H. Ismail, and A. Nujum Navaz, “ECG monitoring systems: Review, architecture, processes, and key challenges,” Sensors (Switzerland), vol. 20, no. 6, Mar. 2020, doi: 10.3390/s20061796.
[4] N. C. Smith, “Method and apparatus for data compression in an ECG monitoring system,” US 4,947,858 A, Aug. 14, 1990 Accessed: Sep. 29, 2026. [Online]. Available: patents.google.com/patent/US4947858
[5] G. H. Bardy, J. Mikalson Bishay, and J. Felix, “Electrocardiography and respiratory monitor,” US 10,602,977 B2, Mar. 31, 2020 Accessed: Sep. 29, 2026. [Online]. Available: patents.google.com/patent/US10602977B2
[6] M. Jacobsson, F. Seoane, and F. Abtahi, “The role of compression in large scale data transfer and storage of typical biomedical signals at hospitals,” Health Informatics J., vol. 29, no. 4, Oct. 2023, doi: 10.1177/14604582231213846.
[7] Association for the Advancement of Medical Instrumentation, “ANSI/AAMI EC11:1991 Diagnostic electrocardiographic devices,” Arlington, VA, 1991.
[8] P. Rubel, J. Fayn, P. W. Macfarlane, D. Pani, A. Schlögl, and A. Värri, “The History and Challenges of SCP-ECG: The Standard Communication Protocol for Computer-Assisted Electrocardiography,” Hearts, vol. 2, no. 3, pp. 384–409, Aug. 2021, doi: 10.3390/hearts2030031.
[9] A. Tiwari and T. H. Falk, “Lossless electrocardiogram signal compression: A review of existing methods,” Biomed. Signal Process. Control, vol. 51, pp. 338–346, May 2019, doi: 10.1016/j.bspc.2019.03.004.
[10] K. Bannajak, N. Theera-Umpon, and S. Auephanwiriyakul, “Signal Acquisition-Independent Lossless Electrocardiogram Compression Using Adaptive Linear Prediction,” Int. J. Environ. Res. Public Health, vol. 20, no. 3, Feb. 2023, doi: 10.3390/ijerph20032753.
[11] S. Banerjee and G. K. Singh, “A New Real-time Lossless Data Compression Algorithm for ECG and PPG Signals,” Biomed. Signal Process. Control, vol. 79, p. 104127, 2023, doi: 10.1016/j.bspc.2022.104127.
[12] T. H. Tsai and M. A. Hussain, “VLSI Implementation of Lossless ECG Compression Algorithm for Low Power Devices,” IEEE Transactions on Circuits and Systems II: Express Briefs, vol. 67, no. 12, pp. 3317–3321, Dec. 2020, doi: 10.1109/TCSII.2020.2978554.
[13] T. H. Tsai and W. T. Kuo, “An Efficient ECG Lossless Compression System for Embedded Platforms with Telemedicine Applications,” IEEE Access, vol. 6, pp. 42207–42215, Jul. 2018, doi: 10.1109/ACCESS.2018.2858857.
[14] C. J. Deepu, X. Zhang, C. H. Heng, and Y. Lian, “A 3-Lead ECG-on-chip with QRS detection and lossless compression for wireless sensors,” IEEE Transactions on Circuits and Systems II: Express Briefs, vol. 63, no. 12, pp. 1151–1155, Dec. 2016, doi: 10.1109/TCSII.2016.2613564.
[15] G. Campobello, A. Segreto, S. Zanafi, and S. Serrano, “An Efficient Lossless Compression Algorithm for Electrocardiogram Signals,” in 2018 26th European Signal Processing Conference (EUSIPCO), Rome, Italy: IEEE, Sep. 2018, pp. 777–781. doi: 10.23919/EUSIPCO.2018.8553597.
[16] D. Rzepka, “Low-complexity lossless multichannel ECG compression based on selective linear prediction,” Biomed. Signal Process. Control, vol. 57, Mar. 2020, doi: 10.1016/j.bspc.2019.101705.
[17] A. Mitra, P. Kundu, and R. Gupta, “Deep Learning Based Approach for Lossless ECG Compression,” Cardiovasc. Eng. Technol., vol. 17, no. 2, pp. 155–174, 2026, doi: 10.1007/s13239-026-00821-5.
[18] M. S. Manikandan and S. Dandapat, “Wavelet-based electrocardiogram signal compression methods and their performances: A prospective review,” Biomed. Signal Process. Control, vol. 14, pp. 73–107, 2014, doi: 10.1016/j.bspc.2014.07.002.
[19] H. S. Pal, A. Kumar, A. Vishwakarma, and M. K. Ahirwal, “Electrocardiogram signal compression using tunable-Q wavelet transform and meta-heuristic optimization techniques,” Biomed. Signal Process. Control, vol. 78, Sep. 2022, doi: 10.1016/j.bspc.2022.103932.
[20] I. Devindi, S. Liyanage, T. Jayarathna, J. Alawatugoda, and R. Ragel, “A novel ECG compression algorithm using Pulse-Width Modulation integrated quantization for low-power real-time monitoring,” Sci. Rep., vol. 14, p. 17162, 2024, doi: 10.1038/s41598-024-68022-5.
[21] M. Wasimuddin, K. Elleithy, A.-S. Abuzneid, M. Faezipour, and O. Abuzaghleh, “Stages-Based ECG Signal Analysis From Traditional Signal Processing to Machine Learning Approaches: A Survey,” IEEE Access, vol. 8, pp. 177782–177803, 2020, doi: 10.1109/ACCESS.2020.3026968.
[22] D. Cuevas-González et al., “ECG Standards and Formats for Interoperability between mHealth and Healthcare Information Systems: A Scoping Review,” Int. J. Environ. Res. Public Health, vol. 19, no. 19, Oct. 2022, doi: 10.3390/ijerph191911941.
[23] S. M. S. Jalaleddine, C. G. Hutchens, R. D. Strattan, and W. A. Coberly, “ECG Data Compression Techniques-A Unified Approach,” IEEE Trans. Biomed. Eng, vol. 37, no. 4, pp. 329–343, Apr. 1990, doi: 10.1109/10.52340.
[24] A. Koski, “Lossless ECG encoding,” Comput. Methods Programs Biomed., vol. 52, no. 1, pp. 23–33, 1997, doi: 10.1016/S0169-2607(96)01779-8.
[25] O. Kerdjidj, A. Amira, K. Ghanem, N. Ramzan, S. Katsigiannis, and F. Chouireb, “An FPGA implementation of the matching pursuit algorithm for a compressed sensing enabled e-Health monitoring platform,” Microprocess. Microsyst., vol. 67, pp. 131–139, Jun. 2019, doi: 10.1016/j.micpro.2019.03.007.
[26] M. S. Zaman and B. I. Morshed, “A low-power portable scanner for body-worn Wireless Resistive Analog Passive (WRAP) sensors for mHealth applications,” Measurement, vol. 177, p. 109214, Jun. 2021, doi: 10.1016/j.measurement.2021.109214.
[27] C. J. Deepu, X. Zhang, W. S. Liew, D. L. T. Wong, and Y. Lian, “An ECG-on-Chip with 535 nW/channel integrated lossless data compressor for wireless sensors,” IEEE J. Solid-State Circuits, vol. 49, no. 11, pp. 2435–2448, Nov. 2014, doi: 10.1109/JSSC.2014.2349994.
[28] N. R. Saputri et al., “Enhancing the Electrocardiogram Signal Quality by Applying Butterworth Infinite Impulse Response Filter 8th Order,” Journal of Electronics, Electromedical Engineering, and Medical Informatics, vol. 4, no. 4, pp. 235–242, Oct. 2022, doi: 10.35882/jeeemi.v4i4.259.
[29] I. H. Witten, R. M. Neal, and J. G. Cleary, “Arithmetic coding for data compression,” Commun. ACM, vol. 30, no. 6, pp. 520–540, Jun. 1987, doi: 10.1145/214762.214771.
[30] C. E. Shannon, “A Mathematical Theory of Communication,” The Bell System Technical Journal, vol. 27, no. 3, pp. 379–423, Jul. 1948, doi: 10.1002/j.1538-7305.1948.tb01338.x.
[31] D. A. Huffman, “A Method for the Construction of Minimum-Redundancy Codes,” Proceedings of the IRE, vol. 40, no. 9, pp. 1098–1101, Sep. 1952, doi: 10.1109/JRPROC.1952.273898.
[32] J. Ziv and A. Lempel, “Compression of Individual Sequences via Variable-Rate Coding,” IEEE Trans. Inf. Theory, vol. 24, no. 5, pp. 530–536, Sep. 1978, doi: 10.1109/TIT.1978.1055934.
[33] T. A. Welch, “A Technique for High-Performance Data Compression,” IEEE Computer, vol. 17, no. 6, pp. 8–19, Jun. 1984, doi: 10.1109/MC.1984.1659158.
[34] G. B. Moody and R. G. Mark, “The Impact of the MIT-BIH Arrhythmia Database History, Lessons Learned, and Its Influence on Current and Future Databases,” IEEE Eng. Med. Biol. Mag., vol. 20, no. 3, pp. 45–50, 2001, doi: 10.1109/51.932724.
[35] A. Taddei et al., “The European ST-T database: standard for evaluating systems for the analysis of ST-T changes in ambulatory electrocardiography,” Eur. Heart J., vol. 13, no. 9, pp. 1164–1172, Sep. 1992, doi: 10.1093/oxfordjournals.eurheartj.a060332.
[36] R. Bousseljot, D. Kreiseler, and A. Schnabel, “Nutzung der EKG-Signaldatenbank CARDIODAT der PTB über das Internet,” Biomedizinische Technik, vol. 40, no. s1, pp. 317–318, 1995, doi: 10.1515/bmte.1995.40.s1.317.
[37] A. L. Goldberger et al., “PhysioBank, PhysioToolkit, and PhysioNet: Components of a New Research Resource for Complex Physiologic Signals,” Circulation, vol. 101, no. 23, pp. e215–e220, Jun. 2000, doi: 10.1161/01.CIR.101.23.e215.
[38] J. Pan and W. J. Tompkins, “A Real-Time QRS Detection Algorithm,” IEEE Trans. Biomed. Eng., vol. 32, no. 3, pp. 230–236, Mar. 1985, doi: 10.1109/TBME.1985.325532.
[39] P. D. Welch, “The Use of Fast Fourier Transform for the Estimation of Power Spectra: A Method Based on Time Averaging Over Short, Modified Periodograms,” IEEE Transactions on Audio and Electroacoustics, vol. 15, no. 2, pp. 70–73, Jun. 1967, doi: 10.1109/TAU.1967.1161901.
[40] F. Wilcoxon, “Individual Comparisons by Ranking Methods,” Biometrics Bulletin, vol. 1, no. 6, pp. 80–83, 1945, doi: 10.2307/3001968.
[41] Mortara Instrument Inc., “H12+ Digital Holter Recorder User Manual,” 2018. [Online]. Available: http://www.mortara.com
[42] F. Badilini, “The ISHNE Holter Standard Output File Format,” Ann. Noninvasive Electrocardiol., vol. 3, no. 3, pp. 263–266, 1998, doi: 10.1111/j.1542-474X.1998.tb00353.x.
Copyright (c) 2026 jalu_telkom wicaksana, Ahmad Sugiana, Junartho Halomoan (Author)

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution-ShareAlikel 4.0 International (CC BY-SA 4.0) that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).






