Oscillation about one point

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
Rik on 5 Jun 2021
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

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.
Thanks for the quick reply!
Yeah I need to find where the oscillations start and end. That is one of the major problems. If I can do that, then I can use median() to find out the value about which it oscillates right? As you have mentioned above.
A sample plot would help, especially with a note about significant differences that might be detected before the damped oscillations.
The oscillations you can see from about 3 secons till 12 seconds is what I am talking about. Since it is not about 0, I want to find the new point.

Sign in to comment.

Products

Release

R2021a

Asked:

on 5 Jun 2021

Commented:

on 5 Jun 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!