LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

median filter

 I have a VI that is reading current from an alternator in our test stand. We had a good readout of the realtime current to a graph previous to trying to apply a filter. However now that I have applied the filter, the build array to the graph might be combining the arrays into one? Because I only get one array (not output from the filter) show up on the graph indicator.

 

Unfortunately the median filter is not working at all. When I have the rank for the filter assigned zero, I can probe that it is working correctly by just filtering nothing and outputting the original array. As soon as I give the rank a value other than zero the filter either outputs no array or an array of all zeroes. I followed the sample VI for the median filter and I can't figure out what is wrong. I played around with different wire double/scalar/etc to see if that could be the problem, but nothing changed. 

 

Any help is much appreciated.

0 Kudos
Message 1 of 5
(6,300 Views)

Hi,

 

I think the problem is the input of the function. You are basically wiring an array with just one element. From the picture you posted y cannot see that you are adding the new values to any shift register or something like this.

 

I think you should be using the point by point median filter instead.

 

http://zone.ni.com/reference/en-XX/help/371361J-01/ptbypt/median_filter_ptbypt/

 

Regards,

Richard

0 Kudos
Message 2 of 5
(6,253 Views)

Thank you for your help, it ran about the same as the median filter I had before. However now I can change the rank and it will run (with the median filter it would not change when I changed the rank). I applied a digital indicator to the Filtered X from the filter and it read out a constant 0.00000 with 5 points of precision, while the actual current read out the usual noise fluctuating between -1 and 3. So I know that if it was working the average would atleast have decimal averages, not 0.0000 right? 

 

I know I must be missing something simple.

 

0 Kudos
Message 3 of 5
(6,239 Views)

I don't know if this helps, but I attached an image of my indicator. So I can see the digital read of both values. The AVG Current has remained at 0.00, and only one line displays in the graph because either the filter values return null or when the rank is zero it reads the same as the actual value and they overlap in the graph looking like one line.

0 Kudos
Message 4 of 5
(6,235 Views)

Hi,

Let me explain you a little better my point of view. I consider that the issue could be caused because you are not (the median filter function is not) analyzing the enough amount of samples. In the picture you will noticed that there is surrounded with a red circle all the evidence that could tell you the amount of points that are being analyzed at the same time. Now, I think you will be able to solve your issue by simply ensuring that you are passing more samples than the Left Rank.

 

MedianFilter Example.PNG

 

Take a look to the example VI attached.

 

Regards,

 

Richard

0 Kudos
Message 5 of 5
(6,210 Views)