6
$\begingroup$

I am a biologist so apologies for the basic question.

I am trying to get an intuitive understanding of what the coherence between 2 signals actually means. I have read a couple of introductory texts and an idea that keeps coming up is that (roughly) two signals are coherent if you can accurately predict the phase of one given the phase of the other (i.e. if there is a constant phase difference).

But I am getting confused when it comes to thinking about coherence with regards to a particular frequency. It feels like any wave at a particular frequency will have a constant phase difference relative to all waves with the same frequency, but from the explanation in the paragraph above that would mean that coherence should be 1 across every frequency for every signal. I am definitely fundamentally misunderstanding this, if someone could please explain where I'm going wrong that would be very much appreciated!

Sorry again for asking something so simple, I am very new to this!

$\endgroup$

5 Answers 5

5
$\begingroup$

Coherence is a statistical measure that shows the degree that two ergodic signals are related through a linear process (non-linearities and additional noise sources will decrease coherence). It is a real quantity with values between 0 and 1 (where 1 means one signal can be completely established from the other through a linear filter). It is found by the ratio of the cross power spectral density divided by the individual power spectral densities as:

$$C = \frac{|S_{xy}(\omega)|^2}{S_{xx}(\omega)S_{yy}(\omega)}$$

Where $C$: Coherence

$S_{xx}(\omega)$: Power spectral density of signal $x(t)$

$S_{yy}(\omega)$: Power spectral density of signal $y(t)$

$S_{xy}(\omega)$: Cross power spectral density between two signals $x(t)$ and $y(t)$

Consider a simple case where the $y(t)$ is completely defined by the input $x(t)$ passed through a linear transversal system (filter) with impulse response $h(t)$: $$y(t) = x(t)\star h(t) $$

Where $\star$ is the convolution operator. Here the output is the weighted sum of multiple weighted delays of the input, so visually in time $x(t)$ and $y(t)$ could look drastically different. However given this linear relationship specifically, and that there are no other noise sources or other signals introduced that are independent between the two, the coherence will be 1! That is exactly what coherence is, the degree that this holds, and it simply means that there is a least squared solution to make a filter such that we can recover x(t) from y(t) alone (so coherence gives us a measure of how effective a linear equalizer can be).

Here we see how it the coherence = 1 in this case using the formula above:

Given that: $$S_{xy}(\omega) = H(\omega)S_{xx}(\omega)$$

$$S_{yy}(\omega) = |H(\omega)|^2S_{xx}(\omega)$$

The coherence is computed to be:

$$C = \frac{|S_{xy}(\omega)|^2}{S_{xx}(\omega)S_{yy}(\omega)}= \frac{|H(\omega)|^2S_{xx}(\omega)^2}{S_{xx}(\omega)|H(\omega)|^2S_{xx}(\omega)} = 1$$

Coherence is not to be confused with correlation which is another statistical measure of similarity showing directly the linear dependence on a sample by sample basis of input and output. Correlation is given in forms similar to below where we have a sum of conjugate products or integration of conjugate products for the discrete and continuous time domain respectively:

$$corr[n] = \sum x[n]y^*[n]$$ $$corr(t) = \int x(t)y^*(t)dt$$

Correlation and Coherence are related in that the cross power spectral density is the Fourier Transform of the cross-correlation function of x(t) and y(t), which does the correlation function above repeatably for different time delays between x an y:

$$R_{xy}(\tau) = \int x(t)y^*(t-\tau)dt$$

$\endgroup$
2
$\begingroup$

It feels like any wave at a particular frequency will have a constant phase difference relative to all waves with the same frequency, but from the explanation in the paragraph above that would mean that coherence should be 1 across every frequency for every signal.

I think you're falling into the frequency-domain trap. The frequency domain is nice, but it was invented to use when thinking in the time domain is harder. If thinking in the time domain is easier -- don't try to wedge things into the frequency domain, unless you have to for some other part of the problem.

So if you have two signals that are predominantly sinusoidal, and if they're both frequency modulated, then you'll have something like $$s_n(t) = \cos\left( \int \omega_n(t) dt\right)$$ where $\omega_n(t)$ is a random process. If $\omega_1(t)$ exactly equals $\omega_2(t)$ then your signals will be coherent -- even if $\omega_1$ and $\omega_2$ are time-varying. If $\omega_1(t)$ and $\omega_2(t)$ have equal long-term averages, but small differences at any given time, then your signals will show some coherence (depending on how you assign numbers to "small differences" and "some coherence"). If $\omega_1(t)$ and $\omega_2(t)$ are unrelated, then your signals will have no coherence.

