10-19-2012 02:00 AM
Thanks to Norbert_B , crossrulz , johnsold and ejkaiser for replying and guiding to me.
I try to describe my project in more detail.
Actually i want to plot and analyze ECG in labview, i have digitized the ECG signal through a custom hardware and now sending it to serial port at 115200 baud rate.
Now as you know that there is always a noise that incorporates with the ECG signal, i want to remove the noise.
I need guidance on how could i filter out the noise of 50 Hz present in the signal.
>> I have not sampled the signal, just got it from the com port and converted the ASCII into decimal and than connected waveform chart. So how to apply the sampling on this signal?
>> At the momnent i am having a single data type signal, do i have to convert it into array first? or the signle data point type filter could remove the noise or simply what the better way?
>> I think that the notch filter of 50 Hz is the requirement of butterworth type
thanks again to everyone.
10-19-2012 02:18 AM
You should collect some data points. There are plenty of examples available, most of them not incorporating best performance optimization (memory usage and execution speed). But i think both are not your major concern so you should be able to use *any* of those examples.
Pass that data to a filter VI once collected enough data points (regarding your sampling rate, i would say collect data up to 1s). The filter should be a band stop set to a frequency of 50Hz (stop between 49 and 51 Hz for instance). Regarding the selected filter type (Bessel, Chebyshev, ...) the result will differ. Select the one looking best for your task.
All filter VIs have one thing in common: You have to pass timing information to them, meaning: The sample rate. So if you don't know that value, you cannot filter the signal.
There are filter functions available called "point-by-point" which accepts scalar values "to filter". You have to know that those function store "the signal history" internally, effectively building a signal array for you inside the filter. But since it requires that history for correct filter function, the first iterations/calls to those filter VI return.....possibly wrong filter responses for your chart.
Norbert
10-19-2012 02:37 AM
Dear Norbert_B
Where should i start from.
You have said that i should first collect data, so should i form an array and if yes then of what length?
Which filter do you suggest me to use?
Thanks
10-19-2012 10:28 AM
Abuzar,
Thank you for providing more information. I suspect that part of the problem is our communications.
Your data is sampled. Digitized = sampled. The sampling rate is the number of digitized values created by your custom hardware in each second. This is not the number of bits in each analog to digital conversion, but the number of conversions. For ECG waveforms typical sampling rates are 500 samples per second or greater. If all you want is the heart rate you can get by with somewhat slower sampling.
The best way to get rid of power line frequency interference in such signals is to use appropriate signal conditioning circuits before the digitizing process. An instrumentation amplifier or differential amplifier with proper connections to the patient should eliminate most of the interference. You may also need isolation for patient safety. Filtering out power line interference after digitizing rarely produces results as good as propre signal conditioning before digitizing.
You can also attempt to do a pseudo-differntial process in software by adding a channel which only picks up the power line frequency signal to subtract, but this is a non-trivial task.
Notch filters are almost never Butterworth because of the slow roll-off characteristics of Butterworth filters. Consider an elliptical filter or other types specifically designed for notch applications.
Lynn
10-19-2012 11:50 AM
Thanks Johnsold for you personal interest.
I have already tried it at the hardware level but unable to remove it completly and also removing the noise at the hardware level increases the cost too.
So i was trying to remove it by the software or either remove the remaining through it.
What are the techniques present in labview to remove this noise using the integrated filter's tool kit.
Regards
10-19-2012 01:08 PM
I do not have the filter toolkit so I cannot help with that. From the standard Filter palette I would probably start with the Elliptic Filter.vi and set it to Bandstop mode. You will need to run some tests to see how much it affects the desired signal. It will attenaute any signal components in the stop band and will have some attenauation and phase shift outside the stop band.
Lynn