ECG Signal Acquisition and Processing System

This paper mainly designs an ECG signal acquisition and processing acquisition system, which mainly includes two parts: an ECG acquisition front-end circuit module and a LabVIEW processing and display module. The front-end circuit of ECG acquisition mainly consists of amplifying and filtering modules, which are used to collect and process human signals in real time. In addition, a charging box circuit is designed at the same time, which can charge the ECG monitoring equipment while storing energy and increase the standby time of the equipment. At the same time, the acquired signal is filtered in LabVIEW, and the baseline drift is eliminated to obtain a cleaner and clearer ECG waveform.


Introduction
In recent years, China's aging problem has become increasingly prominent, and with it comes an increase in chronic diseases such as cardiovascular diseases and cognitive disorders.ECG signal acquisition is very important for the elderly population because ECG can help doctors find and diagnose heart diseases [1]   .Based on this, this paper designs a low-power ECG acquisition front-end circuit for real-time acquisition of human ECG signals.At the same time, it designs a charging box circuit, which can charge the energy storage at the same time to charge the ECG monitoring equipment and grows the standby time of the equipment.This system has the advantages of ultra-low power, cost-effectiveness, long standby time, and so on.

Overall system design and features
The overall block diagram of this system is shown in Figure 1, including the ECG acquisition front-end module and LabVIEW processing display module.The ECG acquisition front-end module mainly amplifies and filters the ECG signal [2] , and the charging box circuit mainly charges and stores energy as well as realizes the charging function of the ECG device; the LabVIEW processing and display module mainly filters the signal further and eliminates the baseline drift.

Baseline drift remove
Figure 1.System overall block diagram

ECG acquisition front-end circuit design
3.1 Preamplifier circuit ECG signals are weak bioelectrical signals [3] .The acquisition difficulty is relatively great, so the instrument amplifier AD620 is selected in this system, which is a high-precision chip with the characteristics of low power consumption, low noise, low-temperature bleaching, and high precision.
Its gain value (1 ~ 1000) is controlled only by an external resistance Rg of the chip [4] .
Because the ECG signal is relatively weak and the noise interference is more, the two-stage amplification is used, and the pre-amplification ratio should not be too large, set to 100 times.Hence, the Rg chooses a 500-ω resistance.The specific circuit diagram is shown in Figure 2.

Low-pass filter circuit
The frequency range of ECG signals is usually between 0.05 Hz-100 Hz, which includes heart beating signals, breathing signals, etc.Therefore, we first need to design a low-pass filter with a cutoff frequency of about 100 Hz [5] .According to the requirement of in-band flatness Q value 0.707, two second-order filters are cascaded to form a fourth-order filter according to the requirement of out-of-band attenuation characteristics [6] .Figure 3 shows the low-pass filter circuit diagram.

High-pass filter circuit
The frequency range of the ECG signal is 0.05 Hz ~ 100 Hz, so it is also necessary to design a high-pass filter with a cutoff frequency of about 0.05 Hz.According to the requirement of in-band flatness Q value 0.707, two second-order filters are cascaded to form a fourth-order filter according to the requirement of out-of-band attenuation characteristics.Figure 4 shows the circuit diagram.

50 Hz notch filter circuit
To suppress the power frequency interference generated in the human body or test system, it is necessary to design a band-stop filter.This system adopts dual T-network active filters.One T-type network is a high-pass filter composed of C-C-R/2, and the other T-type network is a low-pass filter composed of R-R-2C [7] .Figure 5 shows the circuit diagram.

Final amplifier circuit
The pre-amplifier module set in this system has amplified the signal by 100 times, and the final amplifier circuit will amplify it twice, and the amplification factor is about 10 times.Figure 6 shows the circuit diagram.

Right leg drive circuit
The right leg drive circuit is used to reduce the contact resistance between the electrode and the body and reduce the interference between the electrodes, thereby reducing the common mode interference and improving the signal quality [8] .The basic principle of the right leg drive circuit is that the right leg drive circuit will reverse amplify the common mode interference extracted from the previous enlarged circuit, feedback to the right leg, and reverse cancel the human signal.The specific circuit block diagram is shown in Figure 7.

Charging box circuit
The charging box circuit achieves the overall power supply to the circuit system but also its power storage.The system uses a power manager (PMU) that integrates charging and boosting [9] .The charging box circuit includes the charging box boosting circuit, and the chip model is BQ25619RTW.Figure 8 shows the circuit design.The overvoltage protection module is designed to protect the circuit while setting the charge and discharge functions.

LabVIEW handles display module design
In this system, an ECG processing and display module is designed in LabVIEW, which adopts modular programming mode [10] .The whole system module includes a band-pass filter module, power line interference elimination module, baseline drift elimination module, and ECG waveform display module.

Bandpass filter module
After connecting the front-end module of ECG acquisition, the ECG data collected in real time is read.
In the graphic program of the rear panel, the received ECG data is first passed through the second-order bandpass filter.The program design calls Butterworth coefficient vi to generate a digital Butterworth bandpass filter, as shown in Figure 9.

Power line interference removal module
The power line interference that needs to be filtered out here is mainly 50 Hz power frequency interference, and this module mainly uses an IIR filter, as shown in Figure 10.

Baseline drift elimination module
This is followed by the elimination of baseline drift, which refers to the persistent, slowly changing DC component of the ECG signal.This module mainly uses the Savitzky-Golay filter, which is realized through the process of convolution; that is, the continuous subset of adjacent data points is fitted with a low-order polynomial by the linear least square method [11] .The specific program design block diagram is shown in Figure 11.

Experimental results
The collecting electrodes were attached to the left arm, right arm, and right leg, respectively, to collect ECG signals.After passing through the circuit system, the ECG waveform was displayed on the oscilloscope.The experimental results are shown in Figure 12.The set magnification of the ECG frontend acquisition circuit is 1000 times.As can be seen from the figure, the overall magnification of the measured system is about 1000 times, which meets the design requirements.
The acquired ECG waveforms are displayed in LabVIEW, as shown in Figure 13.The signal is further processed in LabVIEW for bandpass filtering, power line interference removal, and baseline drift removal.The obtained waveforms are shown in Figure 14.

Conclusion
This paper designs a complete and feasible ECG acquisition and processing system.The physical circuit test result is consistent with the set value.Then the collected ECG waveform is processed twice in LabVIEW to obtain a clearer and more accurate ECG waveform.The system has the advantages of a

Figure 6 .
Figure 6.Final amplifier circuit Figure 7. Right leg drive circuit

Figure 13 .
Figure 13.Unprocessed ECG waveforms Figure 14.Processed ECG waveforms simple circuit structure, high-cost performance, long standby time, and ultra-low power consumption.It is also lightweight and can be carried remotely or used at home.