Baseline wander and power-line interference elimination of ECG signals using efficient signal-piloted filtering

A signal-piloted linear phase filtering tactic for removing baseline wander and power-line interference from the electrocardiogram (ECG) signals is suggested. The system is capable of adjusting its parameters by following the incoming signal variations. It renders the processing of lesser samples by inferior order filters. The applicability is demonstrated by using the MIT-BIH ECG database. The precision of the approach is also studied regarding the signal-to-noise ratio (SNR). Results showed that the proposed method achieves a 2.18-fold compression gain and notable computational efficiency over conventional counterpart while securing an analogous output SNR. A comparison of the designed solution is made with the contemporary empirical mode decomposition with Kalman filtering and eigenvalue decomposition based tactics. Results show that the suggested method performs better in terms of output SNR for the studied cases.

1. Introduction: Power-line interference (PLI) and baseline wander (BW) are the major noise elements, present in the electrocardiogram (ECG) signals [1,2]. The BW artefacts are introduced by respiration. These are of very low-frequency and mainly occurs between [0; 0.7] Hz [2]. The PLI is introduced because of the electromagnetic interference of the alternating supply. Depending on the power supply, the frequency of PLI is 50 Hz or 60 Hz. The involvement of these noise signals diminishes the diagnosis accuracy [3]. Therefore, removal of BW and PLI is obligatory for a precise diagnosis of the cardiac diseases [4,5]. In this framework, numerous techniques have been presented, such as extended Kalman filter (EKF) [6], Hilbert vibration decomposition (HVD) [7], adaptive-filtering [8], and eigenvalue decomposition (EVD) [4].
Effective cardiac failure treatment can be realised with a real-time ECG signal monitoring by using the ECG wearables. The Nyquist-based signal processing governs the operation of these systems. They are time-invariant, which results in a worst-case parameterisation [9,10]. The system computational load and processing plus transmission activities remain fixed irrespective of the ECG signal intermittence and time-variations. Therefore, it can augment the computational complexity and power consumption. The signalpiloted ECG acquisition approaches have been suggested to compensate for these shortfalls. These are based on level-crossing sampling (LCS) [11,12].

