LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you remove baseline wandering from an ECG?

We are trying to remove baseline wandering from an ECG. However, the new waveform does not look like the ECG (as shown below). When we use 1 as our value the waveform looks exactly the same and does not remove any baseline wandering. When we use -1 it just smooths everything out as well as when we use 0.34 (the value we calculated for our trend level). I have attached the code and screen shots are included. The sampling rate was 250 samples/sec and the number of samples taken was 1500.

 

Screen shot for value of 0.34

BW value 0.34.JPG

 

Screen shot for value of 1

BW value 1.JPG

 

Any help would be appreciated.  Thank You!

0 Kudos
Message 1 of 12
(11,317 Views)

Hello Laudie3a,

 

After reading you post, it seems that you are having issues with removing the baseline from your ECG signals. After reviewing WA Detrend VI help file, I found a good explanation how this VI works and there is an example in LabVIEW how to use this VI called Detrend and Trend Estimation VI. I also found a DeveloperZone article talking specifically about processing ECG signals using this VI as well called LabVIEW for ECG Signal Processing.

 

I hope this helps you with your problem but if you have any more questions, please post back so we can work on it.

 

JimS


Jim St
National Instruments
RF Product Support Engineer
Message 2 of 12
(11,268 Views)
Why aren't you just using a simple high-pass filter?
0 Kudos
Message 3 of 12
(11,257 Views)
The signal you have shown in the two pictures are not baseline wander but artificial signal, maybe due to improper electrode connection. They are not ECG signals. And filtering will not help. If you use disposable electrodes, the may be dried out because of improper storing. ECG electrodes will very quickly dry out then not stored in an airtight container.  


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 4 of 12
(11,249 Views)
We tried using the Classic Filter Design Express VI to design a Kaiser Window FIR highpass filter to remove the baseline wandering. Then we passed it through the DFD filtering design but nothing was even reading for that. We were getting just a straight line so we tried this other method and it doesn't work. And those were real ECG signals and the electrodes were placed on properly and were new. Here is where we were getting our code from and trying to follow: http://zone.ni.com/devzone/cda/tut/p/id/6349
0 Kudos
Message 5 of 12
(11,209 Views)
With the proper electrodes and ECG amplifier you should get reasonably clean ECG waveforms to start with. Filtering should only be needed for cleaning up the ECG signal due to periods of noisy data collection that may be difficult to control over long recording periods - movement artifact, electrode drying effects, occasional high frequency or line frequency interference from nearby electronics, etc. You cannot apply filters to create an ECG waveform from a signal that doesn't contain ECG, right?  So let's see some pictures of waveforms that at least have some resemblance to an ECG before we spend any more time trying to help you design filters - I think that this should be your primary goal at this time.
0 Kudos
Message 6 of 12
(11,199 Views)

S.E.Johnson wrote:
So let's see some pictures of waveforms that at least have some resemblance to an ECG before we spend any more time trying to help you design filters - I think that this should be your primary goal at this time.

I can see a glimpse of something (and a hope) that might resemble an ECG in this picture. The rest is pure garbage. You should trust us on this oneYou will only waste time else.

sample.PNG 

 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 7 of 12
(11,180 Views)

CoqRouge provided a good suggestion. 

 

Using a filter will result in filtering your desired signal.  

You have to take care of the source signal because it is overwelmed with noise.

 

If CoqRouge's suspicion is correct (and it appears to be so), then your noise is way bigger than your signal, and it is in the similar frequency range as your desired signal, which is why filtering will serve no purpose (other than giving you a flatline... 😮 )

 

0 Kudos
Message 8 of 12
(11,161 Views)

That's definitely an ECG signal that CoqRouge has circled - and it's possible to make out the QRS complex embedded in the high amplitude noise earlier in the signal at similar intervals.

 

That high amplitude noise is NOT what we call a "wandering baseline" (which is a slow shift in the DC level of the signal).  Instead, this looks like movement artifact to me, which is caused by rapid shifts in electrode offset potentials due to displacement of the electrode/gel/skin interface which makes the electrodes very sensitive movement transducers.  Try to keep everything as stationary as possbile - tape the lead wires coming from the electrodes down to the skin near the electrode.

0 Kudos
Message 9 of 12
(11,135 Views)
Many good pointers in this thread Laudie3a. I hope you take them seriouslySmiley Wink


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 10 of 12
(11,124 Views)