Solved – Characterizing periodicity level of signal

mathematicasignal processingtime series

What are some good ways of quantitatively characterizing the periodicity level of an approximately periodic $f(t), t \in \mathbb{R}$ signal?

I need this to tell if the output of some system is periodic or not, and to be able to decide the output of which system (out of a given set) is "more" periodic (approximates a perfectly periodic signal better).

I'm interested both in purely mathematical definitions for $-\infty < t < \infty$, and in practical ways of calculating this periodicity measure for a finite and time-discretized dataset. (Note that I expect that a useful measures might give higher periodicity for longer samples of the same signal for obvious reasons—but I'd like something that works for a series of any length.) The measure should (theoretically) be the same for infinitely long perfectly periodic signals, regardless of signal shape.

EDIT: Sample signals: http://ge.tt/91Zniy9

These signals are always between 0 and 1. I realized that the amplitude is also very relevant for my particular applications (very low amplitude signals should not be considered "periodic"), but any solution is easily modified to include this. I'm mentioning it to point out that solutions that are explicitly amplitude-dependent are also useful.

Best Answer

Try using recurrence plot or perform a Fourier transform.

  • Recurrence plot

In the first case, the periodicity is translated to equally spaced lines with the slope 1 (and $R(t,t'+T) = R(t,t')$). This method is more robust, and easier to visualize, than the one below.

Then you can try to detect lines from the plot. E.g.:

  • Approach 1: Subtract the diagonal and calculate fractal dimension by box counting. The result, which is in the range of $[0,2]$, is 1 for a periodic signal, but not only for it.

  • Approach 2: Rotate by $45^\circ$ (or rather - take subimage rotated by $45^\circ$) and perform the Singluar Value Decomposition - then $\lambda_0/\sum_i \lambda_i$ (where $\lambda_0$ is the largest singular value) is an easy (but I guess not that robust) measure of periodicity (closer to one, the more periodic).

There are other methods for detection of lines (e.g. Radon transform) but here they seem to be using a canon to kill a fly.

  • Fourier transform

In the second case, for a periodic function its Fourier transform $\tilde{f}$ is a sum of equally spaced Dirac delta peaks: $$\tilde{f}(\omega) = \sum_{k=-\infty}^\infty a_k \delta(\omega - k \omega_0).$$ Of course for every practical data it will be smeared. If you want a quantification then $\int |\tilde{f}(\omega)|^4 d\omega$ may work (or use Shannon/Renyi entropy) - the larger it is, the more periodic is the function.

EDIT: Edited considerably to give numbers characterizing periodicity.

Related Question