## 4 Evaluation
### The Quality Evaluation of Compression  
We perform the proposed ECG signal compression using the MATLAB numerical simulation software. Figure 7 shows the ECG signal after compression. Some indices including compression ratio (CR), compressed-signal to noise ratio (CNR), and are utilized to evaluate the quality of compression. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Strength \(\mathbf{\alpha}\)** &
\begin{tabular}{c} **The Proposed** \\ **Algorithm** \\ \end{tabular} & **Reference [10]** \\ \hline
150 & 0 & 0 \\
200 & 0 & 3.125 \\
250 & 0 & 6.25 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Testing Results via White Noise Attack with various strength. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Cut-off Frequency** &
\begin{tabular}{c} **The Proposed** \\ **Algorithm** \\ \end{tabular} & **Reference [10]** \\ \hline
140 & 0 & 6.25 \\
100 & 11.76 & 9.375 \\
90 & 11.76 & 9.375 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Testing results via low-pass filtering attack with various cut-off frequencies. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Sampling Rate** & **The Proposed Algorithm** & **Reference [10]** \\ \hline
1/2 & 0 & 0 \\
1/4 & 0 & 0 \\
1/8 & 0 & 3.125 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Testing results via resampling attack with various sampling rates. Figure 7: The ECG signal after compression. The compression ratio (CR) is defined as the size (data storage bytes) ratio of the original signal to that of the compressed signal [28]:  
\[[\text{ CR}=\frac{\textit{Data size before compression}}{\textit{Data size after compression}}\,] \tag{18}\]  
The CR of the first compression (CR1) and the CR of the second compression (CR2) are listed in the Table 4. Compressed-signal to noise ratio (CNR) is proposed to evaluate the quality of compressed ECG signal and is defined as follows:  
\[[\textit{CNR}=10\log[\frac{\sum_{i=1}^{n}{S_{i}^{2}}}{\sum_{i=1}^{n}(s_{i}-D_ {i})^{2}}]\,] \tag{19}\]  
where \(S\) represents the source data and \(D\) represents the data after compression. The CNR of the first compression (CNR1) and the CNR of the second compression (CNR2) are listed in Table 4. Figure 8 shows the original, watermarked, and compression ECG signal. The blue curve indicates the original, the green curve represents the watermarked, and the red curve represents the compressed. As shown in the figure, the differences among the original signal, the watermarked signal and the decompression signal are so small as to be almost negligible. In addition to the previous evaluation methods, verification evaluation is proposed to measure the similarity between the original ECG signal \(S_{1}\) and the watermarked (or compressed) ECG signal \(S_{2}\). First, we obtain watermarked and compression ECG data and then perform ECG verification for the 47 individual data sets for a fair comparison. The evaluation process can be divided into the following three steps: \begin{table}
\begin{tabular}{c c c c} \hline
**CR1** & **CR2** & **CNR1** & **CNR2** \\ \hline
1.28 & 1.96 & 16.2563 & 14.7179 \\ \hline \end{tabular}
\end{table} 
Table 4: Testing Results of CR1, CR2, CNR1, and CNR2. Figure 8: The original, watermarked, and compression ECG signal; the blue curve indicates the original, the green curve represents the watermarked, and the red curve represents the compressed. First, we must preprocess the evaluation data from the previous watermarking and compression approaches. It first segments the previous watermarking and compression ECG signals, and processes them into a binary signal for length consistency. This uses a sampling rate of 360 with four cycles as a group, and every four groups form a sequence. If the cycle is insufficient, it makes a copy of the first cycle for the insufficient cycle. Moreover, if the ECG signal of each cycle is not consistent, we also perform a stretch or shrink for length consistency. In the second step, we perform the DWT on the previously preprocessing data, respectively.