Introduction: Automated ECG: Amplification and Filter Simulations Using LTspice
This is the picture of the final device that you will be building and a very in-depth discussion about each part. Also describes the calculations for each stage.
Image shows block diagram for this device
Methods and Materials:
The objective of this project was to develop a signal acquisition device in order to characterize a specific biological signal/collect relevant data on the signal. More specifically, an automated ECG. The block diagram shown in Figure 3 highlights the proposed schematic for the device. The device would receive the biological signal via an electrode and then amplify it using an amplifier with a gain of 1000. This amplification is necessary since the biological signal will be less at about 5mV which very small and can be hard to interpret . Afterwards, noise would be reduced using an bandpass filter in order to get the desired frequency range for the signal, 0.5-150 Hz, and then a notch would follow in order to remove the normal surrounding noise caused by powerlines found around 50-60 Hz . Lastly, the signal then needs to be converted to digital so that it can be interpreted using a computer and this is done with an analog to digital converter. In this study however, the focus will primarily be on the amplifier, bandpass filter, and notch filter.
The amplifier, bandpass filter, and notch filter were all designed and simulated using LTSpice. Each section was first developed separately and tested in order to make sure they performed properly and then concatenated into one final schematic. The amplifier, which can be seen in figure 4, was designed and based off of an instrumentational amplifier. An instrumentation amplifier is commonly used in ECGs, temperature monitors, and even earthquake detectors because it can amplify a very low-level of signal while rejecting excess noise. It is also very easy to modify in order to adjust for whatever gain is needed . The desired gain for the circuit is 1000 and this was selected since the input from the electrode will be an AC signal less than 5 mV  and needs to be amplified in order to make the data easier to interpret. In order to get a gain of a 1000, equation (1) GAIN=(1+(R2+R4)/R1)(R6/R3) was used which therefore yielded GAIN=(1+(5000Ω+5000Ω)/101.01Ω)(1000Ω/100Ω) = 1000. In order to confirm the correct amount of amplification was achieved, a transient test was conducted using LTspice.
The second stage was is a bandpass filter. This filter can be seen in Figure 5 and consists of a low pass and then a high pass filter with an operational amplifier in between to prevent the filters from canceling each other out. The purpose of this stage is to produce a set range of frequencies that will be acceptable to pass through the device. The desired range for this device is 0.5 – 150 Hz since this is the standard range for ECG . In order to achieve this target range, equation (2) cutoff frequency = 1/(2πRC) was used in order to determine the cutoff frequency for both the high pass and low pass filter within the bandpass. Since the lower end of the range needed to be 0.5 Hz, the high pass filter resistor and capacitor values were calculated to be 0.5 Hz = 1/(2π*1000Ω*318.83µF) and with upper end needing to be 150 Hz, the low pass filter resistor and capacitor values were calculated to be 150 Hz = 1/(2π*1000Ω*1.061µF). In order confirm that the correct frequency range was achieved, an AC sweep was run using LTspice.
The third and final simulated stage is the notch filter and can be seen in Figure 6. The notch filter serves as a means to eliminate undesired noise that occurs in the middle of the desired frequency range created by the bandpass. The target frequency in this case is 60 Hz since that is the standard power line frequency in the United States and cause interference if not dealt with . The notch filter selected in order to handle this interference was a twin t notch filter with two op amps and a voltage divider. This will allow for the signal to not only filter out signal directly at the target frequency but also introduce a variable feedback into the system, an adjustable quality factor Q, and variable output thanks to the voltage divider and therefore made this an active filter instead of a passive . These extra factors however were mostly left untouched in the initial tests but will be touched on in future works and how to improve the project later on. In order to determine the center of the rejection frequency, equation (3) center rejection frequency=1/(2π)*√(1/(C2*C3*R5*(R3+R4))) = 1/(2π)*√(1/[(0.1*10^-6µF)*(0.1*10^-6µF)(15000Ω)*( 26525Ω +26525Ω)]) = 56.420 Hz was employed. In order confirm that the correct rejection frequency was achieved, an AC sweep was run using LTspice.
Finally, after each stage was tested separately, the three stages were combined as seen in Figure 7. It should also be noted that all of the op amps were supplied with a +15V and -15V DC power supply in order to allow for substantial amplification to occur when necessary. Then both a transient test and an AC sweep were performed on the completed circuit.
The graphs for each stage can be found directly under its respective stage in the Figure section in the appendix. For the first stage, the instrumentational amplifier, a transient test was run on the circuit in order to test to make sure that the gain for the amplifier was 1000. The test ran from 1 – 1.25 seconds with a maximum time step of 0.05. The supplied voltage was an AC sine wave with an amplitude of 0.005 V and a frequency of 50 Hz. The intended gain was 1000 and as seen in Figure 4, the since the Vout (the green curve) had an amplitude of 5V. The simulated gain was calculated to be, gain = Vout/Vin = 5V/0.005V = 1000. Therefore, the percent error for this stage is 0%. 0.005V was selected as the input for this section as it will closely relate to the input received from an electrode as mentioned in the methods section.
The second stage, the bandpass filter, had a target range of 0.5 – 150 Hz. In order to test the filter and make sure range matched, a decade, AC sweep was run with 100 points per a decade from 0.01 – 1000 Hz. Figure 5 shows the results from the AC sweep and confirms that a frequency range of 0.5 to 150 Hz was achieved because the maximum minus 3 dB gives the cutoff frequency. This method is illustrated on the graph.
The third stage, notch filter, was designed to eliminate the noise found around 60 Hz. The calculated center of rejection frequency was ~56 Hz. In order to confirm this, a decade, AC sweep was run with 100 points per a decade from 0.01 – 1000 Hz. Figure 6 shows the results from the AC sweep and illustrates a center of rejection frequency ~56-59 Hz. Percent error for this section would 4.16 %.
After confirming that each individual stage was working, the three stages were then assembled as seen in Figure 7. Then a transient test was run to check amplification of circuit and the test ran from 1 – 1.25 seconds with a maximum time step of 0.05 with a supplied voltage of an AC sine wave with an amplitude of 0.005 V and a frequency of 50 Hz. The resulting graph is the first graph in Figure 7 shows Vout3 (red), the output of the whole circuit, being 3.865 V and therefore making the gain = 3.865V/0.005V = 773. This is significantly different than the intended gain of 1000 and gives an error of 22.7%. After the transient test, a decade, AC sweep was run with 100 points per a decade from 0.01 – 1000 Hz and produced the second graph in Figure 7. This graph highlights the intended results and shows the filters working in tandem to produce a filter that accepts frequencies from 0.5-150 Hz with a center of rejection from 57.5-58.8 Hz.
(1) – gain of instrumentation amplifier , resistors relative to those found in Figure 4.
(2) – cutoff frequency for a low/high pass filter
(3) – for twin t notch filter , resistors relative to those found in Figure 6.
Step 1: Instrumentational Amplifier
Stage 1: the instrumentational amplifier
equation - GAIN=(1+(R2+R4)/R1)(R6/R3)
Step 2: Bandpass
stage 2: bandpass filter
equation: cutoff frequency= 1/2πRC
Step 3: Stage 3: Notch Filter
stage 3: Twin T Notch filter
equation - center rejection frequency=1/2π √(1/(C_2 C_3 R_5 (R_3+R_4)))
Step 4: Final Schematic of All Stages Together
Final schematic with ac sweep and transient curves
Step 5: Discussion of Device
The result from the tests performed above went as expected for the circuit as a whole. Although the amplification was not perfect and the signal degraded slightly the further it went through the circuit (which can be seen in Figure 7, graph 1 where the signal increased from 0.005V to 5V after the first stage and then decreased to 4V after the second and then 3.865V after the final stage), the bandpass and notch filter worked as intended though and produced a frequency range of 0.5–150 Hz with a removal of frequency about 57.5-58.8 Hz.
After establishing the parameters for my circuit, I then compared it to two other ECGs. A more direct comparison with just numbers can be found in Table 1. There were three major takeaways when comparing my data to other sources of literature. The first was that the amplification in my circuit was significantly lower than the other two I was comparing too. Both of the literature sources’ circuits achieved an amplification of 1000 and in Gawali’s ECG , the signal was even further amplified by a factor of 147 in the filter stage. Therefore, although the signal in my circuit was amplified by 773 (22.7% error when comparing to standard amplification) and deemed enough to be able to interpret the input signal from the electrode , it still dwarfed in comparison to the standard amplification is 1000. If standard amplification was to be achieved in my circuit, the amplification in the instrumentational amplifier would need to be increased to a factor greater than 1000 so that when the gain gets stepped down after passing through each of the filter stages in my circuit, it still has a gain of at least 1000 or the filters need to be adjusted in order to prevent higher voltage drop levels from occurring.
The second major takeaway was that all three circuits had very similar frequency ranges. Gawali’s  had the exact same range of 0.5-150 Hz while Goa  had a slightly wider range of 0.05-159 Hz. Goa’s circuit had this slight discrepancy because that range better suited the data acquisition card that was being used in their setup.
The last major takeaway was the differences in the center of rejection frequencies achieved by the notch filters in each circuit. Gao’s and my circuit both had a target of 60 Hz in order to suppress the line frequency noise caused power lines while Gawali’s was set to 50 Hz. However, this discrepancy is fine since depending on the location in the world, power line frequency can be 50 or 60 Hz. Therefore, a direct comparison was made just to the Goa’s circuit since power line interference in the United States is 60 Hz . The percent error is 3.08%.