Wearable ECG Signal Detection System Based on Adaptive Filtering

Peng Liangguang, Lin Jinzhao, Pang Yu, Li Zhangyong, Li Guoquan, Zhou Qianneng

(Chongqing University of Posts and Telecommunications, Key Laboratory of Optoelectronic Information Sensing and Transmission Technology, Chongqing 400065)

Abstract: To detect the electrocardiogram (ECG) signals of high-risk occupational groups such as police and firefighters, a wearable wireless ECG detection system is designed using a chest strap as the wearable carrier, enabling real-time transmission and display of ECG and heart rate on a smartphone. Considering the daily activities of police officers, a three-axis accelerometer is used as a reference signal based on the principle of adaptive filtering to compare the output waveforms after filtering motion artifacts (Motion Artifact, MA) using two adaptive filtering algorithms. The results show that the adaptive filter using the Normalized Least Mean Square (NLMS) algorithm outputs a stable baseline ECG signal with an R-wave localization accuracy exceeding 99%. The heart rate values measured in normal human activities have an error within 4%, indicating high measurement accuracy.

Keywords: Adaptive filter; Accelerometer; ECG signal; Motion artifact; Wearable chest strap

Classification Number: TN911.72; R318.6

Document Identification Code: A

DOI: 10.16157/j.issn.0258-7998.173174

Chinese Citation Format: Peng Liangguang, Lin Jinzhao, Pang Yu, et al. Wearable system based on adaptive filter for monitoring ECG signal[J]. Application of Electronic Technique, 2017, 43(9): 17-21.

English Citation Format: Peng Liangguang, Lin Jinzhao, Pang Yu, et al. Wearable system based on adaptive filter for monitoring ECG signal[J]. Application of Electronic Technique, 2017, 43(9): 17-21.

1 Introduction

As a high-risk profession, police officers have sacrificed 2,129 lives and sustained 20,741 injuries in the line of duty over the past five years according to statistics [1]. Among them, the highest number of casualties occurs among frontline officers, with excessive fatigue being a major contributing factor. The heavy workload and social security pressures have resulted in high casualty rates among police officers. Therefore, real-time monitoring of their physical health is of significant practical importance.

The electrocardiogram (ECG) signal is a crucial component of human vital signs. Real-time monitoring of ECG signals can reflect life indicators, preventing missed optimal rescue times for injured officers. Additionally, it can be used for analyzing heart rate variability, mental stress, and fatigue detection [2], thus avoiding sudden deaths due to excessive fatigue and stress [3]. Developing a real-time ECG monitoring system can provide timely warnings and feedback for police officers and other high-pressure workers.

Currently, research on real-time ECG detection systems is increasingly advanced. However, wearable ECG signal acquisition faces challenges such as low comfort of electrodes, e.g., Ag/AgCl wet electrodes limiting human activity and causing skin allergies [4]; and motion artifacts (MA) interference, where relative motion between the human body and electrodes leads to inaccurate measurements.

Adaptive filtering, as a nonlinear filtering algorithm, utilizes reference signals to adjust filter coefficients, relying on the correlation between reference signals and noise to filter out interference signals. Research on adaptive algorithms indicates [5] that the acceleration of the acquisition electrode is closely related to the MA interference contained in the ECG signal. Therefore, the proposed wearable wireless ECG detection system uses a chest strap embedded with conductive silicone as the ECG acquisition electrode, employing the ADXL345 accelerometer to output acceleration signals, combined with an adaptive filter to eliminate MA interference from the ECG signal. The Recursive Least-Square (RLS) and Normalized Least Mean Square (NLMS) algorithms are used to implement a simulated adaptive filter, comparing the stability of the filtered ECG waveforms and the accuracy of R-wave localization as evaluation criteria for the filtering effects of the two algorithms.

1.1 Overall Design

The wearable wireless ECG detection system designed in this paper uses soft conductive silicone as the front-end acquisition electrode, TI’s low-power ADS1292 as the ECG analog front end, and STMicroelectronics’ 32-bit low-power microcontroller STM32L151 as the main control chip of the detection system. The TI ultra-low-power Bluetooth CC2640 is used for real-time transmission of ECG data, and a Bluetooth 4.0 serial receiver is utilized for upper computer data acquisition. The system design block diagram is shown in Figure 1, and the hardware appearance is shown in Figure 2. The mobile APP receives data from the ECG detection system via Bluetooth in real-time, allowing for feature extraction and analysis of the ECG signal, enhancing the system’s practical value.

Wearable ECG Signal Detection System Based on Adaptive Filtering

Wearable ECG Signal Detection System Based on Adaptive Filtering

1.2 Hardware Implementation of the Detection System

