LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Applying filter on incoming signal at serial port

Thanks to 

 

0 Kudos
Message 11 of 16
(1,916 Views)

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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 12 of 16
(1,913 Views)

Dear

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 

0 Kudos
Message 13 of 16
(1,910 Views)

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

0 Kudos
Message 14 of 16
(1,881 Views)

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

 

0 Kudos
Message 15 of 16
(1,872 Views)

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

0 Kudos
Message 16 of 16
(1,864 Views)