Reduction of Motion Artifacts and Improvement of R Peak Detecting Accuracy Using Adjacent Non-Intrusive ECG Sensors

Non-intrusive electrocardiogram (ECG) monitoring has many advantages: easy to measure and apply in daily life. However, motion noise in the measured signal is the major problem of non-intrusive measurement. This paper proposes a method to reduce the noise and to detect the R peaks of ECG in a stable manner in a sitting arrangement using non-intrusive sensors. The method utilizes two capacitive ECG sensors (cECGs) to measure ECG, and another two cECGs located adjacent to the sensors for ECG are added to obtain the information on motion. Then, active noise cancellation technique and the motion information are used to reduce motion noise. To verify the proposed method, ECG was measured indoors and during driving, and the accuracy of the detected R peaks was compared. After applying the method, the sum of sensitivity and positive predictivity increased 8.39% on average and 26.26% maximally in the data. Based on the results, it was confirmed that the motion noise was reduced and that more reliable R peak positions could be obtained by the proposed method. The robustness of the new ECG measurement method will elicit benefits to various health care systems that require noninvasive heart rate or heart rate variability measurements.


Introduction
The electrocardiogram (ECG) is a set of voltage signals that is generated by heart activity [1]. The R wave of ECG can be used to calculate the heart rate (HR) and its variability (HRV), which contain important information on the body's physiological condition. This data can be used to diagnose diseases like multiple sclerosis, stroke, ischemic heart disease, and myocardial infarction, or can also be used to provide information on the autonomic nervous function [2,3]. Therefore, measuring HR or HRV in daily life can be beneficial to humans, because it can serve as a regular check of cardiac electrical activity. In addition, if an ECG system can measure the HR or HRV of a human in a vehicle during his driving route, it can detect abrupt possible cardiac abnormalities or physical changes in the driver, such as fatigue, drowsiness, and stress [4,5]. This can make driving safer and provide comfort to drivers by making it possible to take proper action in advance or by providing the necessary information when an abnormal condition is detected. However, the conventional ECG measurement method is not practical for use in daily life. It requires Ag-AgCl electrodes that must be attached to the body of the tested subjects directly. This method is rather uncomfortable and disturbs daily activities or driving. that the R peaks can be detected in a more stable manner using the proposed method. Furthermore, because its computational complexity is not high, the near-real-time monitoring of HR or HRV by the detected R peaks is possible using this method.

Measurement System
In conventional works, two or more cECGs were used as electrodes, and they were attached to a chair or a driver's seat to measure the ECG during daily life activities or driving [25,26]. Furthermore, conductive fabric or an additional cECG was placed on the bottom of the seat for the reduction of the common noise component of the measured signals using a driven-right-leg circuit (DRL) [27].
Our measurement system is designed based on these prior designs. It has two cECGs attached to a seat without any covers, and the conductive fabric is placed on the bottom of the seat for the DRL. However, in our system, an additional cECG is added near the each cECG used to sense ECG as shown in Figure 1. This is to measure the motion information around the cECG for ECG measurement and to obtain a reference signal for ANC. In the figure, R and L are the right and left sensors for ECG measurement, and aR and aL are additional right and left sensors to get the motion information. The signals measured by the four cECGs are filtered using a low-pass filter with a 40 Hz cutoff frequency to remove high-frequency noise. They are then sampled to digital signals at 360 Hz through an NI 9205 from National Instruments using 16 bits for analog-digital conversion. Let the signal measured by cECG i be sig i . The measured ECG (ECG m ) is obtained using the limb lead 1 method as where BPF means the use of a BPF with a 0.05-35 Hz cutoff frequency [28]. In addition to these two signals, r L and r R are calculated as They are used to construct the reference signal for ANC, and its detailed description will be presented in Section 2.3, which discusses the ANC using the reference signal.

