LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to get points where the waveform cross constant reference level?

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?

 

 

0 Kudos
Message 1 of 4
(1,304 Views)

Seems like I have done it already, see picture. There is no interpolation yet, but there is hysteresis support.

Anyway, thanks to all 🙂

SergeS_0-1637270805106.png

 

0 Kudos
Message 2 of 4
(1,287 Views)

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 ;))

0 Kudos
Message 3 of 4
(1,280 Views)

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.

0 Kudos
Message 4 of 4
(1,216 Views)