# Given x,y,z data of a periodic object, calculate the period of the object (if possible)

So the problem I am working on is as such. Given the x,y,z data of a periodic object over time (from the origin in 3d space) (need not be uniform), calculate the period of the object (if the data given is periodic and the calculation is possible).

So the best idea I have been able to come up with so far, is to use some form of interpolation to get a function for the data, but I am not sure how I would go about using the function to calculate the period. Also, if interpolation is the best way forward, would using cubic spline interpolation work?

Finally, since the data given is 3d, and so far all the experience I have is working with 2d data for interpolation, if I was to use cubic splines to interpolate, how would the actual implementation work?

• Is the periodicity of your data over time? Then, do you have 3D data that changes over time (like 4D data)? – nicoguaro Mar 26 '17 at 2:21
• Does it not work to take the (Discrete) Fourier Transform and find the dominant frequency? – KyleW Mar 26 '17 at 4:43
• @nicoguaro yes, I have 3D data that changes over time. Essentially, 4 vectors, of time, x-coord, y-coord, z-coord. – Bob Marley Mar 26 '17 at 18:07

I actually have to do this for very large data sets on occasion. Since my data are usually somewhat uniformly distributed, I've found the following procedure simple and sufficient:

Define: $p \equiv data(t=0)$, $\delta(t) \equiv \lVert data(t) - p \rVert_2$

Then find the inflection points of $\delta(t)$ and measure the $\Delta t$ between them. If $\delta(t)$ at the inflection points is sufficiently small (and the variation of $\Delta t$ between multiple neighboring inflection points) then you can be confident you have a good measurement of the period.

If you have a very non-uniform distribution, where the 2-norm doesn't seem like a good metric, you might interpolate the data as you mention and then follow a similar procedure. Something like a spectral representation, maybe spherical harmonics? Though what works best will depend on the object itself (what is it?).

• For a spline interpolation you could use a built-in Matlab call, then uniformly sample that interpolation and use the method above.
• For a spectral representation you might simply use the normalized basis coefficients in the procedure above.
• So I am a little confused regarding spline interpolation for 3d datasets. Would I have to calculate the euclidean distance at each time measured and use that in my spline interpolation within Matlab (ie. interpolating euclidean distance over time) or is there some better way of interpolating the data given I have vectors t=time, x = x-coordinates, y=y-coordinates, z=z-coordinates. – Bob Marley Mar 26 '17 at 2:19
• Also, what would be the best way of finding the inflection points once I figure out the ideal way of representing the data (interpolating or normalized basis coefficients)? – Bob Marley Apr 2 '17 at 4:49
• To find the inflection points you could just compute a simple forward derivative of the data in time ($d_t \delta(t)$) and find its roots. – Spencer Bryngelson Apr 4 '17 at 20:08

If your data is measured at discrete equal time intervals then you can measure the autocorrelation at different lags. This is the standard correlation between your time series starting at 0 ending at t-p and your time series starting at p ending at t, where t is your number of data points. You can go further by studying partial autocorrelation. Where you have high peaks then you have a dominant period. For acf there are also statistical tests to tell you if the values for acf are significant or are made mostly from noise artifacts.

Those functions works on one dimensional data, but you can use any of x, y or z. This is because your data projected on any axis exhibit the same periods except the situation when your true 3d curve does not lie on a plane perpendicular on one of your axes. As such you can use your findings on some axis and confirm by measuring on other axes.