# A Real Time and Lossless Encoding Scheme for Patch Electrocardiogram Monitors
## 4 Discussion  
Lossy compression methods produce a much higher CR than lossless methods [26], with some methods achieving 10-20 times the compression with total errors under 10%. Table 4 shows the reported lossless compression results obtained from many different sources. Although the proposed method does not outperform other methods in terms of total compression, it can be easily implemented through ASIC or FPGA. In addition, although the heartbeat detection feature may not be entirely accurate, it may be suitable for some applications. The result could be used to trigger ECG data transmission, which could be followed by analysis at a medical center. Existing PEM systems provide a feasible ECG recording solution that replaces wireless transmission with local storage. To determine its capabilities, fixed-block mode was implemented and verified on an Xilinx ML505 FPGA evaluation board (Figure 12). Arithmetic and logic units were used to implement the proposed scheme, which is shown as a block diagram in Figure 13. This implementation is triggered by data input from ADC conversion to reduce power consumption. An rs232 module was used as a communication interface between the desktop computer and evaluation board that transfers MIT/BIH arrhythmia data and verifies data compression. Table 4 presents the results from various lossless ECG compression sources. Typical \"entropy coding\" is Huffman coding, which requires the Huffman tree to be written as part of the data. Differential pulse-code modulation (DPCM) uses a baseline of pulse-code modulation and a prediction function to encode data. DPCM linear prediction uses a discrete-time signal to estimate a linear function from previous samples. The entropy coding of second differences and orthogonal transforms--Compute Tomography (CT), Korhunen-Loeve transform (KLT), and Hibert transform (HT)--have the same time complexity, but orthogonal transforms is a frequency domain method; therefore, more computational power is used. In Figure 13, the encoding scheme's delta coding module comprises CURRENT, PREVIOUS, and DELTA. The ROTATION and SEPARATION operation implement the zero separation module \begin{table}
\begin{tabular}{c c} \hline
**ECG Data Compression Schemes** & **Compression Rate** \\ \hline Entropy coding of 2 nd differences & 2.8 \\ DPCM—delta coding with threshold & 4 \\ DPCM—LINEAR PREDICTION & 2.5 \\ Orthogonal transforms—CT, KLT, HT & 3 \\ Proposed encoding scheme & 2.1 \\ \hline \end{tabular}
\end{table} 
Table 4: Lossless compression rate method. DPCM: differential pulse-code modulation. \begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline
**HIGH-BITS** & \multicolumn{2}{c}{**4 BITS**} & \multicolumn{2}{c}{**5 BITS**} & \multicolumn{2}{c}{**6 BITS**} & \multicolumn{2}{c}{**7 BITS**} \\ \hline  & **QRS** & **C.R** & **QRS** & **C.R** & **QRS** & **C.R** & **QRS** & **C.R** & **QRS** \\ \hline
**100** & 2273 & 1.52 & 2272 & 1.72 & 2272 & 2.00 & 2272 & 2.19 & 2272 \\
**101** & 1865 & 1.52 &  
to generate the high and low-bit streams, which indicate to the other module that the input signal is ready. The low-bit stream is connected to the four-pin LowData_out interface, and can be stored on an external flash drive with four-bit writing. ZRLE uses MAX, HALF, ZERO, and ZERO-COUNTER to compress the high-bit stream from the previous module. ZERO-COUNTER is an increment that is used to count the number of consecutive zeros to trigger one MAX, HALF, or ZERO operation. The high-bit output stream can also be stored on an external flash drive using the storage module. Furthermore, Output_status_0 and Output_status_1 are used to identify three different output formats that appear in the high-bit stream pipeline system architecture: non-zero value status, maximal zero value status, and continual zero values with a non-zero value status. Two studies have developed lossless ECG data compression chips [26; 35] and determined that a high operation clock is not needed (Table 5).