Average of all values between (above first and last above) a threshold value.

Currently I have a VI where I programmed a year or more ago, takes any value of a set of data that exceeds a certain threshold. It is used to capture the average of all values above a threshold when there is a peak of the values that exceed this threshold. However, when there are two or more peaks that exceed this threshold, only values greater than this value are averaged, so the final result is the average of the two or more.

What I need is for each value that occurs after the threshold is reached, and before that the threshold fell below for the last time. Imagine a set of data whose graph looks like the letter "M" for example with the threshold being to halfway to the top of the M, I want to show the average (the first bump, the fall below the bumps, as well as the last bump) but what I'm saying now is the average of (the first bump, over the last bump). What I get now cut the data between the two summits.

Any help would be appreciated of course.


Here's a method, perhaps not the best.

Tags: NI Software

Similar Questions

Maybe you are looking for