Biomedical User Group Discussions

Showing results for 
Search instead for 
Did you mean: 

Design a Filter to remove noise from ECG Signal


I have tried a lot to remove the noise from the ECG Signal through Labview Even following the tutorial given on

and using applying the design given as below

filter image.gif

Kindly guide me how could i remove the noise completely.

the Parameters i gave to the design are as under

Filter Type:- Bandstop Filter

Low Cutoff:- 45 Hz

High Cutoff:- 55 Hz

Sampling Frequency:- 188 Hz

Order:- 20

Windowing:- None

Thanks alot

0 Kudos
Message 1 of 10

Filtering signals is not that easy. You often end with badly damaged signals. Filtering always does change one or the other property of the signal and can easily remove important things. So act with care here!!!

From your data I extract that you are trying to remove 50Hz powerline noise. This is very well defined as 50Hz +/- << 0.05 Hz. So adjust your cutoff freqs to 49..51 Hz or so. In my test automates for ECG devices I have used a butterworth IIR bandstop filter of 3rd order with 49..51 Hz. Alternatively I have used an approach where I have utilized a short sinus signal of 4Hz/4mV we inject for test purposes. This signal can be analyzed using the 'Extract Single Tone Information 1' to return the residual signal (which in fact only contains the unwanted noise). This residual is again applied to 'Extract Single Tone Information 1' configured to return the detected signal. This noise signal can be substracted from the sampled signal, which in fact removes the power line noise quite effectively.

BUT BE CAREFULL! The detected signal is the one single tone with highes power within the sampled signal. So you have to prove the algorithm did what you expected. Once in a while it 'goes crazy'. I had to do some plausibility tests and revert to the old bandstop filter when those plausibility tests fail.

Just my € 0.02!

Greetings from Germany!



0 Kudos
Message 2 of 10

What is wrong with your signal? Before you post some signal examples this discussion will have no value. And more important a filter is not some magic wand. If your noise is in the same bandwidth as signal of interest. You will by filter out noise also distort your signal. In an ECG setting. A digital filter never be able to correct "bad design" in the analog front-end. So are you sure the analog front-end is optimal as it can be. Do you use proper electrodes. If you use some sort of wet gel electrodes. You should known that these can dry out VERY quickly if they are not stored in a small airtight container. That kind of DAQ equipment do you use? One of my fave trick. Is to you use a much higher sample rate than needed. And then do some averaging on the signal. In your case I will say you need a 500 Hz sample rate. So instead of using 500 Hz use 5000 Hz and average every 10 samples to one sample. Hence you will end up with 500 Hz sample rate. In your application I would have applied the down-sampling after all the filtering has been done. 

So much can be done but first we need some signal samples. Also what kind of analysis will you do on your signal?

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


Extract Single Tone Information 1 is of Labview 2010 edition but i have LV 8.6.

I have ordered Evaluation CD so as i get it i will try it.

Thanks anyway

0 Kudos
Message 4 of 10

Hello CoqRouge,

Here is all that has gone wrong.

I have a board which converts the analog signal and sends it to the PC. I am using this board to acquire the ECG Signal. As you know that an ECG Signal is of very low Amplitude so the noise is present in it.

Now in order to view it correctly, i want to remove the noise and for that i have tried many techniques but none of it helped.

I want that the extraction could be done in the Programing Side as the response of an analog filter is not accurate and it also eat up the desired signal.

I will try your averaging technique and will send you the results.

I want to do all the analysis that is done in a General ECG Machine.

Lets see what happens...



0 Kudos
Message 5 of 10

Hi I am working on EMG signal acquisition and feature extraction.I am confronted with two problems.


I am using my own hardware to extract EMG signals.After extracting I am not able to filter the signals.I am using the filter located in functions palette.The path is Express-->signal analysis-->filter.

The problem is I am not able to filter the signals received from my hardware.The error I am getting when I run the labview program is Error 20020,the cut off frequency fc must meet  0<=fc<=fs/2.Sampling,I have opted automatic sampling in the filter design in labview.This filter is working with simulated signals but not able to filter my real time data.How can I fix the problem?Is there anyother filter or method that can serve my purpose?

second,can anybody tell me how to implement willson amplitude method for feature extraction in labview.Thank u

0 Kudos
Message 6 of 10

Would you mind re-posting this question in a new thread?  This thread is about ECG filtering and your issues are sufficiently different that we should handle them in a new discussion to keep this thread on track.


Visit the NI Biomedical User Group at:
0 Kudos
Message 7 of 10


0 Kudos
Message 8 of 10

Hi sir 

i have ECG machine it has filter 25Hz to 150Hz so how can know to set up the filter up or high ?



With best Regard


0 Kudos
Message 9 of 10

A simple and efficient method was presented in this paper: A wavelet-based method for power-line interference removal in ECG signals. In: Res. Biomed. Eng., vol.34, n1, p.73-86, 2018. Authors: Bruno Rodrigues de Oliveira; Marco Aparecido Queiroz Duarte; Caio Cesar Enside de Abreu; Jozue Vieira Filho. DOI:

0 Kudos
Message 10 of 10