LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate the mean after 2 seconds

Hello 

 

I want to calculate the mean after 2 seconds when the graph basically increments. I do not want to calculate the whole  mean of the graph, only when it increases.

 

Thanks

KJ

0 Kudos
Message 1 of 3
(1,759 Views)

Store 2 seconds worth of the data and then perform the mean on that data.

 

We need a lot more context (ie code) to make any more detailed recommendations.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(1,725 Views)
  • What graph?
  • What causes it to increment? (Also what's the meaning of "basically").
  • Is the data rate constant?
  • How many data points in two seconds?
  • What is the "whole mean"?
  • Do you mean an "increase" in x or in y? (is that related to the "increment" mentioned above?)

 

Typically you would just keep the sum in a shift register and divide by the count after each interval. No need to accumulate arrays. There is even a "mean ptbypt" that you could read and reset as required.

 

It would be so much easier for all of us if you would attach some simplified code. Thanks!

0 Kudos
Message 3 of 3
(1,706 Views)