The hardware module unit of the ECG detection device is shown in Figure 3, which includes a lithium battery power management module, ECG acquisition module, data processing module, Bluetooth transmission communication module, and acceleration acquisition module. The system power management module uses TP4057 for lithium battery charging management and employs the TLV70033 voltage regulator chip to provide 3.3 V voltage for the system. The ECG acquisition module collects ECG signals using a single lead (Lead 1), utilizing the 24-bit ADC inside the ADS1292 to sample ECG data, and employs a Serial Peripheral Interface (SPI) for real-time data transmission to the microcontroller (MCU). The data processing module consists of the main control microcontroller STM32L151 minimal system, which uses internal SPI and I2C interfaces to acquire data from the ECG acquisition module and accelerometer, processing digital signals in real-time using the Cortex-M3 core, and transmitting the data to the Bluetooth module via asynchronous serial communication (UART), enabling the collected ECG data to be transmitted, filtered, and displayed in real-time on terminals (upper computer, mobile APP).

Wearable ECG Signal Detection System Based on Adaptive Filtering

1.3 Software Implementation of the Main Control Microcontroller

The main control microcontroller is the core processing unit of the entire system. The program flowchart of the wearable detection system is shown in Figure 4. The main control microcontroller first initializes the system, then configures the external signal acquisition units ADS1292 and ADXL345, enables the internal data transmission interface, starts sampling the ECG signal, receives and stores ECG data, and processes the parsed data through filtering and calculations for signal preprocessing. Finally, the processed data is sent to the Bluetooth module via asynchronous serial UART.

Wearable ECG Signal Detection System Based on Adaptive Filtering

2 Algorithm Design

2.1 Preprocessing Algorithm for ECG

The ECG signals collected by the detection system have weak amplitude values and contain a lot of interference, including power frequency interference, electromyographic interference, baseline drift, and MA [5]. The wearable chest strap samples the raw ECG signal using a single lead, with a useful frequency range of 0.05 to 40 Hz [6]. Power frequency interference and electromyographic noise belong to the high-frequency components of the ECG signal. A digital FIR low-pass filter and a 50 Hz notch filter can be used to eliminate them. For baseline drift in the ECG signal, morphological filtering algorithms are generally used for removal [7].

When detecting ECG signals, considering the physical movements of police officers in their actual environment, the relative displacement between the two acquisition electrodes on the chest strap and the skin introduces significant low-frequency MA interference [5]. The wearable chest strap detection device uses a three-axis accelerometer to detect body motion signals as reference signals. The ECG waveform containing MA interference and the three-axis acceleration waveform are shown in Figure 5. It can be seen that the reference signal and the MA interference contained in the ECG signal are correlated, allowing the use of an adaptive filter to process the ECG signal.

Wearable ECG Signal Detection System Based on Adaptive Filtering

2.2 Adaptive Filtering Algorithm

In statistical signal processing, adaptive filters have numerous applications, such as coherent noise cancellation [8]. During the filtering algorithm processing, an additional input reference signal is required to calculate and update the optimal filter coefficients. This algorithm can eliminate MA interference contained in the ECG signal, and the higher the correlation between the reference signal and MA interference, the better the filtering effect. The block diagram of the adaptive filter unit is shown in Figure 6.

Wearable ECG Signal Detection System Based on Adaptive Filtering

When collecting human motion heart rates, the ECG signal is mixed with significant MA interference. The adaptive filter input reference signal rf(k) outputs an error e(k), utilizing the Wiener optimal filtering criterion, where the cost function selects the mean square error E{e2(k)}. The adaptive algorithm continuously updates the filter coefficients w(k) to minimize E{e2(k)}.

The Least Mean Square (LMS) algorithm calculates the optimal filter coefficients using the steepest descent convergence path. The update calculation formula for designing an M-order adaptive filter is:

Wearable ECG Signal Detection System Based on Adaptive Filtering

Wearable ECG Signal Detection System Based on Adaptive Filtering

2.3 Heart Rate Calculation and Evaluation

After preprocessing the original ECG signal, the ECG signal is processed through adaptive filtering to eliminate MA interference. This paper uses both the NLMS algorithm and the RLS algorithm to update the adaptive filter coefficients, with the accuracy of R-wave localization in the output signal as the evaluation parameter for the algorithm.

The R-wave localization of the ECG signal uses the differential threshold method, which can quickly locate the R-wave and is suitable for ECG detection devices with high real-time requirements [11]. The heart rate calculation uses the intervals between two R-waves as calculation parameters, with the heart rate HR calculation formula:

Wearable ECG Signal Detection System Based on Adaptive Filtering

Where RR is the interval between adjacent R-waves, and RS is the sampling rate of the ECG signal. In actual human motion heart rate measurements, missed or false detections of R-waves often occur. Therefore, this paper uses the error in heart rate calculation as an evaluation parameter for system measurement.

3 Experimental Results

3.1 Overall System Testing

The ECG detection system consists of the ECG detection hardware device and mobile APP. As shown in Figure 7, the conductive silicone electrodes and wearable ECG detection device form the system hardware device, with the mobile phone receiving ECG data and three-axis acceleration data via Bluetooth 4.0 and displaying the waveform and heart rate values in real-time.

Wearable ECG Signal Detection System Based on Adaptive Filtering

3.2 R-Wave Localization Testing of ECG Signal

