Solved – Measures to compute the similarity between two time series whose amplitude is periodic ignoring any phase differences

spectral analysisstatistical significancetime series

Question: Given two time series whose amplitudes are periodic, what measures could i use to quantify the similarity between them ignoring any phase difference?

Specifically, i am looking for measures to quantify the similarity between two time series whose amplitude is an angle (which is periodic) ignoring any differences in phase.

Below is an example of two such time series

Time series representation of the two signals

Notice that the two signals seem quite similar barring the phase difference

Approach so far

Since i want to ignore any phase differences between them, my idea was to compare their power spectrums. Shown below is an overlay of the power spectrums (also in log scale) of the two signals shown above.

Power spectrum of the two signals
Log of power spectrum of the two signals

Notice that their power spectra look quite similar. Would pearson's correlation be a good measure to quantify this similarity?

Another idea i have is to compute the cross-correlation of the two signals in time domain and use its maximum value to quantify their similarity ignoring phase.

But neither of these two approaches account for the periodic nature of the amplitude.

Best Answer

I believe that calculating the coherence would be of use to you.

The coherence at a frequency, $C_{XY}(f)$, between two series, $x(n)$ and $y(n)$, is defined as:

$C_{XY}(f) = \frac{|P_{XY}(f)|^2}{P_{X}(f)P_{Y}(f)}$

Where $P_X(f)$ and $P_Y(f)$ are the power spectrum of the series $x(n)$ and $y(n)$ respectively. $P_{XY}(f)$ is called the cross-spectrum.

Let's say that we calculate the spectrum of $x(n) = x_n$ by first Fourier transforming the windowed data:

$X(f) = \sum_{n=0}^{N-1}h_n x_n e^{-i2\pi fn}$

where $h_n = h(n)$ is the $n^{\text{th}}$ value of the window we are using. This implies that the power spectrum of $x(n)$ is:

$P_{X}(f) = |X(f)|^2$

The cross spectrum is then:

$P_{XY}(f) = |X(f) \cdot Y^{*}(f)|^{1/2}$, where $*$ denotes complex conjugate.

Thus, the coherence is:

$C_{XY}(f) = \frac{|X(f) \cdot Y^{*}(f)|}{|X(f)|^2 |Y(f)|^2}$.

After this, you could calculate the average coherence I suppose - I don't think averaging is the correct approach honestly, I will do some more checking. This is hopefully a start though.

Using a multitaper method for estimating your power spectra is a good idea (Spectrum Estimation and Harmonic Analysis, DJ Thomson, 1982 (paper) or Spectral Analysis for Physical Applications, Pervcival and Walden, 1993 (book)) as you are able to get a much reduced variance for your estimate.

If you decide to go that route, I would suggest checking out: http://www.spectraworks.com/Help/mtmtheory.html for more info.