International Journal of Scientific & Engineering Research, Volume 5, Issue 4, April-2014 11

ISSN 2229-5518

Efficient Adaptive Filtering Method to Reconstruct the Cardiac Signal

C. Himabindu, T. Gowri, P. Rajesh Kumar

Abstract— This paper introduces a Decorrelation based modified robust Variable Step Size adaptive algorithm (DMRVSS) to improve the quality of an electrocardiogram (ECG). An ECG signal is a graphical representation of the sequence of depolarization and repolarization of heart. In some emergency situations the ECG signal needs to be transmitted to the clinic from the ambulance. During the transmission the tiny features of the ECG signal may masked due to channel noise. In addition to these the signal may get disturbed by some artifacts like power line interference (PLI), base line wander (BW ), muscle artifacts (MA), and electrode motion artifacts (EM) etc,. These artifacts strongly affect the ST segment of the signal. In that moment the doctor may give the wrong diagnosis to the patient. So the electrocardiogram (ECG) signal is necessary to be pre-processed. In this paper we are going to present various adaptive filtering methods based on a Decorrelation based modified robust Variable Step Size adaptive algorithm (DMRVSS). Here the main goal is to eliminate the affect of PLI and BW artifacts using Variable Step Size Least Mean Squares (DMRVSS-LMS), VSS-Normalized LMS (DMRVSS-NLMS) and variable step size sign based LMS algorithms and to decide which can give the best results with less computational complexity.

Index Terms— A Decorrelation based modified robust Variable Step Size adaptive algorithm and comparision using SNR, MSE calculations.

1 INTRODUCTION

—————————— ——————————

n electrocardiogram (ECG) is used to measure the heart rate of a patient. It is an electrical wave generated by
depolarization and repolarization of certain cells due to movements of Na+ and K+ ions in the blood. This ECG signal basically consists of P, Q, R, S and T waves. An ECG signal may get affected by various artifacts like Power Line Interference (PLI), Baseline Wander (BW), Electrode Motion artifact (EM) and Muscle artifact (MA) etc due to various reasons. These artifacts occur mostly due to power line variations, lose contacts of the electrodes and unwanted movements of the patient etc. This artifact affected ECG signal will cause the doctor may give wrong diagnosis to the patient [1]. So in order to pre-process the signal we may use filtering methods. For example wiener filters which consists of constant filter weights. But, to implement a wiener filter in hardware or software will be easy. An adaptive filter can give more accurate results compared to wiener filter because of its adaptive filter weights. The least mean squares (LMS), Normalized LMS (NLMS), Sign-Regressor LMS (SR-LMS), Sign LMS (S-LMS) and Sign-Sign LMS (SS-LMS) are already implemented [2]-[5]. A Decorrelation based modified robust Variable Step Size adaptive algorithm is applied to all these five adaptive algorithms to eliminate both PLI and BW artifacts in ECG

2 ADAPTIVE ALGORITHM

2.1 Least Mean Squares (LMS) algorithm

In Adaptive filtering, the filter weights (coefficients) will change over time which leads to obtain minimum error in each iteration. The following Fig 1 shows a basic adaptive filter structure.

Fig. 1: Adaptive filter structure

Here 𝑥(𝑘) is an input signal, 𝑦(𝑘) is an output signal, 𝑒(𝑘)
is an error signal and 𝑑(𝑘) is a desired signal. The input signal
is corrupted by noise 𝑛(𝑘). In other words, it is the sum of
desired signal 𝑑(𝑘) and noise 𝑛(𝑘), as mentioned in (1).
The input vector representation is given by 𝑥(𝑘) =
[𝑥(𝑘), 𝑥(𝑘 − 1), … . . 𝑥(𝑘 − 𝑁 − 1)]
𝑥(𝑘) = 𝑑(𝑘) + 𝑛(𝑘) (1)
The LMS algorithm is a linear adaptive algorithm which, in
general, consists of two basic processes [6]; 1. A filtering
process- computing the output of a linear filter in response to
the input signal and generating an error by comparing the
output with the desired signal. 2. An adaptive process- the
automatic adjustment of filter parameters in accordance with
the estimation error. The output of a filter can be obtained as
𝑦(𝑘) = 𝑤� 𝐻 (𝑘)𝑥(𝑘) (2)
The estimation of error can be generated by comparing the
output signal with the desired signal and it can be written as
𝑒(𝑘) = 𝑑(𝑘) − 𝑦(𝑘) (3)
The tap-weight adaptation can be obtained as
𝑤� (𝑘 + 1) = 𝑤� (𝑘) + 𝜇𝑥(𝑘)𝑒(𝑘) (4) Where 𝜇 is the constant step size and it has to be chosen in

