JoVE Science Education
Biomedical Engineering
This content is Free Access.
JoVE Science Education Biomedical Engineering
Acquisition and Analysis of an ECG (electrocardiography) Signal
  • 00:07Overview
  • 01:12Principles of Electrocardiography
  • 04:07Building a Biopotential Amplifier and Acquiring an ECG Signal
  • 06:26Filtering an ECG Signal
  • 08:48Results
  • 09:40Applications
  • 10:45Summary

心电图(心电图)信号的采集与分析

English

Share

Overview

资料来源:佩曼·沙贝吉-鲁德波什蒂和西娜·沙赫巴兹莫哈马迪,康涅狄格大学生物医学工程系,康涅狄格州斯托尔斯

心电图是记录患者躯干电极之间发生电势变化以显示心脏活动的图形。心电图信号跟踪心脏节律和许多心脏疾病,如血液流向心脏和结构异常。心脏壁收缩产生的作用潜能会将来自心脏的电流扩散到全身。扩散电流在身体各点产生不同的电位,这些电位可以通过放置在皮肤上的电极来感应。电极是金属和盐制成的生物传感器。实际上,10个电极连接到身体上的不同点。有一个标准程序来获取和分析心电图信号。健康个体的典型心电图波如下:

Figure 1
图 1.心电图波。

“P”波对应于心房收缩,而”QRS”复杂对应于心室收缩。”QRS”复合体比”P”波大得多,因为心肌质量相对发泡,掩盖了心房的放松。心室的松弛可以以”T”波的形式看到。

有三个主要引线负责测量手臂和腿之间的电势差,如图 2 所示。在此演示中,将检查其中一条肢体引线,引线 I,并记录两个臂之间的电势差。与所有 ECG 引线测量一样,连接到右腿的电极被视为接地节点。将使用生物电位放大器采集ECG信号,然后使用仪器软件显示,其中将创建增益控制以调整其振幅。最后,对记录的ECG进行分析。

Figure 2
图 2.心电图肢体引线。

Principles

心电图必须不仅能够检测 0.5 mV 到 5.0 mV 的极弱信号,而且检测出高达 ±300 mV 的直流分量(由电极-皮肤接触引起),以及高达 1.5 V 的共模分量,这是电位产生的电极和接地之间。ECG 信号的有用带宽取决于应用,范围为 0.5-100 Hz,有时可达 1 kHz。在外部高频噪声、50 或 60 Hz 干扰和直流电极偏移电位较大的情况下,一般在 1 mV 峰峰值附近。其他噪声源包括影响皮肤电极界面的运动、肌肉收缩或肌电图尖峰、呼吸(可能是有节奏或零星的)、电磁干扰 (EMI) 以及其他电子设备的噪音夫妇进入输入。

首先,将生产一个生物电位放大器来处理心电图。然后,电极将放置在患者身上,以测量两只手臂之间的电位差。生物电位放大器的主要功能是接收生物源的弱电信号,增加其振幅,以便进一步处理、记录或显示。

Figure 3
图 3.ECG放大器。

为了在生物学上有用,所有生物电位放大器必须满足某些基本要求:

  • 它们必须具有高输入阻抗,以便它们提供被测信号的最小负载。生物电位电极可能受其负载影响,从而导致信号失真。
  • 生物电位放大器的输入电路还必须为所研究的受试者提供保护。放大器应具有隔离和保护电路,以便通过电极电路的电流保持在安全水平。
  • 输出电路驱动负载,通常是指示或记录设备。为了在读出中获得最大的保真度和范围,放大器必须具有低输出阻抗,并能够提供负载所需的功率。
  • 生物电位放大器必须在其放大的生物电位存在的频谱中工作。由于此类信号的水平低,因此限制放大器的带宽以获得最佳信号到噪声比非常重要。 这可以使用筛选器来完成。

图 3 是 ECG 放大器的示例,图 4 是在此演示期间构建的 ECG 放大器电路。它有三个主要阶段:保护电路、仪表放大器和高通滤波器。

Figure 4
图 4.生物电位放大器。

第一阶段是患者保护电路。二极管是一种半导体器件,它向一个方向传导电流。当二极管向前偏置时,二极管充当短路并导电。当二极管反向偏置时,它充当开路不导电,ir = 0。

当二极管处于正向偏置配置中时,必须超过一种称为阈值电压(VT = 约 0.7 V)的电压,以便二极管传导电流。一旦超过 VT,无论V in 是什么,二极管上的压降都将在 VT 处保持不变。

