Signal Processing Techniques for Removing Noise from ECG Signals

The electrocardiogram (ECG) signals contain many types of noisesbaseline wander, powerline interference, electromyographic (EMG) noise, electrode motion artifact noise. Baseline wander is a low-frequency noise of around 0.5 to 0.6 Hz. To remove it, a high-pass filter of cut-off frequency 0.5 to 0.6 Hz can be used. Powerline interference (50 or 60 Hz noise from mains supply) can be removed by using a notch filter of 50 or 60 Hz cut-off frequency. EMG noise is a high frequency noise of above 100 Hz and hence may be removed by a low-pass filter of an appropriate cut-off frequency. Electrode motion artifacts can be suppressed by minimizing the movements made by the subject. The chapter introduces the types of common noise sources in ECG signals and simple signal processing techniques for removing them, and also presents a section of Matlab code for the techniques described.


Introduction
Electrocardiogram (ECG) is a signal that describes the electrical activity of the heart. The ECG signal is generated by contraction (depolarization) and relaxation (repolarization) of atrial and ventricular muscles of the heart. The ECG signal contains-a P wave (due to atrial depolarization), a QRS complex (due to atrial repolarization and ventricular depolarization) and a T wave (due to ventricular repolarization). A typical ECG signal of a normal subject is shown in (figure 1). In order to record an ECG signal, electrodes (transducers) are placed at specific positions on the human body. Artifacts (noise) are the unwanted signals that are merged with ECG signal and sometimes create obstacles for the physicians from making a true diagnosis. Hence, it is necessary to remove them from ECG signals using proper signal processing methods. There are mainly four types of artifacts encountered in ECG signals: baseline wander, powerline interference, EMG noise and electrode motion artifacts. They are discussed briefly below.

Baseline Wander
Baseline wander or baseline drift is the effect where the base axis (x-axis) of a signal appears to 'wander' or move up and down rather than be straight. This causes the entire signal to shift from its normal base. In ECG signal, the baseline wander is caused due to improper electrodes (electrode-skin impedance), patient's movement and breathing (respiration). The frequency content of the baseline wander is in the range of 0.5 Hz. However, increased movement of the body during exercise or stress test increase the frequency content of baseline wander. Since the baseline signal is a low frequency signal therefore Finite Impulse Response (FIR) high-pass zero phase forward-backward filtering with a cut-off frequency of 0.5 Hz to estimate and remove the baseline in the ECG signal can be used [3].

Powerline Interference
Electromagnetic fields caused by a powerline represent a common noise source in the ECG, as well as to any other bioelectrical signal recorded from the body surface. Such noise is characterized by 50 or 60 Hz sinusoidal interference, possibly accompanied by a number of harmonics. Such narrowband noise renders the analysis and interpretation of the ECG more difficult, since the delineation of low-amplitude waveforms becomes unreliable and spurious waveforms may be introduced. It is necessary to remove powerline interference from ECG signals as it completely superimposes the low frequency ECG waves like P wave and T wave. (Figure 3) shows an ECG signal typically affected by a powerline interference.

EMG Noise
The presence of muscle noise represents a major problem in many ECG applications, especially in recordings acquired during exercise, since low amplitude waveforms may become completely obscured. Muscle noise is, in contrast to baseline wander and 50/60 Hz interference, not removed by narrowband filtering, but presents a much more difficult filtering problem since the spectral content of muscle activity considerably overlaps that of the PQRST complex. Since the ECG is a repetitive signal, techniques can be used to reduce muscle noise in a way similar to the processing of evoked potentials. Successful noise reduction by ensemble averaging is, however, restricted to one particular QRS morphology at a time and requires that several beats be available. Hence, there is still a need to develop signal processing techniques which can reduce the influence of muscle noise [4]. Figure   below shows an ECG signal interfered by an EMG noise.

Electrode Motion Artifacts
Electrode motion artifacts are mainly caused by skin stretching which alters the impedance of the skin around the electrode. Motion artifacts resemble the signal characteristics of baseline wander, but are more problematic to combat since their spectral content considerably overlaps that of the PQRST complex. They occur mainly in the range from 1 to 10 Hz. In the ECG, these artifacts are manifested as large-amplitude waveforms which are sometimes mistaken for QRS complexes.