Data Acquisition
Both indoor and outdoor experiments were conducted for data acquisition. In indoor experiment, our measurement system was installed in a chair where subjects sat to measure the ECG. The subjects were one 29-year-old, two 25-year-old, and one 28-year-old healthy males with no heart-related medical history. All subjects wore short sleeved t-shirts made of 100% cotton during the experiments. Five-minute ECG recordings were acquired, three times per subject. The subjects randomly moved their bodies to make a significant amount of artificial motion noise during the experiment. The reason for this motion noise is to verify the performance of our system in a severe environment. In addition to our measurement system, conventional contact electrodes were also used to obtain the true R peak position.
For the outdoor experiment, our system was integrated in the driving seat of a vehicle, and the ECG was measured for six people for a period of 15 min for each, during driving. The subjects were healthy males aged 27-32. Among them, subject 1, a male aged 29, and subject 6, a male aged 28, also participated in the indoor experiment as subject 1 and 4. The subjects wore same clothes used in the indoor experiment. The driving course was a road network that surrounds Pohang University of Science and Technology. Its total length is approximately 2 km, and it includes corners, an uphill grade of 311 m, downhill roads of 120 m, and eight speed bumps, in addition to straight lines. The subjects drove the course anticlockwise and repeatedly during the experiment at speeds lower than 50 km/h. The ECG was also recorded independently using conventional contact electrodes. This was to get the positions of the true R peaks, and detected peaks were inspected manually to correct any errors. The true R peaks were used to evaluate the accuracy of the tested R peaks.
All R peaks were detected by the Pan and Tompkins (PT) algorithm because it is simple and its performance has been well studied in many publications [29][30][31]. The PT algorithm uses a BPF of 5-15 Hz to remove unnecessary signal parts. Then, it applies derivative, squaring, and moving-average operations to the filtered signal. The R peaks are detected by a threshold-based method for the filtered and moving averaged signals at the algorithm. Figure 2 is the basic structure of ANC [32][33][34]. In this structure, ANC separates the noise signal n from d, the sum of the original signal s and noise n, using the adaptive filter and reference signal n . For this operation, it is assumed that n is correlated with n but uncorrelated with s. The difference between d and the output of the adaptive filter y can be expressed as the error signal e according to

ANC and Proposed Reference Signal
If s and n are uncorrelated and n satisfies the former assumption, the mean square of e is as follows: The adaptive filter updates its filter weights to minimize the value of E[e 2 ]: The filter output y approximates the noise n, and the estimated s can be obtained from the value of e. In our case, s, n, and d represent the original ECG, motion noise, and ECG m , respectively. For this ANC scheme, it is important to design the proper reference signal. It must have a low correlation value with respect to the original ECG and a high correlation with motion noise. To obtain the reference signal that has a high correlation with motion noise, r L and r R which are constructed by the difference of adjacent cECG signals are used. This is because it is assumed that there is little difference between the cECG signals when a subject is in a static condition, and that the difference increases when the subject is in motion. The verification of its suitability as the reference signal for ANC will be analyzed in Section 4.2. To use r L and r R in our method, the two signals are combined as a reference signal n . When the length of the weight vector or tap length for the adaptive filter is 2 · L, L elements in r L and r R are used for n , as shown in Figure 3. The tap length must be large enough to model relation between n and n , but too large tap length increases computational complexity. In the adaptive filter, the APA is used as the weight-updating algorithm because it converges faster than normalized least-mean-squares and it is less complex than the recursive-least-squares algorithm. Its weight vector updating equation is as follows [23]: U k = [n k n k−1 ... n k−P+1 ] T (8) where η is the step size, is the regularization parameter, and I is a P × P unit matrix. η determines the convergence speed of the adaptive filter. A large η increases the convergence speed, but it also increases misalignment. is set to a small constant. Then, I becomes a diagonal matrix having as diagonal entries. It is used to prevent the case that the inverse of U k U T k does not exist in Equation (10). P is the projection order of APA, and it means the number of input vectors used to update the weight vector. P decides the convergence speed and complexity of the algorithm. A larger P can increase the convergence speed, but at the same time the complexity of the algorithm will be increased because the dimension of U k U T k is increased. In our method, P is set to 2. w k is the weight vector of the adaptive filter for the k th sample, and it is updated recursively. Then, the k th sample of y is calculated by w k and reference signal n k as follows: For data having M samples, the output of ANC (ECG ANC ) can be obtained as e, The effect of ANC can be seen in Figure 4. The figure represents a part of the data from subject 5 of our outdoor experiment. In the figure, motion noise occurred from 2.7 to 4 s of ECG m , and the incorrect R peak was detected at approximately 2.7 s owing to the noise. If r L and r R include the motion information, the noise can be removed. In the example, r R was highly correlated with the motion noise. According to this, the noise could be reduced, and all R peaks could be detected well after ANC, as seen in the second graph in the figure.

