LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Moving average

Hi, I am trying to create a moving average of a double type data. I have browsed the other forum threads, however, I have not solved the problem.

I have seen this image, but I am unable to search for the function with "the arrow above & asterisk bottom". Could somebody help identify that function as well as if there is a good way to create a moving average?Capture.PNG

FYI, I am using LabView 2011 version.

0 Kudos
Message 1 of 4
(2,101 Views)

Your code is not scalable, because whenever you need to change N, you would need to rewrite it from scratch. It will also become unmanageable once N gets larger (e.g. 100). You also have a problem for the first four results because your feedback nodes are not initialized in any reasonable way.

 

Do you have LabVIEW full (or above) or only base? Except for LabVIEW base, it will be in the signal processing..ptbypt palette.

 

There are old discussions on how to write a scalable solution from scratch. Did you find them?

 

Can you show us the rest of your code? Is this a subVI or part of the toplevel diagram?

0 Kudos
Message 2 of 4
(2,071 Views)

Have a look at my detailed comparison in our NI Week presentations from a few years ago.

 

Download part II, unzip, and have a look at the RunningAveragesTester in the 02-TS9524BenchmarkArrays folder. (Also look at slides 11-14 in the presentation found in the documentation folder)

 

 

altenbach_0-1631459700615.png

 

0 Kudos
Message 3 of 4
(2,067 Views)

Here's the LabVIEW 11 version of the tester (Make sure to unzip first).

 

(It would be trivial to rewrite it as loop-free subVI. Also note that you might need some extra handling in case N changes during the run, etc.)

 

 

Message 4 of 4
(2,061 Views)