Proposed method:
This work aims to contribute to the development of novel computationally efficient ECG diagnosis systems in a wireless sensing and cloud-based analysis environment. The realisation is achieved by using an intelligent assembly of the level-crossing A/D converters (LCADCs), the enhanced activity selection algorithm (EASA), and adaptive-rate filtering. It significantly lessens the activity of the post BW and PLI denoising module by only treating the pertinent information with adjustable order FIR filters [9,10]. The designed system principle is shown in Fig. 1.
The MIT-BIH Arrhythmia database is employed to study the system performance [13]. Each channel is acquired with an 11-bit resolution ADC at an acquisition frequency of 360 Hz. A set of 5, 30.1-min duration recordings are used. A BW signal of 30.1-min duration recording is also employed from the MIT-BIH noise stress test database [13]. The PLI is modelled as sinusoid of 60 Hz frequency. The intended ECG recordings are denoised by a digital filter to diminish the impact of BW and PLI [4]. The noisy signal x t ( ) is generated by adding BW noise n BW and PLI noise n PLI in a clean ECG signal y t ( ). The process can be expressed as The band-limited, Fc min = 0.5; Fc max = 60 Hz, ECG signal x t ( ) is acquired with an LCADC. It employs 21 thresholds, symmetrically and uniformly placed within the LCADC dynamics DV = 2 V. It results in M = 4.39-bit and q = 0.0952 V [11]. The choice of the number of thresholds is made based on the intended application. For LCADC, the sampling is triggered only when x t ( ) traverse one of the prefixed thresholds. Samples are irregularly spaced in time and the sampling density is piloted by the x t ( ) variations. Equation (2) represents the sampling instants of the level-crossing samples. Where t n is the current instant, t n−1 is the precedent one and dt n−1 is the time step among them t n = t n−1 + dt n−1 The conversion process of an LCADC is dual as compared to the classical counterparts. The sample amplitudes are ideally known for an ideal LCADC, and the sampling instants are quantified according to the resolution of the timer circuit and its frequency of operation F Timer . Unlike the traditional approach, the signalto-noise ratio (SNR) of LCADC does not base on resolution M and quantum q. However, it is a function of the T Timer = 1/F Timer [11]. In practice, digital signal processing is conducted on the finitelength segments. Therefore, the EASA is used to segment the LCADC output. It segments the pertinent signal information by using the sampling process non-uniformity. The principle is clear from the following algorithm (see Fig. 2).
Here T 0 is the fundamental period of x t ( ). T 0 with dt n identifies the activity [10]. The condition on dt n allows to respect the Nyquist criterion for the lowest frequency component Fc min of following local characteristics of the segmented signal. The sampling frequency for W i can be measured as Fs i = N i /L i . The W i is uniformly resampled using the simplified linear interpolator (SLI) [10] to take advantage of the existing classical processing techniques. Compared to the resampled signal modifies compared to the non-uniform signal. This variation is a function of M, q and the interpolator [14]. The superior error limit per resampled observation is q/2 for SLI [14].
A finite impulse response (FIR) filters bank is offline designed for the proficiently online diminishing of the BW and the PLI from the ECG signals. The useful frequency range of the ECG signal is between [0.5; 45] Hz [4]. A band-pass filters bank is offline designed for the cut-off frequencies of Fc L = 0.5; Fc H = 45]Hz. It allows focusing on the ECG band of interest while attenuating the BW and PLI noise [4]. The filters bank is designed for a set of sampling frequencies, Fref, between Fs min = 135 Hz . 2, Fc max to F r = 360 Hz. In this case, Δ = 15 Hz is chosen. It realises a bank of Q = 16 band-pass FIR filters. Here, D = F r − Fs min /Q − 1 . The sampling frequencies and orders of the reference filters are summarised in Fig. 3. It shows that for the selected specification, the lowest 44th-order filter in the bank is obtained for Fref 1 = Fs min = 135 Hz, and the highest 117th-order filter in the bank is obtained for Fref 32 = F r = 360 Hz.
The EASA analyses properties of W i and uses it for modifying the post modules parameters like the resampling frequency, Frs i , and the filter order, K C . An effective filter is selected online from the reference set for each W i . Let h c k be the selected filter for W i and is sampled at Fref C . This selection is made on the basis of Fref and Fs i . For a proper filtering, the Frs i = Fref C is chosen [10]. The method of choosing Frs i and keeping it aligned with Fref C is described in Fig. 4.
3. Performance evaluation: The designed system performance is evaluated in terms of compression gain, online processing efficiency, and output quality.
In the classical case, x t ( ) is acquired at a fixed frequency F r . Therefore, the count of samples, N, for a considered time length L T is straightforward to compute as N = F r × L T . For LCADC, the sampling frequency is not unique and is piloted by variations in x t ( ). If N ED is the number of samples obtained at the output of LCADC for L T . Then the compression gain can be calculated as The computational complexity of a classical K order FIR filter is known. It performs K additions and K multiplications while calculating an output sample. For N samples, the computational cost C FIR can be computed as For the suggested solution, the online filter selection and the selected segment resampling processes necessitate additional operations. The filter selection for W i is resolved by using the successive approximation algorithm. Therefore, it requires log 2 Q comparisons for the worst case [10]. Here, Q is the length of the set Fref. The resampling is realised by using the SLI. For W i , the complexity of SLI is Nr i additions and Nr i binary-weighted right shifts. The complexity of the binary-weighted right shift is negligible compared to the addition and multiplication processes [15]. Therefore, the complexity of proposed adaptive-rate FIR (ARFIR) method for W i can be calculated as Accuracy of the proposed solution is evaluated in terms of the SNR. The noisy signal x n is the input and the filtered signal yf n ≃ y n is the system output. Here, x n and y n are the digital versions of x t ( ) and y t ( ). The SNR i for W i is calculated as In (6), e n is the error per observation and it is calculated as the absolute difference between y n and yf n . After calculating SNR i the overall SNR for an intended ECG recording of 30.1-min, the duration is calculated as the average SNR i s of all selected segments.  The designed solution performance is compared with the traditional one in terms of compression gain and processing efficiency. The system precision is compared with the vital contemporary counterparts, based on the EVD [4] and the empirical mode decomposition (EMD), the wavelet transform (WT) [16] with the EKF [6]. Techniques of [6,16] are merged as EMD-WT-EKF [4].