IJSER © 2014 http://www.ijser.org

International Journal of Scientific & Engineering Research, Volume 5, Issue 4, April-2014 12

ISSN 2229-5518

between 0 and 2/λ𝑚𝑎𝑥 , 𝜆 is an eigen value in auto correlation matrix of input vector 𝑥(𝑘).

2.2 The Proposed a Decorrelation based modified robust Variable Step Size adaptive algorithm

2.2.1 Decorrelation based modified robust Variable

Step Size Least Mean Squares algorithm (DMRVSS-

vector in each iteration as
𝛿𝑤� (𝑘 + 1) = 𝑤� (𝑘 + 1) − 𝑤� (𝑘)

= 𝜇(𝑘) ∗

‖𝑥 (𝑘)‖2 𝑥(𝑘)𝑒 (𝑘)

Where 𝜇(𝑘) is a variable step size parameter. Equivalently,
we write

LMS)


𝑤� (𝑘 + 1) = 𝑤� (𝑘) + 𝜇 (𝑘)

‖𝑥(𝑘)‖2

𝑥(𝑘)𝑒(𝑘) (9)
The conventional variable step size algorithm has good
tracking ability but poor anti-noise ability. The RVSS
algorithm has good anti-noise ability but tracking ability is
poor.
In order to overcome the difficulties in conventional
variable step size algorithms like poor tracking ability and
anti-noise ability, a new decorrelation based modified robust modified variable step size algorithm has been proposed now. The output of a filter can be obtained as
𝑦(𝑘) = 𝑤� 𝐻 (𝑘)𝑥(𝑘) (5)
The error signal can be generated by comparing the output
signal with the desired signal. The tap-weight adaptation can
The adaptation constant 𝜇 for the NLMS filter is dimensionless, where as the adaptation constant 𝜇 for the LMS
filter has the dimension of inverse power [8]. Setting

𝜇� = 𝜇(𝑘) (10)

‖𝑥(𝑘)‖

We may view the NLMS filter as an LMS filter with a time

varying step size parameter [8]. The NLMS filter introduces a

problem of its own, namely that when the tap-input vector 𝑥(𝑘)

is small, numerical difficulties may arise because then we have to

divide by a small value for the squared norm‖𝑥(𝑘)‖2 . To

overcome this problem, we modify the recursion of (9) slightly to

produce

be obtained using least mean squares algorithm as
𝑤� (𝑘 + 1) = 𝑤� (𝑘) + 𝜇(𝑘)𝑥(𝑘)𝑒(𝑘) (6)

𝑤� (𝑘 + 1) = 𝑤� (𝑘) + 𝜇(𝑘 )

𝛿+‖𝑥(𝑘)‖2

𝑥(𝑘)𝑒(𝑘) (11)
Where the variable step size update equation for the filter coefficient is given by
𝜇𝑚𝑎𝑥 ; 𝑖𝑓 𝜇(𝑘 + 1) > 𝜇𝑚𝑎𝑥
Where 𝛿 is a positive constant (𝛿 > 0) and 𝜇(𝑘) is variable step
size as in (7).

2.2.3 Decorrelation based modified robust Variable

𝜇(𝑘 + 1) = � 𝜇𝑚𝑖𝑛 ; 𝑖𝑓 𝜇(𝑘 + 1) < 𝜇𝑚𝑖𝑛
𝛼𝜇(𝑘) + 𝛾𝜑(𝑘)2
(7)

Step Size Signed Regressor LMS algorithm (VSS-

SRLMS)

The signed regressor algorithm is obtained from the
Where 𝛼, 𝛾 are positive constants which ranges from 0 to 1 and to get good result we should chose the value of 𝛾 is close to 1. when the initial value of 𝜇(𝑘) is large then it gives fast
convergence rate so that it can give optimum lower MSE.
In (7), 𝜑(𝑘) is a control signal to control the adaptation
process by using squared of the time average estimate of
conventional LMS recursion by replacing the tap-input vector
𝑥(𝑘) with the vector sgn{𝑥(𝑘)}. Consider a signed regressor LMS based adaptive filter that processes an input signal 𝑥(𝑘) and generates the output 𝑥(𝑘) as per the following:

𝑦(𝑘) = 𝑤𝑡 (𝑘)𝑥(𝑘) (12)

autocorrelation of the present error signal 𝑒(𝑘) and the past

Where 𝑤(𝑘) = [𝑤0 (𝑘), 𝑤1 (𝑘), . . . . . . . , 𝑤𝑁−1 (𝑘)] t

is an Nth

