Design of ECG signal acquisition and analysis based on LabVIEW

Publisher:喜茶我要七分糖Latest update time:2010-06-11 Source: 创e时代Keywords:LabVIEW Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction

Biomedical electrical signals, such as ECG signals, blood pressure signals, and EEG signals, all represent certain pathological characteristics. Taking ECG as an example, ECG is usually used to record the bioelectric current generated by the heart. Clinicians can use ECG to evaluate the patient's heart condition and make further diagnoses. For some home or medical instrument manufacturers, it is necessary to develop specific signal processing algorithms and deploy them on embedded processors to complete the extraction of medical electrical characteristics. Usually, the development process of a complete set of ECG monitoring products consists of ECG data acquisition, ECG signal analysis, human-computer display, file storage, etc. Through the graphical system design platform provided by NI, a series of product development processes such as data acquisition, signal reading, ECG analysis, and report generation can be covered to complete the development of the entire system and improve development efficiency. In the entire development process, the signal analysis part is often the focus and the core technology of each manufacturer's software. This article will focus on ECG acquisition and analysis, and introduce how to efficiently realize the acquisition and analysis algorithm development of ECG signals through LabVIEW.

Design of ECG signal acquisition and analysis based on LabVIEW


Figure 1 Typical single-cycle ECG waveform

Data collection of ECG signals

Generally speaking, ECG signals are sensed by several electrodes (leads) to sense bioelectric currents, and the analog electrical signals generated by the leads are converted into digital signals through data acquisition equipment for computer analysis. The analog signals generated by the leads are often weak, with an amplitude of about mV, and need to be collected by dynamic signal acquisition equipment or after pre-amplification. Whether it is an independent ECG lead or an integrated medical ECG device, data can be collected through NI devices.

Through more than 30 years of development, National Instruments (NI) has established a leading position in the field of test and measurement. From portable USB devices to high-precision PXIe synchronous sampling devices, it can achieve resolutions from 8 to 24 bits and sampling rates from 48kHz to 2GHz. At the same time, NI devices take into account various error values ​​such as gain error, offset error, and uncertain noise, and provide absolute accuracy values ​​to ensure the accuracy of the final measurement. Generally speaking, the frequency of ECG signals is around a few hundred hertz, and can be sampled at a sampling rate of about 1k to 5k. In addition, depending on the accuracy of the application, a sampling accuracy of 14 to 16 bits can be selected. Basically, any data acquisition device on NI's platform can meet the sampling requirements of ECG. You can choose the right device according to the application, such as USB data acquisition in portable devices and wireless acquisition in telemedicine applications.

Design of ECG signal acquisition and analysis based on LabVIEW
Figure 2 NI data acquisition solution from USB to wireless

Regardless of the NI hardware platform used, development can be achieved through the same programming platform - NI graphical programming software LabVIEW. Since its birth in 1986, the LabVIEW graphical development platform has been committed to simplifying the complexity of programming. In all fields involving data acquisition and control, LabVIEW graphical programming has become a standard development tool. For the development team of medical electronic equipment, LabVIEW provides a shortcut to introduce hardware I/O into algorithm design, seamlessly combining all aspects of the process from data acquisition, algorithm analysis, data storage, and human-computer interaction. At the same time, different NI hardware can be released to different commercial and embedded platforms through code reuse, simplifying the complexity of building prototype systems.

Through LabVIEW and NI acquisition equipment, ECG signals can be quickly collected and displayed. Figure 1 shows a typical ECG waveform cycle. Of course, in the process, the ECG signal will be contaminated by noise and artificially introduced artifacts. These noises and artifacts are within 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 3). 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.

Design of ECG signal acquisition and analysis based on LabVIEW
Figure 3 Typical ECG signal processing flow chart

Through the signal processing functions in LabVIEW, users can easily create signal processing applications for the two stages, including eliminating baseline drift, removing noise, QRS complex wave detection, fetal heart rate detection, etc.

Next, we will focus on the typical ECG signal processing methods using LabVIEW.

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

