LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interpolation - more than one point

Solved!
Go to solution

Hi,

 

I am trying to find the position that a graph crosses the zero axis. The problem is that this occurs more than once in my graph (it is a graph of reactance from an impedance plot). I am using 1-d interpolation and this only returns one point of intersection instead of the 2-3 which occur. Is it possible to get all three?

 

Any help would be greatly appreciated,

 

Bill

0 Kudos
Message 1 of 8
(3,958 Views)

Could you post the code you used with a valid data-set, without those two it will be quite hard to give good advise.

I don't see how the interpolate 1D array function can be used for your use-case.

 

If you  look in the the Signal processing palette you will find several functions that can help you.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 8
(3,948 Views)

Hi Ton,

 

Thank you for your quick response. The problem with the code is that it is a small part of a much more complicated code that is opening an excel file and taking in data. I have attached a sample of the data and also a snapshot of the code used. From the graph you can see it crosses the x-axis at the 0 point twice. I want to be able to record each one. I have tried using the trigger function but this only selects the one closest to the 0 point.

 

Thanks again,

 

Bill

Download All
0 Kudos
Message 3 of 8
(3,938 Views)

Bill,

 

Why not use the Threshold 1D Array function?  Put it into a loop with the Start Index passed via a shift register from the output rounded up to the next integer to get all the positive-going zero crossings.  then multiply the array by -1 and repeat to get the negative-going zero crossings.  You may need to check the first elements to make sure they are on the "right side" of the threshold.  Read the detailed help and try a few things to make sure you understand how it works.

 

Lynn

0 Kudos
Message 4 of 8
(3,906 Views)

You can also try the Zero Crossing PtbyPt VI.

0 Kudos
Message 5 of 8
(3,900 Views)

Thank you for the responses.

 

My problem is that I require to interpolate between two points. I am looking a different interpolation options. I have performed linear interpolation myself and I want to find an approximate value for the frequency when the reactance crosses the x-axis. For example in the attached file the data points are shown below. I want to interpolate the point of zero reactance, which in this case is around 82.9 kHz. The interpolation function calculates this perfectly but my problem is it only returns one reading when this happens at least twice.

 

Frequency    Reactance

82.5 -247.86
83 0.90039
0 Kudos
Message 6 of 8
(3,893 Views)
Solution
Accepted by topic author Billq

Typically when you have to detect multiple occurrences of a condition in an array of data, you find the first one, then search the portion of the array after the first for the second.  You will not likely find a built-in function which will do all of it for you. The procedure I described in my previous post will do this.

 

Lynn

0 Kudos
Message 7 of 8
(3,876 Views)

Thank you Lynn,

 

I was hoping I wouldn't have to, but it is done now and works perfect.

 

Thanks again,

 

Bill

 

0 Kudos
Message 8 of 8
(3,838 Views)