Post-Processing
Even though the proposed reference signal is effective in most cases of motion noise, exceptional situations could happen under real circumstances. These phenomena mainly occur when the additional sensor includes a noise component that does not appear in the ECG m . That is, if a measurement or subtle motion noise occurs only at the additional sensors for the reference signal, the reference signal will contain a noise component that is uncorrelated with noise components in the ECG m . This could cause an error when ANC is conducted because the assumption of high correlation between the reference signal and a noise component in the ECG m is not satisfied. Figure 5 shows an example. In the figure, a noise that is not included in the ECG m was measured by r L at 0.5 s. By this noise component, a peak was wrongly detected after ANC, and the result became more erroneous than that of the ECG m . Therefore, for a robust and practical algorithm, this phenomenon must be prevented, and a post-processing is needed to correct the erroneous result. In our method, ECG ANC and ECG m are evaluated by two rules that are related to the change of peak interval and signal power. When ECG ANC is considered to be abnormal by the rules, ECG ANC is not used and is replaced by ECG m . This process can be considered as a selection process to decide whether ECG ANC is used or not. To test two signals, the first rule checks the normality of detected R peaks. For this, the R peaks of each signal are detected by the PT algorithm mentioned in Section 2.2. Then, the validity of detected R peaks is tested by the standard to check whether the range of acceleration or deceleration of instantaneous HR is normal. The standard uses an inequality introduced in [35]: where t i , t i+1 , t i+2 are the temporal positions of the three successive R peaks. This is based on the band-limited characteristics of the variation of R peaks, and its effectiveness was verified by an open ECG database [35]. Using this standard, if the number of three peaks that satisfy the standard in ECG ANC is higher than that of ECG m , then ECG ANC is used as the output of our algorithm. This is because it can be considered that ECG ANC contains more valid information on R peaks than ECG m . As an example, only two groups of three R peaks satisfied the standard in ECG m , as shown in Figure 6.
On the other hand, the number of three R peaks groups that satisfy the standard was three for ECG ANC by reduced noise. In this case, ECG ANC is selected as the output of the algorithm by the rule. For cases that do not satisfy the first rule, the second rule is applied. The rule compares the change of signal power in 5-15 Hz after ANC. The range of 5-15 Hz is the frequency band of an R peak [29]. Therefore, if ANC operates effectively and motion noise is reduced, the power of the frequency band will be decreased. This is because ANC assumes that the measured signal contains an additive noise to an original signal, and ANC operates to cancel out the noise. On the other hand, the increased power of the frequency band can be considered as an abnormal operation of ANC. As seen in Figure 5, if the reference signal contains noise that is uncorrelated with ECG m , it can generate additional noise that can cause the incorrectly detected R peaks or a performance degradation in R peak detection. For this reason, ECG ANC is discarded and ECG m is used as the output of the proposed algorithm when this rule is satisfied: where P ANC is the 5-15 Hz signal power of ECG ANC and P m is that of ECG m . For the rest of the cases, ECG ANC is used as the output of the algorithm.

Performance Index
To represent the accuracy of the detected R peaks, two performance indices were used: a) the sensitivity (Se), and b) the positive predictivity (P + ) index. The two indices are calculated as follows, where TP is the number of correctly detected R peaks, FN is the number of undetected R peaks within searching windows based on true R peaks, and FP is the number of detected R peaks at the outside of the searching window. Conventionally, 150 ms of searching window is used and it has 54 sample points in our system with a 360 Hz sampling rate [36]. However, we used 15 sample points for the searching window to identify the correctly detected R peaks because the ECG measured in the non-intrusive manner is much noisy than the ECG by the contact electrodes. Figure 7 shows the necessity of the decreased searching window. In the figure, the third peak was incorrectly detected by noise, but the sample difference with the position of its true R peak was 42 samples. In this case, the peak can be considered as the correctly detected R peak by the 150 ms of searching window. To avoid the false classification, the decreased searching window was used.