当二极管反向偏置时,二极管将充当开路,并且二极管上的电压降将等于V in。

图 5 是一个基于此演示中使用的二极管的简单保护电路的示例。电阻器用于限制流经患者的电流。如果仪表放大器或二极管中的故障使患者与其中一个电源轨的连接短路,则电流将小于 0.11 mA。FDH333 低漏二极管用于保护仪表放大器的输入。当电路中的电压超过0.8 V的幅度时,二极管将改变其活动区域或”ON”状态;电流流经它们,保护患者和电子元件。

Figure 6
图 5.保护电路。

第二阶段是仪表放大器 IA,它使用三个运算放大器(运算放大器)。每个输入都附带一个运算放大器,以增加输入电阻。第三个运算放大器是差分放大器。此配置能够抑制接地参考的干扰,并且仅放大输入信号之间的差异。

Figure 7
图 6.仪表放大器。

第三阶段是高通滤波器,用于放大在大直流电压之上的小交流电压。心电图受来自患者运动和呼吸的低频信号的影响。高通滤波器可降低此噪声。

高通滤波器可以通过一阶RC电路实现。图 7 显示了一阶高通滤波器及其传输函数的示例。截止频率由以下公式给出:

Equation 1,Equation 2
Equation 3  Figure 8
Figure 9

图 7.高通滤波器。

Procedure

1. 获取心电图信号 将电源的电压调整到 +5 V 和 -5 V,并串联连接。 构建如图 4所示的电路。计算电阻和电容器的值。对于高通滤波器,截止频率应为 0.5 Hz。电容器值应从下表中选择(根据可用性)。 可用电容器值 (μF ) 0.001 1 100 0.022 2.2 220 0.047 4.7 470 0.01 10 1000 0.1 47 2200 将电极放在患者的右臂、左臂和右腿(这是参考)上,并将其连接到电路。 使用示波器查看心电图信号 (Vo)。按”自动设置”并根据需要调整水平和垂直比例。您应该能够看到 R 峰值,尽管信号中有噪声。 2. 使用仪器软件显示心电图信号 在本演示中,我们使用 LabVIEW。编写一个程序,使用图形界面显示ECG信号,用于配置测量和波形图。选择模拟输入后,使用以下设置配置程序: 信号输入范围 >> 最大值 = 0.5;最小值 = -0.5 终端配置 >> RSE 采集模式 >> 连续 要阅读的样品 = 2000 采样率 = 1000 获取 ECG 信号并观察波形。您将看到类似于图 1的信号。 调整 x 轴的比例以显示时间(以秒为单位)。 仪器中通常有必要将感兴趣的信号放大到特定的振幅。创建增益控制并将其设置为 ECG 的振幅为 2 Vp。 3. 分析心电图信号 在本节中,将过滤和分析心电图信号以确定心率。下面的框图显示了程序的组件。 使用波形图显示信号。 使用振幅和相位谱子vi(在信号处理和光谱中)评估信号的频谱,并使用波形图显示其幅度。水平轴对应于频率。它是离散的,因为计算机使用快速傅立叶变换 (FFT) 算法来计算信号的频谱。频率从 k = 0 到 k = (N-1)/2,其中 N 是序列的长度,在本例中为 4000。要计算相应的模拟频率,请使用以下公式:其中fs是采样频率。请注意,信号的大部分能量在低频范围内,并且在中频范围内存在高强度的峰值。使用上面提供的公式计算该峰值的频率。 使用切比舍夫函数的巴特沃斯实现低通滤波器。选择等于100赫兹的截止频率。确保滤波器在停止带中提供至少-60分贝/十年的衰减。 将从电子表格subvi 读取的输出信号连接到低通滤波器的输入。 使用巴特沃斯或切比舍夫函数实现停止带滤波器。目标是在不修改其他频率的情况下减少 60 Hz 干扰。尝试接近 60 Hz 的边框频率。 将低通滤波器的输出连接到止止区滤波器的输入。 使用峰值检测器子vi 查找峰值(位于信号处理和 Sig 操作中)。对于阈值,查看信号的振幅并选择最合适的值。 使用索引数组子维(在编程 + 数组中)提取峰值的位置。 从较高位置减去较低的位置,然后乘以采样周期 T = 1/fs 以获得 RR 间隔。 计算倒数和调整单位,并放置一个指标来显示 BPM。

Results

In this demonstration, three electrodes were connected to an individual, and the output passed through a biopotential amplifier. A sample ECG graph prior to digital filtering is shown below (Figure 8).

