Oscillation about one point
Show older comments
I have an array of values I get from a sensor and the values undergo damped oscillated after the first few seconds. I want to find the point across which it oscillates. Can someone help me out?
Answers (1)
Rik
on 5 Jun 2021
0 votes
It might be enough to use mean on the second half of your vector. Sometimes a simple solution will already do the trick.
The alternative would be to fit a function to your data, or to do a Fourier transform and keep only the low frequencies.
4 Comments
Walter Roberson
on 5 Jun 2021
median() might be more robust than mean() for this purpose.
But both mean() and median() suffer from the problem that the results will be distorted if you do not use full cycles, so the logic might need to detect cycles boundaries. You cannot do that with zero crossings because the movement might not be around 0. Picking midpoints between peaks might work, though.
In theory you get greater accuracy on the position as you take into account more cycles. But then there is the possibility that you might have gone too far, and are into an area that was not yet undergoing damped oscillation. But we are not given an description of the signal before it enters damped oscillation: it is tempting to think that it must be "going wild", high oscillations or even jerking around... but we don't know that with the given information, so for all we know, the part before the dampened oscillations might be pretty much a straight line.
Indu S
on 5 Jun 2021
Walter Roberson
on 5 Jun 2021
A sample plot would help, especially with a note about significant differences that might be detected before the damped oscillations.
Indu S
on 5 Jun 2021
Categories
Find more on Numerical Integration and Differentiation 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!