one 𝑒(𝑘 − 1) [7]. The estimated control signal can be expressed
as
φ(k + 1) = �1 − β(k)�φ(k) + β(k)e(k)e(k − 1) (8)
Where 𝛽(𝑘) is a control parameter. Initially the value of
𝜑2 (𝑘) is large, resulting 𝜇(𝑘) also large. As we approach the
optimum, the error signal approaches to zero, that the control
signal also approaches to zero. This will result a small value of
step size.
The control parameter 𝛽(𝑘) can be written as

𝛽𝑚𝑎𝑥 ; 𝑖𝑓 𝛽(𝑘 + 1) > 𝛽𝑚𝑎𝑥

𝛽(𝑘 + 1) = � 𝛽𝑚𝑖𝑛 ; 𝑖𝑓 𝛽(𝑘 + 1) < 𝛽𝑚𝑖𝑛

𝜂𝛽(𝑘) + 𝜆𝑒(𝑘)2

Where the constant values 𝜂, 𝜆 are ranges from 0 to 1(𝜂 <
1, 𝜆 > 0).

2.2.2 Decorrelation based modified robust Variable

Step Size Normalized LMS algorithm(DMRVSS-

NLMS)

The normalized LMS algorithm is similar to LMS algorithm but differ only in the way in which the weight controller is mechanized. We define the change in weight

order filter. The adaptive filter coefficients are updated by the signed regressor LMS algorithm as

𝑤(𝑘 + 1) = 𝑤(𝑘) + 𝜇(𝑘)𝑠𝑠𝑛{𝑥(𝑘)}𝑒(𝑘) (13)

Where 𝜇(𝑘)variable step is size as in (7) and 𝑠𝑠𝑛(𝑧) is a

signum function [9] which can be defined as follows

−1 𝑖𝑓 𝑧 < 0

𝑠𝑠𝑛(𝑧) = �0 𝑖𝑓 𝑧 = 0

1 𝑖𝑓 𝑧 > 0

Because of the replacement of 𝑥(𝑘) by its sign, this
recursion may be simple in computations than the
conventional LMS recursion; especially in high speed
applications such as biotelemetry these types of recursions
may be necessary.

2.2.4 Decorrelation based modified robust Variable

Step Size Sign LMS algorithm (DMRVSS-SLMS)

This algorithm is obtained from conventional LMS

recursion by replacing 𝑒(𝑘) by its sign. This leads to the

following recursion [10]:

𝑤(𝑘 + 1) = 𝑤(𝑘) + 𝜇(𝑘)𝑥(𝑘)𝑠𝑠𝑛{𝑒(𝑘)} (14)

IJSER © 2014 http://www.ijser.org

International Journal of Scientific & Engineering Research, Volume 5, Issue 4, April-2014 13

ISSN 2229-5518

Where 𝜇(𝑘) is variable step size as in (5).

2.2.5 Decorrelation based modified robust Variable

Step Size Sign Sign algorithm (DMRVSS-SSLMS)

This can be obtained by combining SRLMS and SLMS

resulting in the following recursion [10]:

𝑤(𝑘 + 1) = 𝑤(𝑘) + 𝜇(𝑘)𝑠𝑠𝑛{𝑥(𝑘)}𝑠𝑠𝑛{𝑒(𝑘)} (15)

Where 𝑠𝑠𝑛{. } is well known signum function, 𝑒(𝑛) is the
error signal. The sequence 𝑑(𝑛) is the so-called desired
response available during initial training period and 𝜇(𝑘)is
variable step size as in (7).However the sign and sign-sign are
both slower than the LMS algorithm.

3 SIMULATION RESULTS


The proposed Novel variable step size adaptive algorithm based on decorrelation was implemented in MATLAB to eliminate both Power Line Interference and Baseline Wander artifacts in ECG signal. The ECG signal was collected from MIT-BIH arrhythmia database and it consists of 48 half-hour excerpts of two-channel ambulatory ECG recordings [11]. The ECG recordings are obtained from 47 subjects studied bi BIH arrhythmia laboratory and collected from a mixed population of inpatients (about 60%) and outpatients (about 40%). The PLI artifact can be considered as a high frequency noise and in this paper it is taken as 60Hz. In the same manner the BW artifact is a low frequency noise it will be in range from 0 to 0.5Hz. In this paper we consider the BW noise as 0.5Hz. In conventional method the step size is fixed and it has to be chosen manually. The proposed Novel variable step size algorithm based on decorrelation (DEMRVSS) is applied to basic adaptive filtering algorithms and signed based LMS algorithms which can give the improved results compared to conventional constant step size adaptive algorithms.

results for sign based variable step size algorithms are shown in Fig 4, Fig 5. *For all figures x-axis is number of samples and y-axis is amplitude of signal.

