11-18-2021 02:39 PM
I have waveform, which is result of some measurement. And I have some constant reference level.
I would like to get array of timestamps where waveform crosses reference level. Preferable, with interpolation.
Are there any idea on what is the best approach?
11-18-2021 03:28 PM
Seems like I have done it already, see picture. There is no interpolation yet, but there is hysteresis support.
Anyway, thanks to all 🙂
11-18-2021 04:08 PM - edited 11-18-2021 04:11 PM
You can even simplify it a bit if you'd like:
1- You don't have to wire the n terminal. The autoindexing on the Y array will automatically set the number of iterations to run.
2- You don't need the shift register timestamp array. Just take the "current" timestep value and wire it to the right edge of the structure. This will automatically build an array for you, but by default it'll take *all* values. Right click on the tunnel on the For loop border and select "Conditional", then wire the output of your Equals? function to it. This will create an array with the elements you add to it, but will only add them when that input is True.
(There is also the function "Threshold Detector" in the Signal Operations palette that does all of this for you ;))
11-22-2021 02:10 PM
Thank you, "Threshold Detector" seems to be similar to what I need.
It detects threshold level crossing only in raising direction, not falling, so I still need to do some work :-), but thank you anyway.
And thank you for 2) , did not know about it.