# A Dual-Adaptive Approach Based on Discrete Cosine Transform for Removal of ECG Baseline Wander
## 3 Results
### Performance Comparison on Real ECG Record  
In the first experiment, to illustrate the effectiveness of the proposed method on the CFF calculation, which is a vital step for the whole process, the first 20 s portion of each record in the MIT-BIH database was taken into consideration. For the sake of comparison, the \"gold standard\" CFF should have been calculated according to its definition, \"CFF is the frequency of heartbeat occurrence in unit of time\". However, the number of heartbeat occurrences is difficult to count in a 20 s portion due to the incompleteness of the heartbeat at each end. The \"gold standard\" CFF is approximately calculated using Equation (13) according to R-wave occurrence, which is an analog of heartbeat occurrence and much easier to count. \[CFF_{R-wave}=N_{R-wave}/L \tag{13}\]where \(N_{R-ture}\) is the number of R-waves that occur in \(L\) seconds-long ECG, and \(CFF_{R-ture}\) is the approximation of the \"gold standard\" CFF according to R-wave occurrence. The correctness of the CFF calculation with the proposed method was measured using the following Equation (14). \[|CFF_{det}-CFF_{R-wave}|<0.1*CFF_{R-wave} \tag{14}\]  
where \(CFF_{det}\) is the CFF calculated using the proposed method through DCT domain analysis. \(CFF_{det}\) was considered to be correct if it tallified with this rule. It was reasonable to adopt this rule because the \(CFF_{R-ture}\) itself may have a maximum difference of \((0.1*~{}CFF_{R-ture})\) with the real \"gold standard\" CFF. Experimental results demonstrated that, only 4 (record number: 203, 208, 221, and 232) out of a total of 48 records in this database failed to meet the rule, which means that the proposed CFF-calculation method achieved an accuracy of 91.67%. The four failed records were abnormal cases that contained ectopic heartbeats as shown in Figure 4. As a supplement, the same experiment was conducted with the PTB database and it obtained a higher accuracy of 95.80%. In the second experiment, BW removal was carried out on abnormal records using \(CFF_{R-ture}\) and \(CFF_{det}\), respectively, in order to compare the impact of the two CFF-calculation schemes on the final result. After the CFF (\(CFF_{R-ture}\) or \(CFF_{det}\)) had been calculated, a DCT-based filter with a 0.9\(\times\)CFF cutoff frequency was applied. Figure 4: The impact of two CFFs when processing abnormal records (MIT-BIH record 208, lead I, 00:00–00:10). (**a**) Original ECG. (**b**,**c**) BW corrected ECG by using \(CFF_{R-wave}\) and \(CFF_{det}\), respectively. (**d**) Locations of the \(CFF_{R-ture}\) and \(CFF_{det}\) in the DCT domain. (**e**,**f**) Estimated BWs by using \(CFF_{R-wave}\) and \(CFF_{det}\), respectively. The surrounding ellipses indicate the ST segment of the ectopic beats. The comparison results of the two CFFs is demonstrated in Figure 4. BW removal using the two CFFs was conducted on the abnormal record 208 which included premature ventricular contractions (PVCs). It was observed that the reconstructed ECG using \(CFF_{R-wave}\) had some distortions especially on the ST segment (which is framed in ellipses in Figure 4b). The ST-segment elevation was one of the abnormal presentations in patients with PVCs [31; 32], if we compared the ECGs with the first few heart heats in detail shown in Figure 5, the original ECG in Figure 5a presented the ST-segment elevation, while the ECG in Figure 5b may have suppressed the important information. In contrast, the proposed method based on DCT-domain analysis achieves a promising result with keeping the ST-segment elevations shown in Figure 5c. The reason behind this is that the periodicity of ECG signals may be destroyed by abnormalities such as PVCs and arrhythmias. As Figures 4b and 5b show, there was a prominent unusual frequency component, caused by PVCs that appeared before \(CFF_{R-wave}\). Note that it still belongs to inherent ECG components and eliminating it would consequently cause distortions.