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?

답변 (1개)

Rik
Rik 2021년 6월 5일

0 개 추천

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

Walter Roberson
Walter Roberson 2021년 6월 5일
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
Indu S 2021년 6월 5일
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.
Walter Roberson
Walter Roberson 2021년 6월 5일
A sample plot would help, especially with a note about significant differences that might be detected before the damped oscillations.
Indu S
Indu S 2021년 6월 5일
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.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

제품

릴리스

R2021a

질문:

2021년 6월 5일

댓글:

2021년 6월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by