Keywords

1 Introduction

It is well known that an electrocardiogram (ECG) is a representation of the heart electrical activity in order to time. The ECG signal is of considerable importance since according to the recent statistics report published by World Health Organization, cardiovascular diseases remaining the main reason of mortality in the world [13]. ECG signal is composed by a P wave and a QRS complex corresponding to the heart depolarization, and T wave corresponding to heart repolarisation. A normal ECG shape can be seen in Fig. 1.

Fig. 1
figure 1

Normal electrocardiogram [6]

Nowadays, the use of portable heart monitoring devices is very common. These devices are an excellent resource for ambulatory ECG and patient monitoring for long periods of time. Unfortunately, the constant movement of the human body produces several artefacts, caused by the movement of the electrodes in the skin. This noise is usually known as motion artefacts and it is a kind of noise that modifies or shifts the ECG signal or completely destroys it. The main goal of this work is to test and validate a technique to detect these artefacts, and based on the previous ECG signal, create a signal with a linear prediction method based on Burg Algorithm. The presented experiments also have relevance due to the fact of this algorithm does not have been well explored for this subject.

2 Biomedical Noises Sources

ECG signals always have background noise associated, such as power line interferences, muscular contractions (electromyography, EMG), or instrumentation noise generated by electronic devices. But, in a normal functioning system, none of these noise sources are as destructive as the noise caused by motion artefacts. This type of noise can be very destructive due to the change of distance between the sensing area of the electrode and the skin surface. This happens because the motion of the electrode in relation to the patient skin produces a voltage variation with higher value than the signal produced by the heart, leading to electronic saturation of analogue front-end equipment. If the ECG shape becomes distorted but not completely destroyed, typically it means that a noise with low frequency is overlapping the ECG signal. This problem are being addressed by different approaches based on digital signal processing techniques, as Empirical Mode Decomposition (EMD) [8] or Discrete Wavelet Transform (DWT) [1, 9]. Moreover, a solution based on accelerometers, used to measure the movements of the electrodes, can be used as correlated noise signal in adaptive filters [8, 10, 11, 14, 15]. However, all of these techniques work only if we have continuously signal information, i.e., if the signal is not a voltage DC resulting from amplifiers saturation. In these cases, the solution should remove or predict the destroyed part of the ECG signal. For both cases the signal should be someway marked to inform the reader or user about the absence of real signal on that position. This paper focus in prediction the ECG signal using a linear prediction method based on Burg Algorithm.

3 Linear Prediction

Linear Prediction (LP) is a mathematical operation with ability to predict future values of a signal based on previous samples. The LP algorithms are based on frequency estimation; therefore, the results are as better as the knowledge about the number of signal sinusoids. This aspect is very important when we need to choose the algorithm to compute the LP coefficients. From the different techniques that can be used to compute the coefficients, the Burg algorithm [3] is the most used due to its stability [2]. Burg algorithm is based on Levinson-Durbin algorithm, where Burg slightly changed it to improve the stability.

3.1 Burg Algorithm

The Burg algorithm is based on forward LP:

$$\begin{aligned} f(n) = \widehat{s}(n)=-\sum _{k=1}^{m}\alpha _{m}(k)s(n-k), \end{aligned}$$
(1)

and backward LP:

$$\begin{aligned} b(n) = \widehat{s}(n-m)=-\sum _{k=1}^{m}\beta _{m}(k)s(n+k-m). \end{aligned}$$
(2)

Where \(\widehat{s}(n)\) is the prediction signal based on the previous \(m\) samples of the original signal \(s(n)\) with \(N\) samples and \(N > m\), finally \(\alpha \) and \(\beta \) are the respective prediction coefficients. The Burg algorithm does not compute the coefficients directly; instead, performs the calculation of so called reflection coefficients \(\zeta \):

$$\begin{aligned} \zeta = \frac{ -2\sum _{k=m+1}^{N} f(k) b(k-1) }{ \sum _{k=m+1}^{N} \left( \left[ f(k)\right] ^2 + \left[ b(k)\right] ^2\right) . } \end{aligned}$$
(3)

To minimize the sum of the squares error:

$$\begin{aligned} E = \sum _{k=m+1}^{N} \left( \left[ f(k)\right] ^2 + \left[ b(k)\right] ^2\right) . \end{aligned}$$
(4)

The algorithm recursively selects the \(\zeta \) that minimises the average \(f\) and \(b\) error power.

Fig. 2
figure 2

Implementation block diagram

4 System Architecture

