This is the trajectory of a pedestrian moving in jam

As you can see, his/her head perform an oscillation-like movement. So not a perfect sinus curve but neither a line.
Is it possible to define for this irregular curve an "amplitude" and a "frequency"?
UPDATE:
So far I tried two different approaches:
The results are as follows:

The problem that I see with the RDP is the free parameter dist. low values (means more details) imply oscillations in the resulting trajectories. So I'm forced to be careful with this parameter. Besides, the splined curve is much more smoother.
What do you think?
There is no absolute correct way to do this. Below is just one way.
Let's start with the assumption/claim that people generally intend to walk in straight lines. So you could use the Ramer-Douglas-Peucker algorithm to estimate the intended path of the person with a small set of line segments. (There is a Python implementation of the algorithm here.)
Then generate the distances of the true data points from the line segments.
timeseries = []
for point in points:
timeseries.append(
min((distance between point and segment)
for segment in segments))
This array of distances is a timeseries. You could then take the root-mean-squared of the timeseries as a measure of amplitude, and take a Fourier transform to find its dominant frequency (or frequencies).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With