Signal
In this section, various signal processing methods for removing the artifacts from ECG signal have been described.
These methods are simple yet effective. The section also includes the Matlab programs along with their results for the described methods.

Techniques for Removal of Baseline Wander
A straightforward approach to the design of a filter is to choose the ideal high-pass filter as a starting point [4], Where, 2 c f π = 2 c f π   : ECG signal with baseline wander (above); ECG signal with baseline wander removed (below) using DWT.

Techniques for Removal of Powerline Interference
A very simple approach to the reduction of powerline interference is to consider a filter defined by a complexconjugated pair of zeros that lie on the unit circle at the interfering frequency Since this filter has a notch with a relatively large bandwidth, it will attenuate not only the powerline frequency but also the ECG waveforms with frequencies close to 0 ω . It is, therefore, necessary to modify the filter in (6) so that the notch becomes more selective, for example, by introducing a pair of complexconjugated poles positioned at the same angle as the zeros Where 0 1 r < < . Thus, the transfer function of the resulting IIR filter is given by The notch bandwidth is determined by the pole radius r and is reduced as r approaches the unit circle. Figure 8 shows

Techniques for Removal of Electromyographic (EMG) Noise
The EMG noise is a high-frequency noise; hence an n-point The recursive form as above clearly depicts the integration aspect of the filter. The transfer function of this expression is easily derived to be ( Figure 11) shows a segment of an ECG signal with highfrequency noise. (Figure 12) shows the result of filtering the signal with the 8-point MA filter described above. Although the noise level has been reduced, some noise is still present in the result. This is due to the fact that the attenuation of the simple 8-point MA filter is not more than -20 dB at most frequencies (except near the zeros of the filter) [5].
( Figure 11): ECG signal with high-frequency (EMG like) noise; f s = 1,000 Hz [5] ( Figure 12): The ECG signal with high-frequency (EMG like) noise in (Figure 11) after filtering by the 8-point MA filter [5] Another approach to dealing with this problem is offered by time-varying lowpass filtering using a filter with a variable frequency response. For example, a filter with a Gaussian impulse response has been suggested for this purpose as the filters bandwidth is easily changed from one sample to another through a function ( ) n β which defines the width of the The width function ( ) n β is designed to reflect local signal properties so that smooth segments of the ECG are subjected to considerable low-pass filtering, whereas the QRS interval, with its much steeper slopes, largely remains unfiltered. By making ( ) n β proportional to the derivative of the signal, slow signal changes produce small values of ( ) n β , thus making the Gaussian impulse response to decay more slowly to zero so as to produce greater noise suppression, and vice versa.
Details of designing the width function ( ) n β , truncating h (k, n) in (15), and the resulting performance on ECG signals can be found in [5]. The idea of adapting the cut-off frequency of a linear low-pass filter to the slopes of the ECG has also been explored for other types of filters [4, 6 -8]. For more mathematical details of time-varying filters, references [6 -9] may be referred.

Techniques for Removal of Electrode Motion Artifacts
One of the widely used techniques for removing the electrode motion artifacts is based on adaptive filters. The general structure of an adaptive filter for noise canceling utilized in this paper requires two inputs, called the primary and the reference signal. The former is the d(t) = s(t) + n 1 (t) where s(t) is an ECG signal and n1(t) is an additive noise. The noise and the signal are assumed to be uncorrelated. The second input is a noise u(t) correlated in some way with n 1 (t) but coming from another source. The adaptive filter coefficients w k are updated as new samples of the input signals are acquired. The learning rule for coefficients modification is based on minimization, in the mean square sense, of the error signal e(t) = d(t) − y(t) where y(t) is the output of the adaptive filter. A block diagram of the general structure of noise cancelling adaptive filtering is shown in figure 13 [10]. The two most widely used adaptive filtering algorithms are the Least Mean Square (LMS) and the Recursive Least Square (RLS). Figure 13: Block diagram of adaptive filtering scheme [10] Matlab code to remove (electrode) motion artifacts from ECG Clear all y1=load ('ECG1.txt'); % this is an ECG signal with motion artifacts y2= (y1 (:,1)); % ECG signal data a1= (y1 (:,1)); % accelerometer x-axis data a2= (y1 (:,1)); % accelerometer y-axis data a3= (y1 (:,1)); % accelerometer z-axis data y2 = y2/max (y2);