# Magnitude-squared Coherence calculation inconsistence

I have to calculate the magnitude-squared coherence (MSC) between two signal. However, using a routine that uses only one taper (or no tapers at all) my result is always 1, despite the signals are clearly different. This doesn't happen if I use more than one taper. Searching a explication for this abnormal result, I come with a confusing characteristic of the MSC itself. The definition that I'm using is this

$$\gamma^2(\omega)=\frac{ |X(\omega)\overline{Y(\omega)}| ^2}{(X(\omega)\overline{X(\omega)}).(Y(\omega)\overline{Y(\omega)}) }$$

X and Y are the Fourier tranformed signals that depends on the frequency $\omega$. However, if you take any two complex numbers as the value of these functions in some fixed frequency, the result is always 1. Knowing that $|z|^2=z\overline{z}$ then

$$\gamma^2=\frac{(X\overline{Y})\overline{(X\overline{Y})} }{X\overline{X}Y\overline{Y}}=\frac{(X\overline{Y})(\overline{X}Y) }{X\overline{X}Y\overline{Y}}=\frac{X\overline{X}Y\overline{Y} }{X\overline{X}Y\overline{Y}}=1$$

Certainly there must be something I must be misunderstanding but I can't see what it is. Can anyone explain to me what is the catch?

Edit: I'm gonna use some matlab links as trustable sources. Definition of MS-coherence

http://www.mathworks.com/help/signal/ref/mscohere.html

definition of cross power spectral density

http://www.mathworks.com/help/signal/ref/cpsd.html

(the power spectral density is the " auto -cross" spectral density, i.e. the Fourier transform of the autocorrelation) A important property of the Fourier transform of the cross correlation can be found on wikipedia under "properties".

Another source can be found googling under the name "Coherence function in biomedical signal processing". Sorry i didn't post the direct links here, I don't have enough "reputation"

• It would help if you would include a reference to where you got your definition of $\gamma^2(\omega)$. Measures of coherence are generally based on the Cauchy-Schwarz Inequality which asserts that $$|\langle x,y\rangle |^2 \leq \langle x,x \rangle\cdot\langle y,y\rangle$$ with equality when $x = \lambda y$ where $\lambda$ is constant. In the context of coherence, equality is perfect coherence. But your $\gamma^2(\omega)$ is not quite the ratio of the two sides of the Cauchy-Schwarz Inequality. – Dilip Sarwate Jul 23 '13 at 12:43
• Note the expectation operators in your definition of the coherence. You can't separate the $x$ and $y$ terms in the cross-spectral density in order to cancel with the denominator, as the expected value of their product is taken. – Jason R Jul 23 '13 at 16:05
• That's true. However I forgot to mention that i'm working with stationary random processes so the spectral densities and the correlation functions are Fourier tranform pairs. And the Fourier transform of the correlation functions can be written as the multiplication of the Fourier tranform of the individual functions (with one of the conjugated), as can be found in Wikipedia – Tojur Jul 23 '13 at 16:19
• The issue is that for random processes, it is not true that $X(\omega)$ and $Y(\omega)$ are the Fourier transforms of the processes (in fact, Fourier transform of a random process the way you seem to be thinking about it makes no sense whatsoever except as a complex-valued process) and that the crosspower spectral density $S_{X,Y}(\omega)$ equals $X(\omega)Y(\omega)$ and the power spectral density $S_X(\omega)$ is $|X(\omega)|^2 = X(\omega)X^*(\omega)$. – Dilip Sarwate Jul 23 '13 at 19:43
• I'm not sure that I understand your definition of "random process". In signal processing a stationary random process "is a collection of time-history records having statistical properties that are invariant to translations of time" (from 'random data - analysis and measurement procedures'). In fact you can check as this concept is used to state some properties in the following link en.wikipedia.org/wiki/Spectral_density – Tojur Jul 23 '13 at 22:30