LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to find inflection point in graph when dx is very small

Hello,

I'm trying to sort through position data from a feedback pot to calculate linearity of movement as part of a testing procedure. An image of the data is attached. I want to delete all data in the 'flat' part, in order to do a linear fit and R^2 of the sloped line.

This is made trickier by the fact that the number of samples, the start and end points, and slope of the line can all vary considerably. Therefore I need some way to find the 'knee' in the graph and remove all subsequent samples from the data. 

The most obvious method I tried was to use a derivative to find the inflection point, but since I have so many data points, the dx is very small
(~0.05) when using the built-in labview derivatives. This means that I can't distinguish the inflection point from any other change in the values due to noise or change in velocity. I made my own derivative function, which was a newton quotient that looked at (xi+N)-(xi-N) instead of (xi+1) - (xi-1), but this still did not give good results. My next idea is to just look at the difference of every N points, and arbitrarily decide a threshold to indicate when it has levelled off. Any other ideas would be really helpful though.

Thanks,

-SK-

0 Kudos
Message 1 of 3
(4,294 Views)
I'd try a different approach.

As long as you know within some region where the knee is, you should be able
to determine the slope of the raising signal (the first part). So, once you
have that slope, you should be able to determine the X position of the knee,
because you know the height of the end signal.

For example, in the first picture, the slope is -3 over approx. 2000
samples, so -3/2000. The start Y value is 3, so you'll get y=-3/2000*x+3.
The end Y level 0.5, so your knee is at x=(0.5-3)*-2000/3= 1.667, which
seems right. If you do this 4 times, and take the average, you might get
good results.

For finding the slope, you could use the standart curve fitting functions,
as long as you do not take too much data...

Regards,

Wiebe.


0 Kudos
Message 2 of 3
(4,269 Views)

Lets see if I can answer without having to write a book.

 

Fisrt I'd run the data through a zero-phase shift low pass filter. Then look at the 2nd derivative to find the knee. Using a zero-pahse shift fileter I was able to detect when a value was jumping up when it started to jump rather than after. THis thread may be interesting.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 3
(4,260 Views)