LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Take the average of sampled data and output a chart of the new data

Hello,

 

Please could you help me solve this issue?

I am acquiring a signal using data acquisition. I need to get the average of sets of the sampled data and output the result in a Chart waveform.

So for example I need to have the average of each 10 samples and then I need the output chart of the the averages vs time. 

 

Thank you,

 

Bill 

0 Kudos
Message 1 of 8
(3,241 Views)

Hi Bill,

i think one of these posts can help you.

 

Mike

0 Kudos
Message 2 of 8
(3,224 Views)

There is the express VI called Statistics and the Mean funciton on the Mathematics&Probability palette. With either, you would simply wire the output to a chart.

 

If you get stuck with using either of these functions, you need to attach your code so someone can see what you have done wrong.

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

Actually, I have  a continuous stream of data. These data should be divided into sets of data. then these sets are averaged.

So, I have only ONE signal and not more. This signal is converted onto array then every set of data of this array is sampled.

 

Thanks in advance for your help,

 

 

Bill 

0 Kudos
Message 4 of 8
(3,208 Views)
And where is your code that explains exactly why you are are having an issue implementing the mean function?
0 Kudos
Message 5 of 8
(3,197 Views)

Please find attached a piece of my code which is not working properly. 

The data acquisition have 4 inputs. I am now using only one. This signal should be sampled and then I should take the average of the each set of samples.

* in this VI the output of the mean is the same as the actual output of the dynamic and continuous waveform. 

 

Thank you

 

 

Bill 

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

Hello, 

I guess I found the problem.  The initialize pin was true and that's why I was getting always the output of the mean the same as the individual values without taking the mean of the sets. 

Now, please can you help me know how to control the initialize pin so it can be set to true after taking each sample of data?

 

Thank you,

 

 

Bill 

0 Kudos
Message 7 of 8
(3,183 Views)
All that you need to do is compare the iteration terminal count to zero. This will initialize on the first iteration and be false on subsequent iterations.
0 Kudos
Message 8 of 8
(3,167 Views)