Comparison of Results
To verify the effect of the proposed method, we applied the method to the experimental data. In this process, every 4.5 s block of recorded data were processed sequentially. We used the 4.5 s length because at least three R peaks were needed for our post-processing. More longer block can be used, but we did not enlarge the length considering near-real-time operation. Furthermore, short block length will be advantageous for the post-processing because signal can be evaluated more minutely. In the processed data, 1.5 s of data represented the overlapped data that were used in previous processing. The overlapped data were needed to detect a R peak occurred at the boundary of two processing windows stably. The step size and tap length of the adaptive filter were set to 0.01 and 360 experimentally.
A comparison of the results for the indoor and outdoor experiments is listed in Tables 1 and 2. In the tables, Se and P + are presented for ECG m , ECG ANC , and the signal after post-processing. To show the difficulty of using a conventional ECG denoising method for the signal by a non-intrusive sensor, the performance indices of a wavelet-thresholding-based method were attached together [37]. In addition, the results by EKF were presented for comparison. In the table for the indoor experiment, data 1-1, 1-2, and 1-3 are the data from the subject 1. Likewise, data 2-1, 2-2, and 2-3, and data 3-1, 3-2, and 3-3, and data 4-1, 4-2, and 4-3 were measured from same subjects. d_acc is the difference of Se + P + between the tested signal and that of ECG m . That is, let Se and P + of ECG m be Se m and P + m , and those of the tested signal be Se t and P + t . Then, d_acc is as follows: This is calculated to compare the increase in R peak detecting accuracy by applied methods considering both Se and P + .
In Table 1, the effect of ANC could be identified. For most data, Se and P + were increased after ANC. However, the R peak detecting accuracy was lower than that of ECG m at data 3-3. This was because the reference signal of the data contained uncorrelated noise with the ECG m , as seen in Figure 5. This noise could happen by an electrical or measurement noise at the additional sensors used to construct the reference signal. Post-processing is added for cases like this. After post-processing, the accuracy of all data were higher than that of the ECG m . Se + P + increased 8.91% on average and 26.26% maximally at data 2-1. For the outdoor data, the proposed method likewise detected R peaks more accurately, as seen in Table 2. The proposed method increased Se + P + by 7.36% on average. However, ANC itself was not effective and the increase in accuracy was not significant after post-processing for outdoor data 1, 2, and 3. This was related to the characteristics of the data and will be discussed in the next section.
Post-processing increased the accuracy in most data. Its effect was noticeable at indoor data 3-3, and outdoor data 1, 2, and 3 having lower accuracy than ECG m after ANC. By the post-processing, the accuracy of the data was increased and it was higher than that of ECG m likewise other data. On the other hand, the R peak detecting accuracy of ANC decreased for indoor data 2-1, 3-2, and 4-2 after the post-processing. This was because the post-processing could not perfectly distinguish the signal having better accuracy in a certain processing window. It was hard to choose better signal when the signal contained a noisy or irregular component. However, the decreased accuracy was insignificant and it was lower than 0.5%. Furthermore, the accuracy increased for all outdoor data having longer data length than indoor data after the post-processing. This result shows an advantage of the post-processing for general cases.
In the results, the wavelet-based method had an effect on the indoor data 1-3, 2-2, 3-2, 4-2, and 4-3 and outdoor data 1, 2, and 6, but the accuracy was mostly lower than the original one. This was because of the large amplitude of motion noise. The wavelet-based method divides the signal into the signals of a certain frequency band, and it applies a threshold to remove noise components. Therefore, this method was not effective in the non-intrusive ECG because the ECG contained motion noise having a large amplitude. The EKF enhanced the R peak detecting accuracy of all data except for indoor data 1-1 and outdoor data 3. For indoor data 3-3 and 4-3, its accuracy was higher than that of ANC with post-processing. However, the increased accuracy was not significant for all data. This limitation comes from the model-based approach of EKF. It uses an ECG model to estimate the original ECG, but the used model will have a large error with a measured signal. This error can be generated by the low signal-to-noise ratio of the non-intrusive ECG signal itself and the motion noise having a significant amplitude. The increased Se + P + was maximum in indoor data 1-3 as 2.59% by the EKF. On the other hand, the effect of ANC was remarkable. Its accuracy was higher than other methods for most of the data, and its increased range was significant. Furthermore, it could improve the accuracy of all data with post-processing. The averaged rate of increase was 8.39% for all experimental data. Figure 8 shows one example that represents the advantage of ANC. The wavelet-based method and EKF were not effective to reduce motion noise in the figure. However, ANC could reduce the motion noise prominently and all R peaks were correctly detected. This effectiveness of ANC results from the proposed reference signal that contains information on the occurred motion noise. In addition, the complexity of our method is not high. In our experiments, the measured ECG was processed by MATLAB and a personal computer having an Intel Core i7-3930k CPU and 16 GB of RAM. The processing time for the data divided into a 4.5 s length was 0.21 s on average and total processing time for the entire data including total indoor and outdoor data was 662.98 s. In the 4.5 s data, a 1.5 s length is overlapped data and 3 s is newly processed data. The 0.21 s is very short compared with the 3 s length of the new data. Therefore, our algorithm could be implemented in a near-real-time system.

