Crossing threshold for a certain duration
I have waves in which I'd like to find out if a threshold is crossed continuously for a minimum of 3 seconds and where the x-location of the final threshold crossing is (ie. determining the time during which the values above threshold are maintained). I am having some difficulty implementing this using Findlevels operation with this and would appreciate any advice. Am I perhaps using the wrong function?
So far you are just generating a wave that gives you 1 where data are over the specified thresh. Next you need to look at your sampling and figure out how many consecutive points you need to maintain (we will call that N). Here you need to accept that you will not be able to make any judgement about the beginning and the end of the wave (N-1 points). Next consider the product:
For simple cases, e.g., requiring 3 consecutive points above threshold:
etc.
I hope this helps,
A.G.
WaveMetrics, Inc.
September 12, 2017 at 01:57 pm - Permalink
Maybe if you posted your code and an example of the data as an experiment file we could help you better.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
September 12, 2017 at 08:45 pm - Permalink
Any suggestions for a better way to continuously test if the threshold is maintained for 3 seconds after the first point above threshold is detected.
September 13, 2017 at 12:00 pm - Permalink
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
September 13, 2017 at 03:58 pm - Permalink
(Experiment attached)
--Jim
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
September 13, 2017 at 03:59 pm - Permalink
EDIT: Using shiftVector(wIndices, 1,0) to get the start indices causes the code to miss events that start at point p=1 (second point in the wave). Changing the fill value to NaN seems to solve this.
IF
//****Method 2****
END
September 18, 2017 at 03:04 pm - Permalink
September 19, 2017 at 06:35 am - Permalink