1. ECG signal preprocessing
2. Feature extraction of ECG signals
3. Summary
4. More related resources
The electrocardiogram is a technique for recording the bioelectric currents generated by the heart. Clinicians can use the electrocardiogram to assess the patient's heart condition and make further diagnoses. ECG recordings are obtained by sampling the bioelectric currents sensed by several electrodes (leads). A typical single-cycle electrocardiogram waveform is shown in Figure 1.
Figure 1 Typical single-cycle ECG waveform
Generally speaking, the recorded ECG signal will be contaminated by noise and artificially introduced artifacts, which are in the frequency band of interest and have similar characteristics to the ECG signal itself. In order to extract useful information from the noisy ECG signal, we need to process the original ECG signal.
Functionally, the processing of ECG signals can be roughly divided into two stages: preprocessing and feature extraction (as shown in Figure 2). The preprocessing stage removes and reduces the noise in the original ECG signal, while the feature extraction stage extracts diagnostic information from the ECG signal.
Figure 2 Typical ECG signal processing flow chart
Using LabVIEW and related toolboxes, such as the Advanced Signal Processing Toolbox (ASPT) and the Digital Filter Design Toolbox (DFDT), users can easily create signal processing applications for two stages, including eliminating baseline drift, removing noise, QRS complex wave detection, fetal heart rate detection, etc. This article focuses on the use of LabVIEW for typical ECG signal processing methods. [page]
1. ECG signal preprocessing
ECG signal preprocessing can help users remove contamination from ECG signals. Broadly speaking, ECG signal contamination can be divided into the following categories:
• Power line interference
• Electrode separation or contact noise
• Artifacts introduced by patient electrode movement
• Electromyographic (EMG) noise
• Benchmark drift
Among these noises, power line interference and reference drift are the most important and can strongly affect ECG signal analysis. In addition to these two noises, other noises may also distort ECG signals due to their wideband and complex random processes. Power line interference is a narrowband noise centered at 60 Hz (or 50 Hz) with a bandwidth of less than 1Hz. Usually, ECG signal acquisition hardware can eliminate power line interference. However, reference drift and other broadband noise are difficult to suppress through hardware devices. Software design has become a more powerful and feasible offline ECG signal processing method. Users can use the following methods to eliminate reference drift and other broadband noise.
Eliminate reference drift
Baseline drift is usually caused by breathing and has a frequency between 0.15 and 0.3 Hz. It can be suppressed by using a high-pass digital filter. Users can also use wavelet transform to eliminate baseline drift by detrending the ECG signal.
1. Digital filter method
The DFDT toolbox in LabVIEW provides a graphical and interactive method for quickly and efficiently designing and implementing finite impulse response (FIR) or infinite impulse response (IIR) filters. For example, you can use the Classical Filter Design Express VI to design a Kaiser window FIR high-pass filter to eliminate reference drift. Figure 3 shows an example of a high-pass filter. You can use the flowchart of this example VI to eliminate reference drift.
Figure 3. Design and use of a high-pass filter to eliminate reference drift.
2. Wavelet transform method
In addition to digital filters, wavelet transform is also an effective method to eliminate signals within a specified frequency band. The LabVIEW ASPT toolbox provides WA Detrend VI, which can eliminate the low-frequency trend of the signal. Figure 4 shows an example of using WA Detrend VI to eliminate baseline drift.
Figure 4 Using WA Detrend VI to eliminate baseline drift
This example uses the Daubechies6 (db06) wavelet because it is similar to the actual ECG signal. In this example, the ECG signal has a sampling period of 60 seconds and a total of 1200 sampling points. According to the following formula, the trend level is 0.5:
Where t is the sampling period and N is the number of sampling points.
Figure 5 shows the original ECG signal, as well as the ECG signals processed by the digital filter-based method and the wavelet transform-based method. You can see that the processed ECG signal contains almost no baseline drift information while maintaining the main characteristics of the original ECG signal. You can also notice that the wavelet transform-based method is more advantageous because it does not introduce delay and has less distortion than the digital filter-based method.
Figure 5 Comparison of digital filter-based and wavelet transform-based methods
Eliminating broadband noise
After eliminating the baseline drift, the ECG signal is clearer and more stable than the original signal. However, other types of noise still affect the feature extraction of the ECG signal. These noises are complex random processes with wide bandwidths, so traditional digital filters cannot be used. In order to eliminate broadband noise, Wavelet Denoise Express VI is needed.
This Express VI first applies wavelet transform to decompose the ECG signal into subbands, then adjusts the wavelet coefficients using threshold or shrinkage functions, and finally reconstructs the signal after removing noise. The following figure shows an example of using undecimated wavelet transform (UWT) on an ECG signal. [page]
Figure 6 Using UWT to eliminate broadband noise in ECG signals
Compared with discrete wavelet transform (DWT), UWT has a better trade-off between smoothness and accuracy. By comparing the denoised ECG signal with the undenoised ECG signal, as shown in Figure 7, it can be found that the broadband noise is greatly suppressed while the details of the ECG signal remain unchanged.
Figure 7 ECG signals before and after UWT denoising
2. Feature extraction of ECG signals
For diagnosis, various features need to be extracted from the preprocessed ECG data, including QRS complex wave detection, QRS complex wave amplitude, PR interval, ST interval, fetal heart rate, etc. This section will mainly discuss QRS complex wave detection and fetal ECG extraction.
QRS complex detection
Detecting the R peak and QRS complex in the ECG signal can provide information about heart rate, conduction velocity, various tissue states in the heart, and various abnormalities. It provides a basis for the diagnosis of heart disease, so it has attracted great attention in the field of ECG signal processing. However, noise and time-varying morphology make detection very difficult.
Because wavelets can extract and analyze the main features of noisy signals with the advantage of multi-resolution, many wavelet-based detection methods have been proposed in recent years. In this paper, the WA Multiscale Peak Detection VI in the LabVIEW ASPT toolbox is used to detect Q, R, and S points. Before peak/trough detection, the ECG signal is decomposed into 8-level Daubechies6 (db06) wavelets using Multiresolution Analysis Express VI (as shown in Figure 9), and then the signal is reconstructed using D4 and D5 subbands. The reason why D4 and D5 subbands can be used for reconstruction is that almost all QRS details are in these two subbands, which makes QRS detection more accurate.
Figure 8 Implementation of multi-resolution analysis of ECG signals and QRS wave detection
Figure 9 shows the ECG signal after wavelet multi-resolution analysis (MRA) and peak/trough detection, as well as the original ECG signal (from the MIT-BIH database). In this figure, you can see that the peaks and troughs (especially the Q and S points) become more obvious after wavelet multi-resolution analysis.
Figure 9 Original ECG signal, ECG signal after MSA, and ECG signal after peak/trough detection
After the QRS complex wave is detected, other methods can be used for feature analysis. For example, the RR interval signal can be used to perform heart rate variation (HRV) analysis to show the status of the heart and nervous system.
Fetal ECG signal extraction
The fetal electrocardiogram (FECG) can be obtained from the maternal abdominal ECG signal (AECG), and the fetal heart rate (FHR) can be extracted, which shows the heart state of the fetus. Figure 10 shows the position of the leads in the 8-channel maternal ECG signal processing system. The ECG signal of the mother's chest is obtained from the chest leads, while the ECG signal of the abdomen is obtained from the abdominal leads. In this section, we use the following two methods to extract the fetal heart rate: independent component analysis (ICA) and adaptive filtering.
Figure 10 The location of the leads in the 8-channel maternal ECG signal processing system (including 5 abdominal leads and 3 chest leads)
[page]
1. ICA method
The ICA method is used to reconstruct independent implicit signals from multi-channel observations. Assuming that the observation X is the superposition of the source signal S, it can be written as:
X = AS
Where A represents the mixing matrix. The statistical independence assumption of the signal S allows you to estimate two unknown quantities S and A from the observation X. Here, the ECG signal of the pregnant woman and the ECG signal of the fetus can be regarded as independent components, that is, part of S, and the ECG signal measurement records of 8 channels constitute X. Through the ICA method, it is possible to obtain an estimate of S, which means that you can obtain the ECG signals of the pregnant woman and the fetus.
The ASPT toolbox provides TSA Independent Component Analysis VI, which allows users to easily build an FHR extraction application, as shown in Figure 11. In Figure 11, the 8-channel ECG signal (obtained from the 8-channel system mentioned above) is the input of the ICA function, and the fetal ECG signal can be obtained at the output as part of the independent component. Figure 12 shows the ECG signal of the pregnant woman's abdomen and the ECG signal of the fetus extracted by ICA. From the ECG signal of the fetus, you can find that the ECG signal of the pregnant woman is effectively suppressed, so that the FHR can be accurately and conveniently obtained.
Figure 11 ICA method for fetal heart rate extraction
Figure 12 FHR extraction using ICA
2. Adaptive filtering method
An adaptive filter is a filter that can adjust its coefficients to optimize a specific performance indicator. Adaptive filters are widely used in various industries, one of which is adaptive noise cancellation, as shown in Figure 13.
Figure 13 Adaptive noise cancellation structure
In this example, the purpose of the adaptive filter is to minimize the difference between the reference signal and the noisy signal, and the coefficients of the filter are automatically adjusted according to this minimization process. The reference signal is the chest signal of the pregnant woman, the noisy signal is the abdominal signal of the pregnant woman, and the ECG signal of the fetus is the difference between the two. Figure 14 shows the LabVIEW implementation of this method.
Figure 14 Adaptive filter method for FHR extraction
As shown in Figure 15, an adaptive filter with appropriate order and step size can track and predict the ECG signal of a pregnant woman, and the ECG signal of the fetus is the prediction error.
Figure 15 FHR extraction using adaptive filter
3. Conclusion
LabVIEW and the associated signal processing toolbox can provide a robust and efficient environment and tools to solve ECG signal processing problems. This application note shows how to use these powerful tools to easily and quickly remove noise, analyze, and extract ECG signals in heart disease diagnosis and ECG signal processing research. At the same time, these tools can be used in other biomedical signal processing applications, such as magnetic resonance imaging (MRI) and electroencephalography (EEG).
Previous article:Design of Pulse Signal Detection System Based on LabVIEW
Next article:LabVIEW 1.0 Programming Environment (Graphics and Text)
Recommended ReadingLatest update time:2024-11-23 15:11
- Popular Resources
- Popular amplifiers
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Arduino Nano collects temperature and humidity data through LabVIEW and DHT11
- Modern Testing Technology and System Integration (Liu Junhua)
- Computer Control System Analysis, Design and Implementation Technology (Edited by Li Dongsheng, Zhu Wenxing, Gao Rui)
- New IsoVu™ Isolated Current Probes: Bringing a New Dimension to Current Measurements
- Modern manufacturing strategies drive continuous improvement in ICT online testing
- Methods for Correlation of Contact and Non-Contact Measurements
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Precautions for using DS1820
- You guys don't share the comparison pictures of software and hardware engineers. Let's talk about it.
- Hejian Gongsoft's New Year's greetings for 2022 - Spring brings blessings and everything is glorious
- How high can the transmission power of 5G mobile phones be?
- Wireless communication development trend part 1
- ESP32 uses littlefs v2 as the default file system
- Application of three-phase SPWM generator SA8282 in static inverter
- [2022 Digi-Key Innovation Design Competition] Unboxing of materials STM32F7508DK and WE inductors and other accessories
- Embedded Software Engineer Interview Experience Sharing
- EEWORLD University ---- TI Type C solution for mobile devices