07-29-2013 11:44 AM
Hi,
I am having some problems with filter express vi. I am trying to use it as moving average.
I am feeding in a simple array of 10 numbers with the half-width of 2. But on the output, I don't get the correct filtered result. Is there something I am doing wrong here?
I have attached the sample VI I made for testing out the moving average function.
Any help is appreciated.
Thanks
07-29-2013 12:29 PM
The filter Express vi does not compute a simple moving average. It applies a smoothing filter to the data. it is bit different.
A simple moving average can be realized with this snippette:
07-29-2013 01:05 PM
Hi Jeff,
I was trying to construct the VI according to the image you posted, but I am not sure what NaN stands for? Also, what's the subVI beside it (orange one with the arrow pointing left)
Thanks
07-29-2013 01:45 PM - edited 07-29-2013 01:46 PM
NaN stands for Not a Number. its a special case for IEEE 754 floating point numbers as are +/-inf. The Feedback Node can be found on the structures pallatte.
Of course, that png shown is a "snippette." just right-click it copy it paste it to your desktop and drag it onto a block biagram. "Poof" the code is written! and hovering over the items with Ctrl+H on will take you right to the help file.
07-29-2013 05:11 PM
Or you can use PtByPt averaging. Found in Signal Processing >> Point by Point >> Prob & Stat >> Mean
Sorry, mine is not a snippet. Haven't installed that yet. 🙂
07-29-2013
05:38 PM
- last edited on
05-06-2025
05:22 PM
by
Content Cleaner
Sorry, mine is not a snippet. Haven't installed that yet. 🙂
I might be wrong, but I think the snippet is already a built-in Labview tool;
Here's a manual:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x2PkCAI&l=en-US
Regards,
Alex
07-29-2013 06:01 PM
@aputman wrote:
Or you can use PtByPt averaging. Found in Signal Processing >> Point by Point >> Prob & Stat >> Mean
Sorry, mine is not a snippet. Haven't installed that yet. 🙂
Not equvallent and will yeild strange results if number to average changes. Placing Number to average outside the loop yields equivallent results(Given the same "Random numbers"). just a bit less Rube-Goldbergy
(Your Code: underneith...):
07-31-2013 10:17 AM
Thanks for the help everyone.
Looks like I got that part working now