LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Filter.vi bug

I'm trying to use Filter.vi provided with Labview 8.20 to apply a moving average on a signal. Applying the same input signal several times, sometimes the output generated by Filter.vi is not the same. Particularly, it sometimes generates a peak at the begining.

I would appreciate any help to solve this issue. Thanks.

 

Gabriel

0 Kudos
Message 1 of 8
(3,737 Views)
Hi Gabriel,

could you provide an example (vi!) showing this behaviour - this way we should be able to reproduce your problem...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(3,723 Views)

Hi GerdW,

I'm sending you the vi and a sample signal. Thanks for your help.

 

Regards,

Gabriel

Download All
0 Kudos
Message 3 of 8
(3,695 Views)
Hi Gabriel,

the problem is: you're using express vis...

I changed your vi to show the behaviour: the filter is now called in a loop. In the first iteration the result looks fine, but in the second you see the starting glitch! This is due to the buffering behaviour of the express vi! The express vi is buffering values to allow the running mean - when the next iteration starts you still have values from last iteration in this buffer resulting in this peak at start of signal...

To solve this:
- easiest: make your own running mean (see attachment) (and avoid express vis Smiley Wink)
- prepend dummy data on your input array (twice the size of the running average...)
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 8
(3,679 Views)

Hi GerdW,

Great. Thanks very much for your detailed answer.

 

Regards,

Gabriel

0 Kudos
Message 5 of 8
(3,656 Views)

GerdW,

 

I have the same problem but it is for labview 7.1.  Is there anyway you could repost your smoothing vi for labview 7.1? I would really appreciate it! Thank you in advance!

 

Gerardo

0 Kudos
Message 6 of 8
(3,380 Views)

Hi Gerardo,

 

here's a snippet of that VI:

Smoothing.png

The lower for loop was my suggestion for a running average. The upper while loop is for demonstration of the OPs problem...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 8
(3,360 Views)

GerdW,

 

Thank you very much! This is a very helpful VI. I appreciate your help!

0 Kudos
Message 8 of 8
(3,337 Views)