Analysis on Outdoor Data
In Table 2, ANC was less effective for outdoor data 1, 2, and 3 compared to indoor data. To investigate the reason, the outdoor data were analyzed in Table 3. In the table, Se+P + represents the sum of Se and P + for the each ECG m of outdoor data. Se+P + was high in outdoor data 1, 2, and 3 because the data had little noise. In this case, the application of ANC could not make much difference in R peak detecting accuracy because the signal was already clean and contained little noise. This can be one reason that the effect of ANC was not remarkable. To know the characteristics of noise in the data, we divided the processing windows of each outdoor data into two groups. One is the windows having 100% of Se and P + . The windows can be considered signal parts having little noise, and the averaged signal power of the windows (P clean ) was calculated to compare it with noise power (P noise ) in each data. Windows in the other group can be considered as noisy signal parts because it contains R peak detecting error. P noise was obtained as the averaged signal power of the windows in each data, and the relative amplitude of P noise (r_P noise ) for clean signal parts was calculated as r_P noise = P noise P clean (19) r_P noise was extremely high in outdoor data 2 and 3 as seen in Table 3. This severe noise occurred when the body of subjects was totally detached and far away from the cECGs by the manipulation of the steering wheel in a corner, or by the sway of the vehicle owing to speed bumps. For this excessively severe noise, ANC was not effective. This is because additional cECGs could not measure the valid motion information that was related to the noise in ECG m . Furthermore, the characteristics of noise measured in the additional cECGs could be much different from the noise in ECG m . Outdoor data 2 and 3 included a small number of noisy windows, and the noise of the windows was severe. The use of ANC was not effective in the data by this reason. When the data were measured, the movement of subjects was restricted by the cautious behavior of subjects for the experiment and the use of contact ECG electrodes. This could make the data contain a few signal parts having the noise that can be effectively reduced by ANC. In real driving situations where the various movements of a subject occur, the effect of ANC will be more prominent as in the rest of the outdoor data. In addition, the same problem with indoor data 3-3 occurred in some outdoor data as seen in Figure 9. This problem was caused by the motion information that is included in reference signal but uncorrelated with motion noise in ECG m . A measurement noise or electrical noise can be a reason for this phenomenon. However, these errors were corrected by post-processing. After ANC with the post-processing, R peak detecting accuracy was increased, and the increased accuracy outperformed those of other methods in all outdoor data.

