This was a project at the end of my Circuits and Signals class. The electrocardiogram (ECG) is a classic example of a lifesaving application of electrical engineering. The heart is controlled by the nervous system, which contains a chain of electrochemical impulses. The following graphic shows the electrical potential of a nerve as it transmits a signal.
Components of a nerve signal
Electrodes placed on the body across the heart can collect the nerve signals that direct the heart to pump. Analyzing these signals can have lifesaving implications, like detecting arrhythmias.
Proper placement of ECG electrodes
Trying to read the signals directly from these electrodes is impractical. The signals are too small and too noisy to get anything of use. Common ECG signals have a p-p amplitude of 100 mV and have compnents from 0.1 Hz to 400 Hz. This ECG takes multiple steps to collect a useful signal:
- AD627 amplifier to obtain a large enough signal
- High pass filter to eliminate the DC component of the signal
- Low pass filter to eliminate noise
- Analog to digital converter (ADC) to record the signal
- Digital signal processing in MATLAB to obtain a clean, usable ECG trace
ECG circuit block diagram
ECG circuit schematic
Again, the raw ECG signal is unusable. The AD627 instrumentation amplifier takes the raw signal and amplifies it so it can be filtered, recorded, and analyzed.
AD627 instrumentation amplifier
The supply power was chosen at 1.5 V, allowing for the use of a AAA battery for power, isolating the patient from the electrical grid. To achieve a desired gain of 25, RG was set to 10k. Testing the circuit, the real gain was 24.6. The cutoff frequency was 12.5 kHz, which is ok, as the highest desired signal is 400 Hz. Finally, the leads from the electrodes were arranged in a twisted pair to reduce noise pickup from the line. The amplified, unfiltered trace was recorded and is shown below.
Unfiltered ECG trace
The spikes in potential with each heart rate are clear but the rest of the signal is useless in its current state.
The ECG reading has an unwanted DC component from the potential of the human body. An active high-pass filter using an op-amp was used to eliminate it. A cutoff frequency of 0.265 Hz eliminates this DC component without sacrificing too many low-frequency components. The maximum gain of this amplifier is about -0.8.
To eliminate unwanted high-frequency components (noise), a low-pass filter with a cutoff frequency of 226 Hz was used. The gain for this stage was selected at 150; this allowed for the final signal to fill the +/- 1.5 V range available for A/D conversion.
The final, constructed circuit and the recorded trace are shown below.
ECG trace from ADALM2000 software
A MATLAB program was used to further process the signal. First, a Parks-McClellan filter with the same cutoff frequencies as the analog filters was used to clean up the trace. Second, a notch filter was used to eliminate 60Hz noise from the power grid of the same frequency.
ECG trace processed in MATLAB
The final trace is clear and usable. The heart rate is around 75 bpm, which is normal for a college student on caffeine.
The full development process is detailed in the reports below.
Amplification; mobile users click here
Analog filtering; mobile users click here
Digital filtering; mobile users click here