But note: this is really flipping hard to analyze in the frequency domain and not too bad to think about in the time domain. So thank M. Fourier for all his hard work, do this analysis in the time domain, and then use the frequency domain the next time you really need it.

$\endgroup$
0
$\begingroup$

I think your understanding in first paragraph is correct. When two signals are coherent, they are 'locked' in phase. The phase of one signal tracks the other.

A signal $x(t)$ can be written as a composite of different single frequency waves (Fourier synthesis). $x(t) = \int X(f)e^{j2\pi ft}$. Imagine another signal whose fourier transform is $X_1(f) = X(f)e^{j\phi}$. Each frequency of second signal is having constant phase difference with respect to first signal. In this case, $x_1(t) = \int X_1(f)e^{j2\pi ft} =\int X(f)e^{j\phi}e^{j2\pi ft} = e^{j\phi}\int X(f)e^{j2\pi ft} = e^{j\phi}x(t)$ having a constant phase difference with respect to $x(t)$. So coherence between two signals will also imply each of the signal frequencies are also coherent.

$\endgroup$
0
$\begingroup$

But I am getting confused when it comes to thinking about coherence with regards to a >particular frequency. It feels like any wave at a particular frequency will have a >constant phase difference relative to all waves with the same frequency, but from the >explanation in the paragraph above that would mean that coherence should be 1 across every >frequency for every signal. I am definitely fundamentally misunderstanding this, if >someone could please explain where I'm going wrong that would be very much appreciated!

There is nothing wrong with your logic here. This is what would happen with two pure sine waves. This is also the reason you will get a coherence of 1 for all frequencies if you don't do some kind of spectral averaging (e.g., averaging multiple estimates of the spectra and cross-spectrum, or averaging over adjacent frequency bins) when estimating the coherence.

As another poster explained at greater length, coherence helps us quantify the extent to which two signals are linearly related at a particular frequency. If there are only two pure sinusoids of the same frequency within a given frequency band, the coherence will be one. But, if one of the time series has multiple sinusoids within a given band, or a sinusoid plus white noise, the behavior in that frequency band will not remain perfectly phase locked to a pure sinusoid.

$\endgroup$
1
  • $\begingroup$ I'm also struggling with a basic understanding of coherence and stumbled upon this post. Suppose two signals $x$ and $y$ can be decomposed so that each has spectral content at 300 Hz and the coherence is .75 there. What does that tell me about the corresponding sinusoid graphs making up the spectral decomposition? The frequencies of the two both 300 so they can only differ in terms of amplitude and horizontal shift along the time-axis. Does the coherence tell me something about the amplitudes and/or shifts? For example, would a coherence of one tell me that the only difference is in amplitude? $\endgroup$
    – fishbacp
    Dec 23, 2022 at 21:37
0
$\begingroup$

Since you are looking for intuitive I'm not going to include any equations. I found very intuitive explanations for coherence here, here and here.

Coherence indicates how closely a pair of signals (x and y) are statistically related. It is an indication of how closely x “sticks to” y. In other words, coherence is how much influence events at x and events at y have on one another.

The coherence graph displays a statistical relationship between two signals at a given frequency range. The coherence of two signals, x and y, depends on the phase difference between the signals. It is a normalized value, so it does not specify if the signals are in or out of phase or what is the difference between them. Instead, a coherence value of 1 indicates that the waveforms’ phase difference is consistent, i.e doesn't change with time, for multiple samples, and a value of 0 means the difference in their phase has changed.

Rather than providing specific phase values, coherence indicates if the phase difference changes for the defined frequency. This information allows to evaluate the relative motion between signals.

Also for an given system, the magnitude squared coherence between input and output will be 1 for all frequencies if the system is LTI. In contrast, if the magnitude squared coherence is less than 1, then it is not LTI. Furthermore, if the magnitude squared coherence is 1 at certain frequencies, then the system is LTI at those frequencies.

Coherence also has very interesting interpretations in mechanical engineering and vibration analysis. See the provided links for more info.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.