Extract turning, angles, or "unsteady" points in a Plot
5 views (last 30 days)
Show older comments
Hello Community,
I have a set of coordinates obtains from some sensor readings. The plot of the given data can give graphs such as those depicted on the image on the Graph below:
Can anyone please advise me on a method I could use to detect the "turning" points indicated in red. Please note that I do not have the actual function of the curve, just some set of (X, Y) coordinates. I was thinking of an algorithm that may for example for each point coordinates, would check the positions of surrounding points to find out whether or not the current point was one of those "special" point. Any help, or even some directions towards a possible solution would be greatly appreciated.
Thank You
0 Comments
Accepted Answer
Image Analyst
on 24 Dec 2012
Edited: Image Analyst
on 24 Dec 2012
Yanick: We had this question come up recently in http://www.mathworks.com/matlabcentral/answers/57194. I used Roger's method (one of the naswers) to come up with this demo: http://www.mathworks.com/matlabcentral/answers/57194#comment_118587. It should work great in your case.
2 Comments
More Answers (1)
Joseph Areeda
on 24 Dec 2012
Hi Yanick,
I don't have a good handle on what you're trying to do. On an arbitrary scale, I think any real world data with noise would look like your graphs of 4 points.
From your description I assume you have fairly consistent data with occasional outliers and the problem is to identify the outliers.
My first SWAG at an algorithm would be to fit a curve to a short sliding segment of your data then measure the distance of points from the fitted curve. Flag the ones that are above some threshold. That depends on how well you can fit the data.
A similar approach for arbitrarily complex curves with noisy data is to simply smooth the curve (a low-pass FIR filter over the x and y values separately might be good enough) then flag the points that moved the most if they are above some threshold.
Picking outliers (if that is the task) often becomes a problem of defining what is normal variation.
Joe
See Also
Categories
Find more on Data Preprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!