# What is meant by “correlation” when referring to spectral coherence

I've been reading that coherence measures the correlation between two waves as a function of frequency. I also read that difference in phase does not mean less coherence at a given frequency, and that amplitude is also not a factor. Some explanations say that its is a measure of the shift in phase. As I understand it, a shift in phase requires a shift in frequency, but coherence is the measure of correlation at a given frequency. So I guess what I want to know is this:

If I've taken the Fourier transform of two waves, and am looking to see how they are correlated in the frequency domain, what am I actually measuring?

EDIT: I'm a biologist, and my knowledge of digital signal processing is pretty basic. I'm trying to pick this stuff up on the fly. So intuitive explanations, if possible, would be greatly appreciated.

• Have you seen this or this? – Tendero Nov 18 '16 at 0:38
• I think you should differentiate between the FT of a signal an the FT of the auto/cross-correlation of a random process. – msm Nov 18 '16 at 2:49

## 3 Answers

The coherence function, as used in signal processing, measures the normalized correlation between to power spectra:

$$C_{xy}(f) = \frac{|G_{xy}(f)|^2}{G_{xx}(f) G_{yy}(f)}$$

where $G_{xx}$ is the power spectral density (PSD) of the signal $x(t)$, $G_{yy}$ is the PSD of $y(t)$, and $G_{xy}$ is the cross-spectral density (CSD) of $x(t)$ and $y(t)$.

The CSD is computed as the Fourier transform of the cross correlation of $x$ and $y$:

$$R_{xy}(\tau) = \operatorname{E} \left[ x(t) y(t + \tau) \right]$$ $$G_{xy}(f) = \mathcal{F} \left[ R_{xy} (\tau) \right]$$

You can think of the CSD as measuring "hidden periodicities" in the cross correlation, just like the PSD measures periodicities in the autocorrelation. (This is where the name for the "periodogram" PSD estimator comes from.)

Incidentally, if the cross-correlation has harmonic content at some frequency $f$, you can think of the signals being correlated at that frequency.

• Thank you! This is a really great explanation. Very concise. – matt vt Nov 18 '16 at 16:13

The above explanation is apt. You can also understand in this way : If the coherence value at a frequency 'f' is greater than 0.5 , then signals are correlated at 'f'

When you say "I also read that difference in phase does not mean less coherence at a given frequency", you are right. But "As I understand it, a shift in phase requires a shift in frequency" is not correct. There is a misunderstanding here.

As far as your exact question is concerned, "if I've taken the Fourier transform of two waves, and am looking to see how they are correlated in the frequency domain, what am I actually measuring?", it can be answered better without many equations. Since you are a biologist, it might be a better approach for you.

Correlation in frequency domain: There are two things to consider at each frequency, (1) amplitude and (2) phase.

First, when talking about normalized correlation as described by @Carlos, then amplitude does not play a role as it appears in the denominator as well. Remember that it does have an effect in correlation, just not in normalized correlation.

Secondly, if you have two signals X and Y, then spectral coherence tells us how their phases are related at each frequency. Suppose that for every f, if X has a phase of $\theta$ and Y also has a phase of $\theta$, then in their cross spectral density, $\theta$ cancels out because

1. In multiplication of two signals in frequency domain, phases are added together.
2. Conjugate in one of those two signals (see definition of cross spectral density) reverses $\theta$ to $-\theta$.

Then, their amplitudes are added in full coherence with all the energy in $I$ part and zero energy in $Q$ part. See the figure below. For different phases $\theta_X$ and $\theta_Y$, this does not happen. To see this in concept in figures in more detail, you can read my article in full.