JoVE Logo

Sign In

Acquisition and Analysis of an ECG (electrocardiography) Signal

Overview

Source: Peiman Shahbeigi-Roodposhti and Sina Shahbazmohamadi, Biomedical Engineering Department, University of Connecticut, Storrs, Connecticut

An electrocardiograph is a graph recorded by electric potential changes occurring between electrodes placed on a patient's torso to demonstrate cardiac activity. An ECG signal tracks heart rhythm and many cardiac diseases, such as poor blood flow to the heart and structural abnormalities. The action potential created by contractions of the heart wall spreads electrical currents from the heart throughout the body. The spreading electrical currents create different potentials at points in the body, which can be sensed by electrodes placed on the skin. The electrodes are biological transducers made of metals and salts. In practice, 10 electrodes are attached to different points on the body. There is a standard procedure for acquiring and analyzing ECG signals. A typical ECG wave of a healthy individual is as follows:

Figure 1
Figure 1. ECG wave.

The "P" wave corresponds to atrial contraction, and the "QRS" complex to the contraction of the ventricles. The "QRS' complex is much larger than the "P" wave due to the relative dfference in muscle mass of the atria and ventricles, which masks the relaxation of the atria. The relaxation of the ventricles can be seen in the form of the "T" wave.

There are three main leads responsible for measuring the electrical potential difference between arms and legs, as shown in Figure 2. In this demonstration, one of the limb leads, lead I, will be examined, and the electrical potential difference between two arms will be recorded. As in all ECG lead measurements, the electrode connected to the right leg is considered the ground node. An ECG signal will be acquired using a biopotential amplifier and then displayed using instrumentation software, where a gain control will be created to adjust its amplitude. Finally, the recorded ECG will be analyzed.

Figure 2
Figure 2. ECG limb leads.

Principles

The electrocardiograph must be able to detect not only extremely weak signals ranging from 0.5 mV to 5.0 mV, but also a DC component of up to ±300 mV (resulting from the electrode-skin contact) and a common-mode component of up to 1.5 V, which results from the potential between the electrodes and the ground. The useful bandwidth of an ECG signal depends on the application and can range from 0.5-100 Hz, sometimes reaching up to 1 kHz. It is generally around 1 mV peak-to-peak in the presence of much larger external high frequency noise, 50 or 60 Hz interference, and DC electrode offset potential. Other sources of noise include movement that affects the skin-electrode interface, muscle contractions or electromyographic spikes, respiration (which may be rhythmic or sporadic), electromagnetic interference (EMI), and noise from other electronic devices that couple into the input.

First, a biopotential amplifier will be produced to process the ECG. Then, electrodes will be placed on the the patient to measure the potential difference between two arms. The main function of a biopotential amplifier is to take a weak electric signal of biological origin and increase its amplitude so that it can be further processed, recorded, or displayed.

Figure 3
Figure 3. ECG amplifier.

To be useful biologically, all biopotential amplifiers must meet certain basic requirements:

  • They must have high input impedance so that they provide minimal loading of the signal being measured. Biopotential electrodes can be affected by their load, which leads to distortion of the signal.
  • The input circuit of a biopotential amplifier must also provide protection to the subject being studied. The amplifier should have isolation and protection circuitry so that the current through the electrode circuit can be kept at safe levels.
  • The output circuit drives the load, which is usually an indicating or recording device. To obtain maximal fidelity and range in the readout, the amplifier must have low output impedance and be capable of supplying the power required by the load.
  • Biopotential amplifiers must operate in the frequency spectrum in which the biopotentials that they amplify exist. Because of the low level of such signals, it is important to limit the bandwidth of the amplifier to obtain optimal signal to noise ratios. This can be done using filters.

Figure 3 is an example of an ECG amplifier, and Figure 4 is the circuit of the ECG amplifier that is built during this demonstration. It has three main stages: the protection circuit, the instrumentation amplifier, and the high pass filter.

Figure 4
Figure 4. Biopotential amplifier.

The first stage is the patient protection circuitry. A diode is a semiconductor device that conducts current in one direction. When a diode is forward-biased, the diode acts as a short circuit and conducts electricity. When a diode is reverse-biased, it acts as an open circuit and does not conduct electricity, Ir ≈ 0.

When diodes are in the forward-biased configuration there is a voltage known as the threshold voltage (VT = approximately 0.7 V) that must be exceeded in order for the diode to conduct current. Once the VT has been exceeded, the voltage drop across the diode will remain constant at VT regardless of what Vin is.

When the diode is reverse-biased the diode will act as on open circuit and the voltage drop across the diode will be equal to Vin.

Figure 5 is an example of a simple protection circuit based on diodes that will be used in this demonstration. The resistor is used to limit the current flowing through the patient. If a fault in the instrumentation amplifier or diodes short-circuits the patient's connection with one of the power rails, the current would be less than 0.11 mA. The FDH333 low-leakage diodes are used to protect the inputs of the instrumentation amplifier. Whenever the voltage in the circuit exceeds 0.8 V in magnitude, the diodes change to their active region or "ON" state; the current flows through them and protects both the patient and the electronic components.