• Electromyography (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, power line interference can be eliminated by ECG signal acquisition hardware or by software notch filters. However, reference drift and other broadband noise are difficult to suppress by hardware devices. Software design has become a more powerful and feasible method for ECG signal processing. 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

LabVIEW graphical and interactive methods can be used to efficiently design and implement finite impulse response (FIR) or infinite impulse response (IIR) filters. For example, users can use the Classical Filter Design Express VI to design a Kaiser window FIR high-pass filter to eliminate reference drift. Figure 4 shows an example of using a high-pass filter to eliminate reference drift.

Design of ECG signal acquisition and analysis based on LabVIEW
Figure 4. Design and use of a high-pass filter to eliminate reference drift.

[page]

2. Wavelet transform method

In addition to digital filters, wavelet transform is also an effective method to eliminate signals within a specified frequency band. LabVIEW Advanced Signal Processing Toolkit provides a wavelet detrend function that can eliminate the low-frequency trend of the signal. Figure 5 shows an example of a program that uses wavelet to eliminate baseline drift.

Design of ECG signal acquisition and analysis based on LabVIEW
Figure 5 Using WA Detrend VI to eliminate baseline drift

The example uses the Daubechies6 (db06) wavelet because it is similar to the actual ECG signal.

Figure 6 shows the original ECG signal, the ECG signal obtained by digital filtering and wavelet transform. It can be seen that the processed ECG signal contains almost no baseline drift information while maintaining the main characteristics of the original ECG signal. It can also be noted that the wavelet transform-based method is more advantageous because it does not introduce delay and has less distortion than the digital filter method.

Design of ECG signal acquisition and analysis based on LabVIEW
Figure 6 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 often complex random processes with wide bandwidths, so traditional digital filters cannot be used, but the Wavelet Denoise function in LabVIEW can be used.

The ECG signal is decomposed into sub-bands through wavelet transform, and then the wavelet coefficients are adjusted using threshold or shrinkage functions to reconstruct the signal after noise elimination. The figure below shows that through the undecimated wavelet transform (UWT) in LabVIEW, broadband noise is greatly suppressed while the details of the ECG signal remain unchanged.

Design of ECG signal acquisition and analysis based on LabVIEW
Figure 7 ECG signal before and after UWT wavelet denoising

Feature extraction of ECG signals

For diagnosis, various features need to be extracted from the preprocessed ECG data, including QRS wave interval, QRS wave amplitude, PR interval, ST interval, fetal heart rate, etc. Here, QRS complex wave detection is taken as an example.

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 Multiscale Peak Detection function in the LabVIEW Advanced Signal Processing Toolkit 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 the Multiresolution Analysis Express function, and then the signal is reconstructed using the D4 and D5 subbands. The reason why the 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.

Design of ECG signal acquisition and analysis based on LabVIEW
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, it can be found that the peaks and troughs (especially the Q and S points) become more obvious after wavelet multi-resolution analysis.

Design of ECG signal acquisition and analysis based on LabVIEW
Figure 9 Original ECG signal, ECG signal after MSA, and ECG signal after peak/trough detection

[page]

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.

LabVIEW Biomedical Electronics Starter Kit

The above introduction shows that various customized ECG analysis algorithms can be implemented through the powerful signal processing functions in LabVIEW. This article only introduces the implementation of some relatively mature and effective algorithms in LabVIEW, and uses this to illustrate the processing flow of ECG signals.

In addition to self-development using LabVIEW, NI also provides the latest biomedical electronics starter kit, which has integrated ECG feature extraction algorithms and human-computer interaction interfaces. See Figure 10. The toolkit not only supports the NI data acquisition platform to collect clinical ECG signals, but also supports file format reading of different professional databases such as MIT-BIH; in addition, in addition to the built-in wavelet analysis of QRS wave, P wave and T wave detection, it also opens source and supports user-defined algorithms; finally, the results of ECG feature extraction can be exported to TDMS files. If further analysis of the signal is required, such as heart rate variability analysis (HRV), the medical electronics toolkit also provides ready-made functions for users to call directly, see Figure 11.

In addition, LabVIEW and the Biomedical Electronics Toolkit can also be used in other biomedical signal processing fields, such as electroencephalogram (EEG), electromyography (EMG), and magnetic resonance imaging (MRI) 3D imaging.

Design of ECG signal acquisition and analysis based on LabVIEW
Figure 10 ECG feature extraction function provided by LabVIEW Biomedical Electronics Toolkit

Design of ECG signal acquisition and analysis based on LabVIEW
Figure 11 Heart rate variability analysis provided by LabVIEW Biomedical Electronics Toolkit

Summarize

LabVIEW and the Biomedical Electrophysiology Toolkit can provide a robust and efficient environment and tools to solve ECG signal processing problems. Through the ready-made analysis algorithms in the toolkit, or through LabVIEW graphical programming to implement custom algorithms, users can easily and quickly develop in heart disease diagnosis and ECG signal research, including noise elimination, analysis and extraction of ECG signals, etc.

Keywords:LabVIEW Reference address:Design of ECG signal acquisition and analysis based on LabVIEW

Previous article:Application of CB3LP chip in temperature control system
Next article:Application cases of embedded intelligent platform in medical instrument industry

Recommended ReadingLatest update time:2024-11-16 16:45

Design and development of medical electronic products based on LabVIEW graphical development platform
LinkedIn's investment in the medical equipment industry has been on the rise in recent years. In the past two years, venture capital investment in medical equipment has almost doubled, reaching US$4 billion in 2007. Whether from a global perspective or in the Chinese market, small, unlisted medical equipment manufactu
[Test Measurement]
Labview string and file I/O
String A string is a collection of ASCII characters. It is very useful when users communicate with GPIB and serial devices, read and write text files, and transmit text information. Some characters in a string are displayable, while others are not. LabVIEW provides a complete set of string processing functions in th
[Test Measurement]
Labview string and file I/O
LabVIEW Helps Optimize Software Development Practices and Source Code Control
As a system design software, LabVIEW can provide all the engineering elements needed to build the most advanced and technically challenging systems. As engineering applications become more challenging and complex, the concept of software engineering has been incorporated into system development. Software engine
[Industrial Control]
LabVIEW Helps Optimize Software Development Practices and Source Code Control
300PLCmpi to Ethernet communicates with LABVIEW OPC via CHNet-S7300
Xingda Easy Control MPI to Ethernet Module MPI-ETH-XD1.0 connects to Siemens S7-300 Connect via NI OPC Servers (1) Edit OPC 1. Open the NI OPC Servers software. 2. Create a new Channel, name it "Channel_300", and click "Next". 3. Select "Siemens TCP/IP Ethernet " in "Device driv
[Embedded]
300PLCmpi to Ethernet communicates with LABVIEW OPC via CHNet-S7300
LabVIEW connector pane
  If you want to call a VI as a subVI from another VI, you need to create a connector pane. The connector pane is used to display the terminals of all input controls and indicators in the VI. It gathers the terminals of the VI and corresponds to the controls on the VI front panel, similar to the parameter list used whe
[Test Measurement]
LabVIEW connector pane
Design of the test system for automobile engine management module
        As the core component of automobile transmission power control, the production quality inspection of the engine management module is an important step to ensure the integrity of the entire product production process. In order to simulate the specific actual working conditions of the engine, it is necessary to r
[Test Measurement]
Design of the test system for automobile engine management module
LABVIEW Nugget realizes full screen display of front panel window 
The front panel window of Labview Nugget we are talking about actually refers to the window client area, excluding the title bar, menu bar, and toolbar. See the figure below, which is actually the pane part. To achieve full screen display of the front panel window of LABVIEW Nugget , first obtain the current re
[Test Measurement]
LABVIEW Nugget realizes full screen display of front panel window 
Designing a Semi-Autonomous Vehicle for the Visually Impaired Using LabVIEW
The Challenge: Developing semi-autonomous vehicles allows blind drivers to successfully maneuver, control speed, and avoid collisions while driving safely. TheSolution: Developed the world's first functional prototype of a vehicle for the blind using NI CompactRIO and LabVIEW software.
[Test Measurement]
Designing a Semi-Autonomous Vehicle for the Visually Impaired Using LabVIEW
Latest Medical Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号