Oscillation extremas from empirical data
- October 31, 2025
- 3 replies
- 711 views
What I have here are two measured displacements over the same time with an equal interval of 1 second. Both oscillations tend to approach the resting asymptote, which is the same for both. The first one at the end of measurement didnt manage to approach, but the second did.
For my task, I had to find periods and amplitudes of oscillations. To get periods, I simply used the difference between two interceptions of oscillation with asymptote via root() function. One of the arguments for this function is a guess points between which this interception should be met. For those points I pick local extremas (or peaks shortly). To get them, I need to know the first derivative of the oscillation function and look for the points where derivative becomes zero. But in my case, I have only empirical data, which I have to use to get proper constants a and w for the oscillation equation.
Based on this, I created splines for both data sets, and started taking derivatives to find a slope.
To get local extremas, I used lookup() func (it cannot work with range, had to use vector form as inputs) to get the points where slope is almost equal to zero. As a result of discrete vector usage, I got multiple points of peak in each extrema, had to pick the most distant from the asymptote and remove others. For that purpose I created a custom trimmer() function which did a good job with the first data set, but fails with the second, where oscillations almost approached asymptote.
It seems that after trimming, all of residual untrimmed points tend to be on the right side of the actual peak. Because of that, my interception evaluation (that one with root() func) for second data set fails.
Can someone share their ideas on why it happens and how to fix that?
Legacy Mathcad 15 M050