Figure 6
Figure 5. Protection circuit.

The second stage is the instrumentation amplifier, IA, which uses three operational amplifiers (op-amp). There is one op-amp attached to each input to increase the input resistance. The third op-amp is a differential amplifier. This configuration has the ability to reject ground-referred interference and only amplify the difference between the input signals.

Figure 7
Figure 6. Instrumentation amplifier.

The third stage is the high pass filter, which is used to amplify a small AC voltage that rides on top of a large DC voltage. The ECG is affected by low frequency signals that come from patient movement and respiration. A high pass filter reduces this noise.

High pass filters can be realized with first-order RC circuits. Figure 7 shows an example of a first order high-pass filter and its transfer function. The cut-off frequency is given by the following formula:

Equation 1Equation 2
Equation 3  Figure 8
Figure 9

Figure 7. High pass filter.

Procedure

1. Acquiring an ECG Signal

  1. Adjust the voltage of the sources to +5 V and -5 V and connect them in series.
  2. Build the circuit shown in Figure 4. Calculate the values of the resistors and capacitors. For the high pass filter, the cut-off frequency should be 0.5 Hz. The capacitor value should be chosen from the table below (according to availability).
Available Capacitor Values (µF )
0.001 1 100
0.022 2.2 220
0.047 4.7 470
0.01 10 1000
0.1 47 2200

Equation 4

  1. Place electrodes on the right arm, left arm and right leg (this is reference) of the patient, and connect them to the circuit.
  2. Use the oscilloscope to view the ECG signal (Vo). Press Auto Set and adjust the horizontal and vertical scales as needed. You should be able to see the R peaks despite of the noise in the signal.

2. Displaying the ECG signal using Instrumention Software

  1. In this demonstration we used LabVIEW. Write a program that displays the ECG signal using a graphical interface for configuring measurements and a waveform graph. Once an analog input has been selected, configure the program with the following settings:
  • Signal input range >> Max = 0.5; Min = -0.5
  • Terminal Configuration >> RSE
  • Acquisition mode >> continuous
  • Samples to read = 2000
  • Sampling rate = 1000
  1. Acquire the ECG signal and observe the waveform. You will see a signal similar to Figure 1.
  2. Adjust the scale of the x-axis to show time in seconds.
  3. It is often necessary in instrumentation to amplify the signal of interest to a specific amplitude. Create a gain control and set it so that the amplitude of the ECG is 2 Vp.

3. Analyzing the ECG signal

In this section, an ECG signal will be filtered and analyzed to determine the heart rate. The following block diagram shows the components of the program.
Figure 10

  1. Use a waveform graph to display the signal.
  2. Evaluate the spectrum of the signal using the Amplitude and phase spectrum subvi (in Signal processing → Spectral) and display its magnitude using a waveform graph. The horizontal axis corresponds to frequency. It is discrete because the computer uses a Fast Fourier Transform (FFT) algorithm to calculate the spectrum of the signal. The frequency goes from k = 0 to k = (N-1)/2, where N is the length of the sequence, in this case 4000. To calculate the corresponding analog frequency, use the following formula:
    Equation 5
    where fs is the sampling frequency. Note that most of the energy of the signal is in the low frequency range and also that there is a peak of high intensity in the medium frequency range. Calculate the frequency of that peak using the formula provided above.
  3. Implement a low-pass filter using Butterworth of Chebyshev functions. Choose a cut-off frequency equal to 100 Hz. Make sure that the filter provides an attenuation of at least -60 dB/decade in the stopband.
  4. Connect the output signal of the read from spreadsheet subvi to the input of the low-pass filter.
  5. Implement a stop-band filter using Butterworth or Chebyshev functions. The objective is to reduce the 60 Hz interference without modifying the other frequencies. Try border frequencies close to 60 Hz.
  6. Connect the output of the lowpass filter to the input of the stopband filter.
  7. Find the peaks using the peak detector subvi (it is located in Signal processing → Sig Operation). For the threshold, look at the signal's amplitude and choose the most appropriate value.
  8. Extract the locations of the peaks using the index array subvi (in Programming → Array).
  9. Subtract the lower position from higher position, then, multiply by the sampling period T = 1/fs to obtain the RR interval.
  10. Calculate the reciprocal and adjust units and place an indicator to display the 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.

Application 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.
Tags
ECGElectrocardiographyCardiac ActivityHeart FunctionDisease DiagnosisAbnormalities DetectionElectrical SignalsElectrodesNon invasiveBlood Flow MeasurementBiopotential AmplifierBiomedical ApplicationsElectrical Signal ProcessingSinoatrial NodeSA NodePacemakerAtrial ContractionVentricles

Skip to...

0:07

Overview

1:12

Principles of Electrocardiography

4:07

Building a Biopotential Amplifier and Acquiring an ECG Signal

6:26

Filtering an ECG Signal

8:48

Results

9:40

Applications

10:45

Summary

JoVE Logo

Privacy

Terms of Use

Policies

Research

Education

ABOUT JoVE

Copyright © 2024 MyJoVE Corporation. All rights reserved