# A Dual-Adaptive Approach Based on Discrete Cosine Transform for Removal of ECG Baseline Wander
## 4 Discussion  
Benefitting from the robust CFF-calculation subprocedure, both algorithms I and II achieved the most promising results. Nonetheless, algorithm I slightly outperformed algorithm II as shown in Figures 7 and 9. One major factor that contributed to the robustness of the proposed CFF-calculation method lies in the QRS-complexes extraction by the DCT-based band-pass filter. Compared with other CFF-calculation methods based on R-wave detection, the proposed method illustrated its greater simplicity and effectiveness in the presence of various artifacts and abnormalities as shown in Figures 4 and 5. The DCT-based filtering technique [27] was also compared to the linear phase, sharp cut-off FIR filter [28]. Both types of filters had a linear-phase response which was their common favorable characteristic for BW removal. As shown in and Figure 8, some inherent ECG components are filtered by the FIR filter, while the DCT-based filter seldom affects the inherent components although their cutoff frequencies are set to be the same. This is because the DCT-based filter possesses unique ideal frequency characteristics. For instance, the transition band of the DCT-based filter can be as narrow as \((F_{s}/2N)\) Hz theoretically, which is the frequency interval between two adjacent DCT coefficients. Moreover, the DCT-based filter has negative infinite magnitude response on the stop band and infinite passband gain theoretically [27]. However, these characteristics cannot be realized by the FIR filter because it needs an infinite impulse response. Therefore, the DCT-based filter outperforms the FIR filter in terms of eliminating the unwanted frequency components precisely with the inherent ECG components intact. As shown in Figures 6-9, the proposed method is superior to the WT-based method. This is because WT-based methods are based on the assumption that BW can be captured by the coarse approximation \(cA_{j}\) of level \(j\). The frequency span of \(cA_{j}\) is \(\left[\,0\,\sim\,(F_{s}/2)*2^{-j}\right]\), which indicates that the estimated BW has the cutoff frequency of \((F_{s}/2)*2^{-j}\) Hz. For example in Figure 6, if \(j\) is chosen to be 8, 9, and 10, then the cutoff frequency of the estimated BW is 1.9531, 0.9766, and 0.4883 Hz, respectively. Evidently, it is not possible to adjust the cutoff frequency precisely in accordance with CFF and the degree of BW exists in ECG. In contrast, the proposed method seeks for the optimal cut-point by constructing an amplitude vector whose frequency span is CFF. Given that the amplitude vector contains G elements, then the frequency resolution of the proposed method can be accurate to CFF/G. Therefore, the proposed method can remove BW more precisely than the WT-based method. Finally, as shown in Figures 7-9, the proposed method outperformed the weighted median filter. The weighted median filter was unable to trace the turning corner caused by severe BW (shown in Figure 7) due to the improper length of its sliding window. However, the weighted median filter achieved better results than the WT-based method and FIR filter when processing ECGs with moderate BW in the simulated experiments. Nonetheless, the proposed method is far superior to the weighted median filter as illustrated by the CC curves in Figure 9.  
In conclusion, the proposed algorithm achieved the best performance in terms of fully removing BW and preserving the original clinical information when compared with three previous methods. The reasons for its outstanding performance are threefold. Firstly, it contained a robust subprocedure to calculate CFF properly, which ensured that the cup-point between BW and the ECG did not exceed CFF. Secondly, it included a novel scheme to seek the optimal cut-point by means of constructing an amplitude vector using lower-order DCT coefficients. Thirdly, it adopted a new filtering technique based on DCT, which had the ideal frequency properties.