ECG Filter Design

From consulting and strategy development to implementation and support, our comprehensive services can help your business thrive.

The Problem

My professor gave me this file of a noisy signal and told me that it came from an ECG device sampled ad 360Hz and does not look normal. It was up to me to figure out what is wrong with it and propose a temporary and permanent solution to the problem.

Research

I did not know what an ECG was, much less what the signals it produced were supposed to look like. So I did some googling.

Frequency Analysis

By looking at the signal of interest and what I was given, I could see that there was some kind of high frequency noise overlayed ontop of the signal. A frequency analysis of the data showed that there was a lot of power at 60Hz.

f = fs*k/N = 360*600/3600 = 60 Hz

Amplitude = the sum of the 2 spikes/samples = 340*2/3600 mV ≈ 0.2mV

Samples

mV

More Research

At this point in my education, I did not know much about filtering a signal based on its frequency content with hardware. I needed to do a lot of research into the tradeoffs of hardware implementations of instrumentation filter design.

Design

After I figured out that a bandstop filter would be the best option I needed to implement one in software to verify the idea.

I also needed a hardware implementation. I decided on a Twin T Notch filter as it is an active filter with 2 stages and good quality.

Using the page from the Anoloug Filter Design instruction from Anoloug Devices, I designed my filter with the initial conditions of using a 0.1uF capacitor for C and Q of 30.

Simulation

After calculations, I got a lot of values that would be far too expensive for a simple band-stop filter that did not need to be so precise. I needed to round my values to nice numbers that would be a cheaper implementation.

Similarly, I needed to choose an op-amp for the design. I settled for an AD712 because it comes in a dual package option and the data sheet says that it is low noise and good for medical device application.

I simulated my design in LTSpice to verify that it still worked well after rounding my component values.

PCB Design

The last task was to design the assembly for my filter and choose acceptable components. I needed to recreate my schematic in Altium Designer, find the footprint for my op-amp, and draw all of the traces. This was my first PCB, so it is probably the worst PCB I have ever seen, but at the time I was blissfully ignorant and it did not help that I got 100% on this project so I assumed that it was amazing.