Appropriateness of Proposed Reference Signal
This section analyzes the suitability of the proposed reference signal as a reference signal for ANC. First, to confirm the assumption that the reference signal and the R wave of the ECG are uncorrelated, the ECG with a 3-min length (ECG clean ) was measured in a stable condition to make it contain only the ECG itself with as little motion noise as possible. Then, ECG clean passed through the BPF of 5-15 Hz to get R waves, and the correlation coefficients (CC) with r L and r R constructing the reference signal were calculated. For two representative signals X and Y, having M samples each, their correlation can be expressed by CC: where X and Y are the means of X and Y [38]. If the two signals have a low correlation, the value of CC will be close to 0. For signals that have a high correlation, the absolute value of CC will be close to 1. For the 5-15 Hz components of ECG clean , calculated CC can be seen in Figure 10, and the same analysis was conducted for indoor data 2-1 in Figure 11 for comparison. The lower parts of two figures represent the 5-15 Hz signal power of each signal. The signal power was much higher in the indoor data 2-1 because it contained much motion noise. Looking at the results on CC, the absolute value of CC was lower than 0.15 when there was little motion noise and the signal was approximated to the R wave. Comparing this result with the CC of the noisy signal in Figure 11, it is obvious that the correlations between R wave and r L , r R are low. Therefore, it can be concluded that the correlation between the proposed reference signal and the R wave is low because the proposed reference signal consists of r L and r R .  From the former results, the correlation between motion noise and r L , r R could also be known because the absolute value of CC was increased when the motion noise occurred. To show a more generalized result, the ECG m of the indoor data and ECG clean were filtered by a HPF of 1 Hz to reduce the effect of respiration. Let the filtered ECG be ECG H , the sum of absolute values of CCs between ECG H with r L and with r R (CC L+R ) was calculated at every processing window unit. Then, CC L+R s were averaged for each indoor data and ECG clean . That is, the averaged CC L+R (a_CC L+R ) is calculated as CC L+R,i = abs(CC L,i ) + abs(CC R,i ) where N is the number of processing windows in each data. CC L,i or CC R,i is the CC between the tested ECG H and r L or r R in the i th processing window. The calculated a_CC L+R is listed in Table 4. In all cases, a_CC L+R of indoor data containing motion noise was higher than ECG clean . This result reveals that the reference signal and the motion noise have a correlation because a_CC L+R increased when the ECG contained the motion noise.
To validate the relation in more detail, all ECG clean , indoor and outdoor data were filtered by the HPF of 1 Hz and the averaged signal power was calculated according to CC L+R . That is, CC L+R was divide into 0.05 interval and signal power in each interval was averaged in Figure 12. For the experiment, a processing window having signal power higher than a threshold was treated as a outlier and excluded. The threshold was set as 100 times P clean for each data. P clean is obtained as the averaged signal power of processing windows having 100% of Se and P + for each data as mentioned in the previous section. In the Figure 12, the degree of correlation between the reference signal and ECG was increased mostly in accordance with the increase in signal power or the occurrence of motion noise.
This tendency can be considered as the evidence of a high correlation between the reference signal and the motion noise because the correlation is increased as the ratio of motion noise in ECG increased. Table 4. Averaged sum of absolute values of CCs between the ECG H with r L and with r R for the indoor data and ECG clean .

Conclusions
This study proposes a method to reduce motion noise and to accurately detect R peaks using non-intrusive sensors. It uses additional cECGs placed adjacent to the cECGs for ECG measurement. Then, a reference signal is constructed using the sensor signals, and it is utilized in ANC including an adaptive filter with an APA to reduce motion noise and enhance R peaks. Post-processing is added to prevent an incorrect result in exceptional situations and to make our method more practical. In experiments, the system was implemented in a chair and a driving seat. Based on the results, an increase in R peak detecting accuracy was verified when the proposed method was used. Then, the analysis of the proposed reference signal was conducted to show its suitability for theoretical assumptions.
The proposal for the new reference signal to denoise non-intrusive ECG is our original work. In addition, the effect of our method using the new reference signal could be shown numerically by our experimental results. Because of the advantages of our method, more accurate and stable HR or HRV values can be obtained by detected R peaks in non-intrusive measurements. In addition, the proposed method does not need high-computational complexity, and it can proceed in near-real-time. Therefore, our method can be used in applications that require real-time HR or HRV information and that use a device having a shape that is similar to a chair. One of the examples is a driver's condition monitoring system. To improve our system, an adaptive filter technique like variable step size algorithms or the combination of two adaptive filters can be used to deal with motion noise. Furthermore, post-processing can be modified to obtain better results and not to degrade the performance of ANC as pointed out at result section. In addition, just one additional cECG was used in our method to obtain motion information for each left and right side, because this research was conducted to investigate its availability. Therefore, research using more sensors can be performed to improve R peak detecting accuracy in the future. Moreover, the system was integrated with a chair and driving seat in our experiment. Research to apply our system to a wearable device can be conducted. This will expand the applicability of our method.