Simulation results:
An example of the noise-free signal, y t ( ), is shown in Fig. 5a. It is a segment of record number 100. Its magnitude spectra are shown in Fig. 5b. The noisy signal x t ( ) with 0 dB SNR is shown in Fig. 5c. The magnitude spectrum of the noisy signal is shown in Fig. 5d. The presence of BW and PLI noise is observable by comparing the time-domain plots of Figs. 5a and c. In Fig. 5d, additional spikes exist compared to Fig. 5b. These spikes occur at the low-frequency region and at 60 Hz and, respectively, confirm the presence of BW and PLI noise.
The first 40 s of record number 100, digitised with a 4.39-bit LCADC and afterwards segmented with the EASA is shown in Fig. 6. For employed parameters, the EASA delivers six selected segments.
The selected segments' parameters are outlined in Table 1. It describes the attractive characteristics of the proposed approach, which are adapting L i , Fs i , Frs i , Nr i , and K C for W i . L i demonstrates that how for a chosen N ref = 2048, the time-length of each W i is adjusted according to the temporal disparities of the incoming signal. Contrary, in the classical counterpart for N ref = 2048 and F r = 360 Hz the length of each segment is unique and equal to 5.68 s regardless of the incoming signal sporadic nature. Nr i and K C demonstrate that how the tuning of Frs i contributes to the proposed method processing gain by reducing the superfluous interpolations and denoising operations.
These outcomes are compared with the traditional method. The complete x t ( ) span, 30.1-min, is sampled at F r = 360 Hz in the conventional case. It results in 650k samples to denoise with a 117th-order FIR filter. Nevertheless, with the suggested strategy, the entire collection of acquired information points is smaller. Additionally, local filter orders, for most of the selected segments, are reduced than 117th. Compared to the classical method, it gives impressive compression gain and processing efficacy of the suggested approach.
The compression gains of the suggested method over the classical counterpart are also calculated for each intended recording of 30-min duration. The findings are summarised in Fig. 7. For proper plotting, the record numbers are incremented sequentially in Fig. 7. Each record is presenting a real one from the MIT-BIH dataset. It is clear from Table 2. Fig. 7 shows that the minimum compression gain of 1.61-fold is attained for the MIT-BIH record number 116. The maximum compression ratio of 2.78-fold is attained for the MIT-BIH record number 117. The overall mean compression gain for all intended 5-records is 2.18-fold.
For considered 5-ECG records, the processing gains of the ARFIR over the classical counterpart are also computed.     Fig. 9. Each record in the plot is presenting a real one from the MIT-BIH dataset. It is clear from Table 2.
The efficiency of the suggested approach is also compared to the traditional counterpart in terms of output SNR, and results are outlined in Table 3. It shows that the output SNR of the filtered signal obtained using the suggested signal-piloted adaptive-rate denoising is similar to the output SNR of the filtered ECG signals obtained using the traditional filtering tactic.
The performance of the suggested method in terms of output SNR is compared with the existing state-of-the-art tactics. In this study, EVD [4] and EMD-WT-EKF approaches are considered [6,16]. The findings are outlined in Table 4. It shows that for record number 100, the suggested method secures, respectively, 4.1 and 7.32 dB superior output SNR compared to the EVD and the EMD-WT-EKF tactics. For record number 101, the suggested method secures, respectively, 1.28 and 4.54 dB superior output SNR compared to the EVD and the EMD-WT-EKF tactics. For record number 115, the suggested method secures, respectively, 4.09 and 7.34 dB superior output SNR compared to the EVD and the EMD-WT-EKF tactics. For record number 116, the suggested method secures, respectively, 3.82 and 4.23 dB superior output SNR compared to the EVD and the EMD-WT-EKF tactics. For record number 117, the suggested method secures, respectively, 3.95 and 5.65 dB superior output SNR compared to the EVD and the EMD-WT-EKF tactics.
5. Discussion: For the case of studied 5-ECG 30.1-min records, the performance of the designed solution is studied. Results have shown a notable compression and processing effectiveness of the suggested method compared to the conventional counterpart. The average processing gains of 2.83 times and 2.88 times, respectively, in terms of additions and multiplications compared to the conventional equivalent. It is attained by automatically organising the parameters of acquisition, segmentation, resampling and denoising by following the incoming signal variations. Compared to traditional counterparts, it results in a substantial computational gain of the suggested framework. Table 3 shows that the system also secures an analogous performance in terms of the output SNR in comparison with the conventional counterpart. Additionally, Table 4 confirms that the devised method attains the higher values of output SNR, for all considered ECG recordings at 0-dB SNR in , compared to EVD and EMD-WT-EKF based solutions [4,6,16].
Another ability of the designed method compared to the previous ones is to introduce a real-time signal-piloted compression gain. The proposed architecture has reached an average compression gain of 2.18-fold for the studied 5-ECG records. It brings notable processing efficiency during the post-processing modules, which   is clear from Figs. 8 and 9. It promises a similar factor of gain in terms of transmission and post-analysis module activities [10,12]. The idea of embedding the signal-piloted acquisition and processing in the automatic cardiovascular diagnostic is quite novel [9,12,17]. The above results assure that a wise integration of this approach can also introduce a significant processing efficiency in other ECG denoising tactics such as the EVD [4], and the EKF-EMD-WT [6,16].
6. Conclusion: To denoise BW and PLI from the ECG signals, novel signal-piloted acquisition and FIR filtering concepts are devised. The signal-piloted tactic allows real-time self-organisation of the system parameters. It resulted in a 2.18-fold compression gain and more than 2.8-folds gains in additions and multiplications compared to the classical counterpart. It is shown that the designed solution indeed secures comparable output SNR efficiency compared to the conventional counterpart. In addition, the underperformance of the developed approach is also demonstrated in terms of the output of the SNR over the state-of-the-art strategies. It is demonstrated that the proposed solution also secures analogous output SNR performance in comparison with the traditional counterpart. Moreover, the outperformance of the designed solution is also demonstrated over the state-of-the-art strategies in terms of the SNR performance. This ensures the advantage of incorporating the designed solution within the concurrent wireless and low power ECG implants.

Acknowledgments:
The author was thankful to anonymous reviewers for their useful feedback.

Funding and declaration of interests:
The project is funded by the Effat University, under the grant no. UC#7/28Feb 2018/ 10.2-44 g.

Conflict of interest:
The author declares no conflict of interest.
10. Ethical approval: This article does not contain any studies with human participants or animals performed by the author.