Department of Biomedical Informatics, Emory University
January 2024
The electrocardiogram (ECG), recorded by standard body surface leads, typically has an amplitude of several millivolts, and its spectral content ranges from approximately 0.05Hz to around 150Hz. When transformed into a digital signal, it first passes through an anti-aliasing low-pass filter (in the analog domain) before being sampled at a sampling frequency
The amplitude resolution of the digital signal depends on the number of bits of the analog-to-digital converter (ADC), denoted by
For example, if the input span of the ADC is
In clinical applications, the ECG is printed on standard ECG paper featuring fine grids and coarse grids. The fine grids are 1mm by 1mm, corresponding to 0.1mV in amplitude and 40ms in time. The coarse grids are 5mm by 5mm, corresponding to 0.5mV in amplitude and 200ms in time, as shown in the image below.
In modern ECG devices, despite the data being collected digitally and stored on computers or other digital platforms, the same convention is used. ECGs are visualized against the same background grids, whether displayed on a computer screen or printed as a PDF or image file. The number and format of the leads, along with the ECG grid color, vary depending on the ECG acquisition technology and the device manufacturer. The most common clinical ECGs are 12-lead, featuring approximately 2.5-second segments of the 12 leads arranged in a 3-row by 4-column grid. Additionally, one to three leads (typically leads II, V1, V2, or V5) are displayed as a longer 10-second strip at the bottom. Below is an example of a typical ECG image.
Printing an analog or digital ECG on paper and then rescanning it as an image involves implicit or explicit interpolation and resampling of the original ECG. When performed by an analog machine or a standard printer, it involves digital-to-analog circuitry to convert the discrete time samples into a continuous waveform, printed as a continuous curve on the paper. Once an ECG is printed, the original sampling frequency
Therefore, when a standard ECG, printed on A4 or letter-size paper, is scanned at full image size (without any cropping or excess borders), each 1 inch (25.4mm) horizontally and vertically maps to
As we can see, the effective sampling frequency
From the above equation, it is evident that typical image resolutions, such as 72 or 96 DPI, which are common in image analysis applications, are quite low for ECG scanning and digitization applications, as they only provide sampling frequencies of 70.9Hz and 94.5Hz, respectively. Based on this analysis, a resolution of at least 150 DPI or higher, without any lossy compression, is recommended for ECG scanning and digitization purposes.
Importantly, the calculation of the ECG grid size from the image DPI and paper size is accurate only when using a standard full-paper size scanner. For ECG images captured by cameras, smartphones, screenshots, or through cropping and resizing, the equivalency of 1 inch on the actual paper to the captured image DPI may not hold true. Consequently, ECG digitization algorithms should estimate the correct grid sizes by employing algorithms that detect and analyze the ECG grid sizes directly from the ECG image. Several functions for this purpose are provided in the ecg-image-digitizer
toolkit. Further details and examples can be followed from [Shivashankara 2023].
Please include references [Shivashankara 2023] and [ECG-Image-Kit] in publications related to this article.
-
Oppenheim, A. V., Schafer, R. W., & Buck, J. R. (1998). Discrete-time signal processing (2nd ed.). Upper Saddle River, NJ: Pearson. ISBN: 9780137549207
-
Marvasti, Farokh, ed. Nonuniform Sampling: Theory and Practice. (2001). Netherlands: Springer US.
-
Mitra, Sanjit K. Digital signal processing: a computer-based approach. McGraw-Hill Higher Education, 2001.
-
Reza Sameni. Digital Systems Design. Engineering school. Iran. 2018. ⟨cel-01815308⟩. Online at: https://hal.science/cel-01815308v1
-
Kshama Kodthalu Shivashankara, Deepanshi, Afagh Mehri Shervedani, Matthew A. Reyna, Gari D. Clifford, Reza Sameni (2023). A Synthetic Electrocardiogram (ECG) Image Generation Toolbox to Facilitate Deep Learning-Based Scanned ECG Digitization. arXiv. Online at: https://doi.org/10.48550/ARXIV.2307.01946
-
ECG-Image-Kit: A Toolkit for Synthesis, Analysis, and Digitization of Electrocardiogram Images, January 2024, Online at: https://github.com/alphanumericslab/ecg-image-kit