# What is a correct way to calculate the correlation of a phase?

To do a correlation or an autocorrelation of a magnitude or a complex number is straightforward. But what if you want to calculate the correlation of a phase? The problem being that, if your phases run from 0 to 2$\pi$ for example, $2\pi+\epsilon$ is very close to $2\pi-\epsilon$, but will not look that way at all if I just simply calculate $\int \phi(t) \phi(t+\tau) dt$. What is a correct way to handle the numerical discontinuity? Thanks.

-
You might want to look at directional statistics. I'd consider the autocorrelation of $\exp(\mathrm i\phi(t))\,\mathrm dt$. –  joriki Jun 3 '13 at 20:13