07-19-2010 04:18 AM
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
Solved! Go to Solution.
07-19-2010 04:59 AM
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
07-19-2010 05:19 AM
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
07-19-2010 08:48 AM
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
07-19-2010 08:54 AM
You can also try the Zero Crossing PtbyPt VI.
07-19-2010 09:04 AM
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 |
07-19-2010 09:20 AM
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
07-20-2010 03:14 AM
Thank you Lynn,
I was hoping I wouldn't have to, but it is done now and works perfect.
Thanks again,
Bill