Figure 13
Figure 8. ECG signal without digital filtering.

After designing the filters and feeding the data to the developed algorithm, the peaks on the graph were detected and used to calculate heart beat rate (BPM). Figure 9 displays the raw data an ECG signal (before any filtering) in time and frequency domain. Figure 10 shows the result of filtering that signal.

Figure 11

Figure 9. ECG signal before filtering.

Figure 14
Figure 10. Filtered ECG signal.

The original ECG plot had slightly visible P, QRS, and T complexes that presented many fluctuations from the noise. The spectrum of the ECG signal also showed a clear spike at 65 Hz, which was assumed to be noise. When the signal was processed using a low-pass filter to remove extraneous high frequency portions and then a band-stop filter to remove the 65 Hz signal component, the output appeared significantly cleaner. The ECG shows each component of the signal clearly with all noise removed.

In addition, the measured heart rate was approximately 61.8609 beats per minute.

Applications and Summary

Contraction of cardiac muscle during the heart cycle produces electric currents within the thorax. Voltage drops across resistive tissue are detected by electrodes placed on the skin and recorded by an electrocardiograph. Since the voltage is weak, in the range of 0.5 mV, and small compared to the magnitude of noise, processing and filtering the signal is necessary. In this experiment, an electrocardiograph device consisting of a two part analog and digital signal processing circuit was designed to analyzing the resulting ECG signal, and calculate the heartbeat rate.

This demonstration introduced the fundamentals of electronic circuitry and filtering of ECG signals. Here, practical signal processing techniques were used to extract a weak signal from a noisy background. These techniques can be used in other similar applications where signal amplification and noise reduction is required.

Materials List

Name Company Catalog Number Comments
Equipment
Power supply B&K Precision 1760A
Multimeter
Oscilloscope
Proto-board
4 FDH333 diodes
1 AD620
3 47k resistor
2 100nF capacitors
3 ECG electrodes
Several alligator clips and Tektronix probe.

Transcript

Electrocardiographs record cardiac activity of the heart and are used to diagnose disease, detect abnormalities, and learn about overall heart function. Electrical signals are produced by contractions in the heart walls which drive electrical currents and create different potentials throughout the body. By placing electrodes on the skin, one can detect and record this electrical activity in an ECG. ECGs are non-invasive, making them a useful tool to assess how well a patients heart is performing, such as by measuring how well blood flows to the organ.

This video will illustrate the principals of ECGs and demonstrate how to acquire, process, and analyze a typical ECG signal using a biopotential amplifier. Other biomedical applications that utilize electrical signal processing to diagnose disease will also be discussed.

To understand the principles of an ECG, let’s first understand how the heart produces electrical signals. For a normal, healthy heart, at rest, an ECG displays a series of waves that reflect the different phases of a heartbeat. The ECG starts in the sinoatrial node, also known as the SA node, which is located in the right atrium and acts as a pacemaker in the heart. The electrical signals cause atrial contraction forcing blood into the ventricles. This sequence is recorded as the P wave on the ECG. This signal then passes from the atria across the ventricles, causing them to contract and pump blood to the rest of the body. This is recorded as the QRS complex.

Finally, the ventricles relax and this is recorded as the T wave. The process then begins again and is repeated for every heartbeat. Notice that the QRS wave is much larger than the P wave, this is because the ventricles are larger than the atria. Meaning they mask the relaxation of the atria or the T wave. Other processes in the body, like respiration or muscle contractions, can interfere with the ECG measurement. As can currents from the circuitry used to obtain them. Often, the electrical signals that the ECG is attempting to record are quite weak. Therefor, a biopotential amplifier is used to increase their amplitude which allows them to be further processed and recorded.

There are three main components to the biopotential amplifier, the patient protection stage, the instrumentation amplifier, and the high pass filter. As the main suggests, the patient protection circuit uses a combination of resistors and diodes to protect, both, the patient and the machine and equipment. The resistors limit the current that flows through the patient, where as the diodes keep the current flowing in the correct direction.

The next stage is the instrumentation amplifier, which amplifies the difference between the inputs from each electrode. It is composed of three operational amplifiers. Two to increase the resistance from each input, and the third to amplify the difference between the input signals.

The last stage is the high pass filter, which reduces the noise and filters out low frequency signals arising from patient movement or respiration. Now that you know how an ECG is measured, let’s see how to construct a biopotential amplifier and process the data to get a clean ECG signal.

