Mean of an oscillatory trajectory

조회 수: 5 (최근 30일)
Ban
Ban 2023년 8월 7일
답변: Image Analyst 2023년 8월 8일
Hi,
I have a particle moving in oscillatory path. See the plot of distantce vs time plot. How do I find the mean trajectory ?

채택된 답변

Daniel Bengtson
Daniel Bengtson 2023년 8월 7일
p = polyfit(t,X,2); % fit a second order polynomial to the data
newT = linspace(min(t),max(t)); % 100 evenly spaced steps over the range of t
Y = polyval(p,newT); % evaluate the polynomial at these steps
plot(newT,Y);
  댓글 수: 4
Sam Chak
Sam Chak 2023년 8월 7일
편집: Sam Chak 2023년 8월 7일
Nope, I didn't think too deep. Your strategy is a good one for this case. I was wondering about the mathematical definition of the mean trajectory, as well as if some data smoothing algorithms may work.
Daniel Bengtson
Daniel Bengtson 2023년 8월 8일
I should have thought on it more before posting. You are right to question my answer. Polyfit is just a least squares regression and given that I did not take any steps to enforce an intercept at zero, and that the error between the theoretical mean trajectory and raw signal would be relatively small near zero compared to near t max, it probably isn't as good of a fit as it could have been.

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

추가 답변 (1개)

Image Analyst
Image Analyst 2023년 8월 8일
If you know how many elements are in a period (and you should), then try movmean.

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by