The software implementation was divided in four main blocks as shown in Fig. 2. The ECG Noise Filter block is used for signal denoising, running an adaptive signal processing technique based on LMS algorithm as discussed in [12]. The buffer block is a simple buffer for ECG data samples. The buffer is useful to supply the prediction algorithm and error detection algorithm. The Burg algorithm block is used for estimation and run in parallel with buffering block; in fact the Burg algorithm uses the buffer content to estimate the next sample. The output samples from these two blocks are: \(s(0)\) from buffer block and \(\widehat{s}(0)\) from Burg algorithm block. The \(\widehat{s}(0)\) sample is estimated with sample values from \(s(1)\) to \(s(m)\), where \(m\) is the size of the buffer. The buffer output is also the input of noise detection block, where if noise is present in the signal the output is switched from buffer output to prediction output. Noise detection block is based on the derivative of the signal and signal amplitude. If the signal suffers a fast variation, the derivative of the signal will be higher than the average value from previous ECG samples, which can be used as trigger for noise detection. Moreover, if the derivative of the signal is zero and the signal amplitude is equal to saturation value, we also are in the presence of noise. With the combination of these two techniques associated to the contents of the buffer, it is possible to detect the onset of noise artefacts as its length. There are also two different signals in block diagram, the buffer signal and the noise signal. These signals are control signals used on software to control the state of the program, where the buffer signal is used to inform about the availability of valid data in the buffer, and the noise signal is used to inform the algorithm block to not consider the noise present in the buffer.

Fig. 3
figure 3

Estimation result when signal is corrupted with signal saturation. a Signal saturation. b Estimation result. c Derivative

5 Results Analysis

In order realise the efficiency of Burg Algorithm to predict the ECG signal, it was compared the results considering four different scenarios. In the first and second scenarios, the ECG signal was corrupted with motion artefacts, first with signal saturation and second with noise pulses with saturation. Next, in third scenario, it was evaluated the impact of buffer size in the estimation results, and in the fourth scenario it was analyzed the impact of EMG noise in the algorithm. For algorithm implementation it was used the MATLAB tool and an ECG signal from MIT-BIH database.

In the first experiment it was used signal saturation during several heart beats to realise the efficiency of the algorithm over time. The signal saturation is shown in Fig. 3a and the estimation result is shown in Fig. 3b. Figure 3c shows the derivative of original ECG signal. The size of the buffer is \(m=150\) which corresponds to almost two cycles of ECG been represented by the shadow area. It is possible to realise in Fig. 3b that in the first three ECG cycles the Burg algorithm is very efficient in signal estimation, were the differences between original (dashed line) and estimated signal (solid line) shows to be very small. Apart of a slightly difference in phase, the most relevant values are associated to the QRS complex, where the algorithm fails in the amplitude of R pike. Nevertheless, after the first three beats the signal shows several inconsistencies outside of QRG complex.

In the second experiment, the signal was corrupted with different noise signature, similar to pulses or spikes identical to the ones represented in Fig. 4a, the algorithm also responds very well as depicted in Fig. 4b. For this case, the noise was restricted to two ECG cycles and it is possible to see in Fig. 4c the difference of the derivative value at the onset and the end of the artefact.

Fig. 4
figure 4

Estimation result when signal is corrupted with noisy spikes. a Signal saturation. b Estimation result. c Derivative

Fig. 5
figure 5

Estimation result for buffer length smaller than one ECG cycle, where the dashed line is the original ECG and the solid line the estimation

Fig. 6
figure 6

Estimation result for buffer length equal to one ECG cycle, where the dashed line is the original ECG and the solid line the estimation

In the third experiment, it was changed the value of \(m\) to realise the impact of the buffer size in the estimation. As expected, the estimated value is sensible to the minimum number of previous values used in estimation algorithm; therefore, the estimated values only make sense after minimum samples of signal. The minimum number \(m\) of samples is directly related with sampling frequency, i.e., if the sampling frequency \(f_{s}\) of the AD converter increases, the \(m\) value also must increase. Figure 5 shows the estimated signal when the length of the buffer does not contemplate at least one ECG cycle, where the prediction only happens for a short of samples and it is not capable to predict the entire cycle. However, if the buffer accommodate at least one ECG cycle, the algorithm can estimate several ECG cycles as shown in Fig. 6. In practice, the \(m\) value should be higher enough to accommodate at least one complete cycle of ECG signal. It is also important to consider the heart rate variability, therefore, the minimum number for \(m\) should be calculate for the minimum heart rate of human heart, typically between 60 and 80 bpm, and the \(f_{s}\) of AD. For that reason, the Burg algorithm block from Fig. 2 only starts outputting data after buffer signal is active, i.e., after buffer is fulfilled with valid ECG data. An important aspect about the LP process is its susceptibility to fail in the presence of noise; therefore, in the fourth experiment it was used an ECG signal contaminated with random noise identical to EMG. The results are shown in Fig. 7b, where they are clearly worst when compared with filtered ECG. If the noise is similar to a sine-wave, as power lines noise, the algorithm will also reproduces the noise in estimation results, but if the noise is random, as EMG, the results will be random as well. In this work, it was used an adaptive algorithm for noise removal before signal buffering to remove this type of noise [12].

Fig. 7
figure 7

Estimation result in the presence of random noise, where the dashed line is the original ECG with noise and the solid line the estimation

6 Conclusion

This work shows the ability of Burg algorithm to predict the ECG signal when noise produced by motion artefacts is destructive. The results are very promising since that, for the first three heart beats predicted, the results shown to be very similar to the original signal. It is also addressed the importance of the initial filtering of ECG signal, where in the presence of random noise similar to EMG noise the algorithm clearly fails. A final aspect respects to the computational requirements for portable devices, where the Burg algorithm also is very interesting. The computational activity is mainly multiplications and accumulations, which is well done by almost of the DSP processors in the market.