Introduction: ECG Signal Modeling in LTspice

An ECG is a very common method to measure electrical signals that occur in the heart. The general idea of this procedure is to find heart problems, such as arrhythmias, coronary artery disease, or heart attacks. It may be necessary if the patient is experiencing symptoms like chest pain, difficulty breathing, or uneven heartbeats called palpitations, but can also be used to ensure that pacemakers and other implantable devices are functioning properly. Data from the World Health Organization shows that cardiovascular-related diseases are the largest causes of death globally; these illnesses kill approximately 18 million people each year. Therefore, devices that can monitor or discover these diseases are incredibly important, which is why the ECG was developed. The ECG is a completely non-invasive medical test that poses no risk to the patient, except for some minor discomfort when the electrodes are removed.

The full device outlined in this instructable will consist of several components to manipulate the noisy ECG signal so that optimal results can be obtained. ECG recordings occur at typically low voltages, so these signals should be amplified before analysis can occur, in this case with an instrumentation amplifier. Also, noise is very prominent in ECG recordings, so filtering must occur to clean these signals. This interference can come from a variety of places, so different approaches need to be taken to remove specific noises. Physiological signals only occur at a typical range, so a bandpass filter is used to remove any frequencies outside of this range. A common noise in an ECG signal is called power line interference, which occurs at approximately 60 Hz and is removed with a notch filter. These three components work concurrently to clean an ECG signal and allow for easier interpretation and diagnoses and will be modeled in LTspice to test their efficacy.

Step 1: Building the Instrumentation Amplifier (INA)

The first component of the full device was an instrumentation amplifier (INA), which can measure small signals found in noisy environments. In this case, an INA was made with a high gain (around 1,000) to allow for optimal results. A schematic of the INA with its respective resistor values is shown. The gain of this INA can be calculated theoretically to confirm that the setup was valid and that the resistor values were appropriate. Equation (1) shows the equation used to calculate that the theoretical gain was 1,000, where R1 = R3, R4 = R5, and R6 = R7.

Equation (1): Gain = (1 + (2R1 / R2)) * (R6 / R4)

Step 2: Building the Bandpass Filter

A main source of noise includes electrical signals propagating through the body, so the industry standard is to include a bandpass filter with cutoff frequencies of 0.5 Hz and 150 Hz to remove the distortions from the ECG. This filter used a high pass and a low pass filter in series to eliminate signals outside of this frequency range. The schematic of this filter with its respective resistor and capacitor values is shown. The exact values of the resistors and capacitors were found using the formula shown in Equation (2). This formula was used twice, one for the high pass cutoff frequency of 0.5 Hz and one for the low pass cutoff frequency of 150 Hz. In each case, the capacitor value was set to 1 μF, and the resistor value was calculated.

Equation 2: R = 1 / (2 * pi * Cutoff Frequency * C)

Step 3: Building the Notch Filter

Another common source of noise associated with the ECG is caused by power lines and other electronic equipment but was eliminated with a notch filter. This filtering technique utilized a high pass and a low pass filter in parallel to remove the noise specifically at 60 Hz. The schematic of the notch filter with its respective resistor and capacitor values is shown. The exact resistor and capacitor values were determined such that R1 = R2 = 2R3 and C1 = 2C2 =2C3. Then, to ensure a cutoff frequency of 60 Hz, R1 was set to 1 kΩ, and Equation (3) was used to find the value of C1.

Equation 3: C = 1 / (4 * pi * Cutoff Frequency * R)

Step 4: Building the Full System

Finally, all three components were combined tested to ensure that the entire full device functioned properly. The specific component values did not change when the full system was implemented, and the simulation parameters are including in Figure 4. Each part was connected in series to one another in the following order: INA, bandpass filter, and notch filter. While the filters could be interchanged, the INA should remain as the first component, so that amplification can occur before any filtering would take place.

Step 5: Testing Each Component

To test the validity of this system, each component was first tested separately, and then the whole system was tested. For each test, the input signal was set to be within a typical range of physiological signals (5 mV and 1 kHz), so that the system could be as accurate as possible. An AC sweep and transient analysis were completed for the INA, so that the gain could be determined using two methods (Equations (4) and (5)). The filters were both tested using an AC sweep to ensure that the cutoff frequencies occur at the desired values.

Equation 4: Gain = 10 ^ (dB / 20)
Equation 5: Gain = Output Voltage / Input Voltage

The first image shown is the AC sweep of the INA, the second and third are the transient analysis of the INA for the input and output voltages. The fourth is the AC sweep of the bandpass filter, and the fifth is the AC sweep of the notch filter.

Step 6: Testing the Full System

Finally, the full system was tested with an AC sweep and transient analysis; however, the input to this system was an actual ECG signal. The first image above shows the results of the AC sweep, while the second shows the results of the transient analysis. Each line corresponds to a measurement taking after each component: green - INA, blue - bandpass filter, and red - notch filter. The final image zooms in on one particular ECG wave for easier analysis.

Step 7: Final Thoughts

Overall, this system was designed to take in an ECG signal, amplify it, and remove any unwanted noise so that it can be easily interpreted. For the full system, an instrumentation amplifier, a bandpass filter, and a notch filter were designed given particular design specifications to achieve the objective. After designing these components in LTspice, a combination of AC sweep and transient analyses were conducted to test the validity of each component and of the whole system. These tests showed that the overall design of the system was valid and that each component was functioning as expected.

In the future, this system can be converted to a physical circuit to test while live ECG data. These tests would be the final step in determining if the design is valid. Once completed, the system can be adapted to be used in various healthcare settings and be used to help clinicians diagnose and treat heart diseases.