# A Dual-Adaptive Approach Based on Discrete Cosine Transform for Removal of ECG Baseline Wander
## 3 Results
### Experiments with Simulated ECG and BW  
In order to evaluate the performances of different methods quantitatively, tests should be conducted on simulated ECG and BW whose properties are already known. We constructed the 'clean' ECGs by concatenating identical beats chosen from the PTB database. In total, 24 clean ECG signals were simulated. The length of each signal was 30 s, and the sampling rate was 1000 Hz. The beats of these signals had different morphological features and heart rates. They were chosen from 12 different leads of different records. The simulated BW, given in Equation (15), consisted of four components. The sinusoid components were used to mimic the typical BW caused by respiration [13]. Low-frequency random noise was also added in order to simulate the random noise from the outside environment. This random component was generated by filtering white noise (700 uV amplitude) through a fifth-order Butterworth low-pass filter with 0.3 Hz cutoff frequency. With the last random components generated 30 times, 30 different BWs were obtained. \[bw(n)=A*\sin(2\pi*0.2n/F_{s})+B*\cos(2\pi*0.35n/F_{s})+C*\cos(2\pi*0.45n/F_{s}) +\eta(n) \tag{15}\]  
where \(\eta(n)\) is the low-frequency random component and \(A\), \(B\), and \(C\) are amplitudes of sinusoid components. In the last experiment, the five algorithms were applied to the simulated ECGs. One example of simulated clean ECG and BW is shown in Figure 8. The contaminated ECG was obtained by summing the simulated clean ECG and BW. The reconstructed BWs using five algorithms were also plotted in this figure. As Figure 8 shows, it was difficult to distinguish the BWs reconstructed using algorithms I and II from the simulated one, which indicates that the DCT-based filters were capable of estimating the added BW ideally. Compared with the simulated BW, the one reconstructed using algorithm III introduces significant unwanted oscillations which were higher frequency components that came from 'clean' ECGs. Algorithms IV and V achieved moderate performances but nonetheless introduced visible distortions. Additionally, BW constructed using algorithm V was not smooth although the simulated BW was a smooth one, which is due to the nonlinear characteristic of this filtering technique. Figure 8: Comparison of estimated BW using five algorithms using the simulated ECG and BW. For quantitative evolution, the most widely used measures are mean square error (MSE), and signal-to-noise ratio (SNR). However, using these measures, it is difficult to access the quality of filtered signals which have different mean values due to the DC offset. All algorithms in this paper generated zero-mean'retrieved' ECG signals except algorithm V. In order to compare these algorithms fairly, we calculated the correlation coefficient (CC) between simulated 'clean' ECGs and'retrieved' ECGs to evaluate their performances. It can be seen from Equation (16) that CC was independent of the signals' mean values because there was an inner process to subtract the mean value of each signal from itself. The higher CC indicates the better properties of algorithms in preserving the original clinical information. \[\rho_{cr}=\sum_{n=1}^{N}[x_{c}(n)-u_{c}][x_{r}(n)-u_{r}]/\sigma_{c}\sigma_{r} \tag{16}\]  
where \(x_{c}(n)\) is the 'clean' ECG by simulation, \(x_{r}(n)\) is'retrieved' ECG by BW removal algorithms, \(\rho_{cr}\) is CC between these two signals. \(u_{c}\) and \(u_{r}\) are the expected values of \(x_{c}(n)\) and \(x_{r}(n)\), respectively, and \(\sigma_{c},\sigma_{r}\) are the standard deviations of \(x_{c}(n)\) and \(x_{r}(n)\), respectively. As mentioned before, a total of 24 'clean' ECGs and 30 BWs were generated. After applying five algorithms to these simulated ECGs, the CC of each'retrieved' ECG with respect to the simulated 'clean' ECG was calculated. But the retrieved ECGs using algorithms III and V have significant distortions at each end of the signal due to the moving window used in these techniques.