The experiment uses MATLAB software to simulate the algorithm, with the NLMS algorithm step size μ set to 0.5 and the RLS algorithm λ set to 0.995. The R-wave localization is performed on the ECG signal containing MA interference and the output signal from adaptive filtering, with the localized waveforms shown in Figure 8. Comparing the R-wave localization shows that the output signal from the adaptive filter using the NLMS algorithm can correctly locate the R-wave, while the RLS algorithm shows false and missed detections of R-waves.

Wearable ECG Signal Detection System Based on Adaptive Filtering

Table 1 shows the collection of 20 minutes of ECG data from 10 ordinary testers, counting the number of R-waves and comparing the accuracy of the filtering output of the two adaptive algorithms. The statistical results indicate that for the 10 testers, the accuracy of R-wave localization after filtering with the NLMS algorithm can reach over 99%.

Wearable ECG Signal Detection System Based on Adaptive Filtering

3.3 Heart Rate Testing

Using the ECG detection system testing platform, the system connects to the mobile phone via the Bluetooth module, implementing the NLMS algorithm on the mobile terminal to measure actual heart rate values during sitting and exercise, comparing the results with the standard medical monitor, Mindray MEC-1000.

Table 2 presents the heart rate testing results, with groups 1 to 5 representing heart rate values measured while sitting, and groups 6 to 10 corresponding to heart rate values measured during daily activities such as walking and jogging. The error statistics are shown in Figure 9, indicating that the heart rate values measured using the NLMS algorithm have an error within 1.5% compared to the standard medical monitor while sitting, and within 4% during exercise.

Wearable ECG Signal Detection System Based on Adaptive Filtering

Wearable ECG Signal Detection System Based on Adaptive Filtering

4 Conclusion

To achieve real-time detection of ECG signals for high-risk occupational groups such as police officers, a wearable real-time detection system has been designed using a chest strap. Conductive silicone is used as the acquisition electrode, combined with the ECG detection system to collect ECG signals, with data wirelessly transmitted via Bluetooth 4.0, and real-time display of waveforms and heart rate values on a mobile APP. To detect ECG signals during daily activities, an adaptive filter is designed to eliminate MA interference contained in the ECG signal, comparing the NLMS algorithm with the RLS algorithm. The results indicate that the adaptive NLMS algorithm provides better filtering effects in real-time ECG signal detection systems, with a stable output ECG baseline and R-wave localization accuracy exceeding 99%. The heart rate values measured on the mobile APP have an error within 4%, indicating high measurement precision for the overall system.

The ECG detection system is not only applicable to police officers and firefighters but can also be slightly modified for high-pressure populations and patients. High-precision measurement of ECG signals provides important parameters for subsequent assessments of depression, heart disease, and mental stress analysis.

References

[1] Yuan Guoli. 2,129 police officers sacrificed in the line of duty over the past five years [N]. Jinghua Times, 2015-04-06(006).

[2] Chen Yingzhao, Gao Yueming, Gan Zhenhua, et al. Design of a portable home ECG detector based on STM32 [J]. Application of Electronic Technique, 2013, 39(9): 18-20.

[3] Jain S K, Bhaumik B. An ultra-low power ECG signal processor design for cardiovascular disease detection [C]//International Conference of the IEEE Engineering in Medicine & Biology Society. Conf Proc IEEE Eng Med Biol Soc, 2015: 857.

[4] Chi Y M, Jung T P, Cauwenberghs G. Dry-Contact and noncontact biopotential electrodes: methodological review [J]. IEEE Reviews in Biomedical Engineering, 1937, 3: 106-119.

[5] Thakor N V, Zhu Y S. Applications of adaptive filtering to ECG analysis: noise cancellation and arrhythmia detection [J]. IEEE Transactions on Biomedical Engineering, 1991, 38(8): 785.

[6] Tompkins W J. Biomedical digital signal processing [M]. Prentice Hall, 1993.

[7] Wang Jiawang, Wu Lingyan, Yang Tao, et al. Implementation and comparison of several algorithms for removing ECG baseline drift [J]. China Medical Device Information, 2008, 14(6): 30-33.

[8] Liu Xiaoqing, Xiong Xiaoyan. Application of adaptive filtering in noise cancellation [J]. Science and Technology Information Development and Economy, 2007, 17(11): 208-209.

[9] Lee W C, Yang Y S O, Ke T C, et al. Adaptive reduction of motion artifact in a portable ECG system [C]//Sensors. IEEE, 2010: 704-707.

[10] Romero I, Geng D, Berset T. Adaptive filtering in ECG denoising: A comparative study [J]. 2012, 30(1): 45-48.

[11] Lai D, Zhang F, Wang C. A real-time QRS complex detection algorithm based on differential threshold method [C]//IEEE International Conference on Digital Signal Processing. IEEE, 2015: 129-133.

Wearable ECG Signal Detection System Based on Adaptive FilteringWearable ECG Signal Detection System Based on Adaptive Filtering

Leave a Comment