Having reviewed the main principals of electrocardiography, let’s see how to build a biopotential amplifier and acquire an ECG signal. To begin, first gather a proto-board, an AD-620 instrumentation amplifier, and all necessary circuit components. Then, calculate the values of all of the resistors and capacitors in the circuit using the following equation.

For the high pass filter, the cut off frequency should be 0.5 hertz.

Then, plug in the capacitor value to determine the resistance. Next, build a biopotential amplifier according to the provided diagram. Here is what the final circuit should look like. Attach three wires with alligator clips to the binding posts of a DC power supply, then turn on the power source. Adjust the voltage to plus five volts and minus five volts, and connect the the wires, in series, to the circuit.

Now, use an alcohol prep pad to wipe the patients right wrist, left wrist, and right ankle. Add conductive adhesive gel to the electrodes before placing them on the patient. Then, connect the electrodes to the circuit using wires with alligator clips. Turn on the oscilloscope and acquire the ECG signal. Adjust the horizontal and vertical scales as needed. With these adjustments, you should be able to see the R peak of the wave form.

Connect the circuit to the PXI chassis, then open the instrumentation software and, either, use or write a program that will display the ECG signal and a wave form graph.

Configure the data acquisition interface with the following settings. Label the scale of the x-axis to display time and seconds, then display the ECG signal as a waveform. If the signal needs to be amplified, create a gain control and set it so that the amplitude of the ECG is two VP.

Now that we have demonstrated how to acquire an ECG signal, let’s see how to analyze the results. Here is a representative ECG signal. The P, QRS, and T waves are barely discernible because they are obscured by noise and fluctuations. This signal needs to be filtered. To transform this signal, first, select Signal Processing then Spectral on the menu. A Fast Fourier Transform algorithm calculates and plots the spectrum of the signal displaying the frequency as discreet values on the horizontal axis. Most of the energy in the signal is at low frequencies.

But, there is a high intensity peak in the medium frequency range, which is assumed to be noise. Frequency is plotted as k on the horizontal axis and goes from zero to N minus one over two, where N is the length of the sequence. For this experiment, N equals 2,000. Calculate the analog frequency for each k value using the following equation, where f s is the sampling frequency and determine the frequency of the high intensity peak based on the FFT graph.

Then, create a low pass filter with a cutoff frequency of 100 hertz. Use, either, the Butterworth or Chebyshev function to filter the signal, which should attenuate at least 60 decibels per decade in the stop band. Connect the output signal of the data sub VI to the input of the low pass filter. This filter removes the extraneous high frequency waves of the ECG. Now, create a Bandstop filter and set the cutoff frequencies at around 55 and 70 hertz.

To remove the noisy signal, around 60 hertz. Then, connect the output of the low pass filter to the input of the Bandstop filter. Try border frequencies that are close to 60 hertz. This will reduce interference without effecting other frequencies. The ECG signal should now be clear with distinct P, QRS, and T complexes.

Now, let’s determine the heart rate using the filtered ECG signal. First, use the peak detector sub VI to find the peaks of the signal. Choose the most appropriate value based on the signals amplitude of the R wave for the threshold. Then, use the Index Array sub VI to determine the location of the peaks.

Subtract the lower peak position from the higher position, then multiply this value by the sampling period, T, which is equal to one over f s. This value is the length of time between two R waves. Adjust the units to determine the beats per minute.

In this demonstration, the measured heart rate was approximately 60 beats per minute.

ECG and signal processing have important applications in, both, medicine and research. In addition to being non-invasive, ECGs are relatively inexpensive. Making it a useful and accessible tool in hospitals. ECGs can even be adapted to more complex and longterm monitoring of patients who are being treated for Acute Coronary Syndrome.

For this, 12 ECG leads are used, which can identify transient myocardial ischemia in asymptomatic patients. Signal sampling and processing is also used in electroencephalography to measure electrical signals from the brain. EEGs are commonly used in conjunction with functional MRI as a multimodal imaging technique.

The method noninvasively generates cortical maps of brain activity for many neuroimaging applications, such as after visual or motor activation.

You’ve just watched Jove’s introduction to acquiring and analyzing ECG signals. You should now understand how an ECG signal is produced and how to create a biopotential amplifier to detect weak electrical signals. You have also seen some biomedical applications of signal processing for medical diagnosis.

Thanks for watching.

Tags

Cite This
JoVE Science Education Database. JoVE Science Education. Acquisition and Analysis of an ECG (electrocardiography) Signal. JoVE, Cambridge, MA, (2023).