06-25-2009 06:30 AM
06-30-2009 12:51 PM
10-08-2009 05:19 AM
Hi sayndesyn,
I am new to LabView and I have the similar problems to reduce the noise of the incoming data and averaging.I am interested to have a look on the attachement that posted by Jim few months ago. However,I could not find the attachment. Would you mind to post the example here again?It will be a big help from you.
Thank you.
Sue
10-09-2009 09:44 AM
It seems to have been removed for some reason. We may be out of luck unless Jim posts back....
10-09-2009 11:43 AM
Sue,
A VI to compute a running median is attached, along with 2 sample input data files. Set the "order" on front panel, then run VI. The width of the moving window from which the median is computed is 2*order+1. If you select input file "spiky_data.txt" you see that the median is not pulled off track by spikes in the data, the way the mean would be. This is why the median is considered a more robust estimator. Rerun the VI to see the effect of changing the order. The block diagram shows that I convert the arrays to waveforms, and timeshift (advance) the median-filtered waveform by "order" samples before plotting. This is to compensate for the delay introduced by the filter. This would, of course, be impossible in a real-time application, since it is non-causal, i.e. it requires seeing into the future. You can see that this compensation works by using the example data file straightline.txt: note that the filtered and unfiltered waveforms are aligned. If you change the block diagram to make the timeshift=0 instead of "-order", then rerun, using straightline.txt as input, you can see the effect of uncompensated delay in the median-filtered waveform.
Bill
10-09-2009 11:52 AM
Sue ,
I should have said "rank" in place of "order" in previous post. A screenshot of a simpler version of the previiously-attached VI is attached. This simpler VI does not have delay compensation and therefore the arrays are not converted to waveforms.
Bill