# A Dual-Adaptive Approach Based on Discrete Cosine Transform for Removal of ECG Baseline Wander
## 1 Introduction  
With the development of computing technology, computer-aided diagnosis of cardiovascular diseases based on electrocardiograms (ECGs) has emerged as a popular area of research [1; 2; 3]. However, the ECG signal is prone to being contaminated with artifacts because it is captured and externally recorded by skin electrodes. Baseline wander (BW) is a type of low-frequency artifact in ECG which may stem from respiration and body movements. Removal of BW is an important step in the preprocessing stage of the ECG signal. However, the spectrum of BW usually overlaps with those of low-frequency ECG components such as the T-wave, P-wave, and ST segment. Removal of BW can cause distortions to these components which contain important clinical information. For example, the ST segment is a typical measurement for the diagnosis of ST-elevation myocardial infarction (STEMI) [4; 5], while microvol T-wave alternans (MTWA) has a strong association with the increased risk of ventricular tachyarrhythmias [6]. Therefore, it is desirable that any algorithm used for BW removal can fully eliminate BW and also preserve the original clinical information. In the past three decades, many approaches have been reported in the literature to address this issue. In general, these methods can be categorized as follows: linear filtering methods, nonlinear filtering methods, curve-fitting methods, and transform-reconstruction methods. Linear filters, whose output is a linear function of the input, mainly contain two types: finite impulse response (FIR) filters and infinite impulse response (IIR) filters. FIR filters are normally preferred because of their linear phase characteristics [7], but a major drawback of these methods is that their cutoff frequencies are time-invariant. Nonlinear filters such as weighted median filters (WMFs) [8] and morphological filters [9; 10] are receiving increasingattention when ECGs and BW spectra overlap. However, the WMF-based method has a high computation cost because samples within its sliding window need to be maintained in sorted order all the time. Whereas, the methods based on morphological filters must design a proper structuring element for morphological operators. Curve fitting is another nonlinear approach for BW correction. Cubic splines, polynomial, and rational functions are used to fit the BW after PR-segments have been determined [11; 12] while [13] suggest that when the magnitude of BW is small, it is better to approximate by linear functions. However, the two biggest hurdles associated with curve-fitting methods are the extraneous frequency components brought into the ECG signal and the characteristic-segment detection requirement. Transform-reconstruction methods, as their name suggests, contain two steps. Firstly, the transformation of the raw ECG signal into a transform domain in which the coefficients corresponding to BW are eliminated. Secondly, the reconstruction of the output signal, which is BW corrected, from the residual coefficients. Methods based on principal component analysis (PCA), independent component analysis (ICA) [14], wavelet transform (WT) [15; 16; 17], and discrete cosine transform (DCT) [18] fall into this category. WT-based methods assume that BW can be captured by the coarse approximation \(cA_{j}\) of level \(j\). Therefore, how to choose the proper level, \(j\), emerges as a crucial problem [19]. DCT is used for the estimation of BW by making the higher-order DCT coefficients zeroes [20]. This method has proven to be effective since it can be regarded as a linear-phase low-pass filter. However, the cut-point between BW and the inherent ECG components is determined simply by detecting the peak in the Fourier spectrum. In this paper, an improved DCT-based method is proposed, which adopts a dual-adaptive scheme to search for the optimal cut-point between BW and inherent ECG components before conducting BW removal. The remainder of the paper is organized as follows.