LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find zeroes in a waveform?

I ran into the problem of finding the zeroes in a waveform!

I have two line segments and would like to get their intersection point.
But there doenst seem to be such kind of VI that could help me with this - does it?

The next thing I tried was to generate a formula for ech of the lines, then subtract them and find the zero of the resulting line and also generated a formula for it. I used the "Zeroes and Extrema of f(x).vi" to find the zero but it didnt work at all.

I also tried to generate a waveform of the resulting line (by subtracting the two line segments) to detect the position on the waveform where the Y-value is zero. But it didnt work either 😞

The sample intervall of all the lines is 12 and the zero value is somew
here between two samples. Maybe thats why it doesnt work! But how can i get rid of that problem?
0 Kudos
Message 1 of 3
(2,759 Views)
Hmmm... May be I'm wrong, but if you already can generate formulas for your line segments i.e. you have koefficients for line equations (using linear fit, I suppose), then why you don't want to calculate the intersection analitically using calculated koefficients?
0 Kudos
Message 2 of 3
(2,759 Views)
Attached is one way to do it, but you have to know a few things about the signals. You need to know the x value minimum and maximum. You also need a tolerance for the crossing value. And you need a step value for the analysis. As tolerance or step value increase, processing time decreases. The attached example creates 2 simple waveforms from formulas and then finds the intersection. It will also indicate if no crossing is found.

Hope this helps.

Dave.
==============================================

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