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$$