Fig. 3. (a) Original ECG, (b) BW corrupted ECG, (c) BW eliminated ECG using LMS, (d) BW eliminated ECG using VSS-LMS, (e) BW eliminated ECG using VSS-NLMS

Fig. 4. (a) PLI eliminated ECG using SR-LMS, (b) PLI eliminated ECG using S-LMS, (c) PLI eliminated ECG using VSS-SRLMS, (d) PLI eliminated ECG using VSS-SLMS

Fig. 2. (a) Original ECG, (b) PLI corrupted ECG, (c) PLI eliminated ECG using LMS, (d) PLI eliminated ECG using VSS-LMS, (e) PLI eliminated ECG using VSS-NLMS

Fig. 5. (a) BW eliminated ECG using SR-LMS, (b) BW eliminated ECG using S-LMS, (c) BW eliminated ECG using VSS-SRLMS, (d) BW eliminated ECG using VSS-SLMS

The obtained results by using VSS-LMS, VSS-NLMS
algorithms are shown in Fig 2, Fig 3. In similar the obtained

IJSER © 2014 http://www.ijser.org

International Journal of Scientific & Engineering Research, Volume 5, Issue 4, April-2014 14

ISSN 2229-5518

TABLE 1

COMPARISON OF SNR AND MSE VALUES FOR DIFFERENT

ADAPTIVE ALGORITHMS

In constant step size adaptive algorithms the normalized LMS algorithm gives the best results when compared to other algorithms and it is clear from the TABLE 1. These algorithms were compared based on their signal to noise ratios and mean square errors.

The TABLE 2 illustrates the list of SNR and MSE values for
TABLE 2

Comparison of SNR and MSE values for different variable

step size adaptive algorithms


all the variable step size adaptive algorithms. The variable step size LMS algorithm gives the better results compared to other algorithms.

4 CONCLUSION

The variable step size algorithms can give better results compared to conventional constant step size algorithms. The variable step size LMS algorithm can give most appropriate results compared to other algorithms in both the elimination of 60Hz PLI artifact and 0.5Hz BW artifact in ECG signal. This variable step size algorithm will work better for the elimination of PLI artifact than BW artifact.

REFERENCES

[1] Leslie Cromwell, Fred J. Weibell, Erich A. Pfeiffer “Biomedical instrumentation and Measurements”, 2nd edition, Chapter 6, pp. 105-

169, 2010.

[2] Thumbur Gowri, Injeti Sowmya, Zia Ur Rahman, Rama koti Reddy Dodda, “Adaptive Power Line Interference Removal from Cardiac signals using Leaky based Normalized Higher order Filtering Techniques”, IEEE First International Conference on Artificial Intelligence, Modeling & Simulation, pp. 259-263, 2013.

[3] Thumbur Gowri, P. Rajesh Kumar, D. V. Rama Koti Reddy, “An Efficient Variable Step size Least Mean Square Adaptive Algorithm used to enhance the quality of electrocardiogram Signal”, Advances in Signal Processing and Intelligent Recognition Systems, Published by Springer Switzerland, Advances in Intelligent Systems and computing, Volume 264, pp. 463-475, 2014.

[4] Mohammad Zia Ur Rahman, Rafi Ahamed Shaik D V Rama Koti Reddy, “Baseline wander and Power line interference elimination from Cardiac Signals using Error Nonlinearity LMS Algorithm”, International Conference on Systems in Medicine and Biology, December16-18, 2010.

[5] Lin Bai, Qinye Yin, “A modified nlms algorithm for adaptive noise cancellation” IEEE on Intelligent Networks and Network Security, pp. 3726-3729, 2010.

[6] Simon Haykin, Adaptive filter theory, 4th ed. Pearson Education, pp.

231-278, 2002.

[7] Jianhua Li, Jing LiC, “A Novel Variable Step Size LMS Algorithm Based on Decorrelation” IEEE 3rd International Congress on Image and Signal Processing, pp. 3291-3294, 2010.

[8] Bernard widrow, Samuel D. stearns, “Adaptive signal processing”, pp. 99-109.

[9] Baby Paul, P. Mythili, “ECG Noise Removal using GA tuned Sign- Data Least Mean Square Algorithm”, IEEE International Conference on Advanced Communication Control and Computing Technologies (ICACCCT), pp. 100-103, August 23-25, 2012.

[10] A. Bhavani sankar, D. Kumar, K. Seethalakshmi, “Performance study of various adaptive algorithms for noise cancellation in Respiratory signals”, Signal processing: An international journal (SPIJ), volume (4), issue (5), pp. 267-278, 2011.

[11] www.physionet.org.

IJSER © 2014 http://www.ijser.org