Why coherence function calculation needs averaging of different segments of the signal?
You can see how it falls out if you work through the simple case of N=2 (I've elided the 1/N for brevity)
\begin{equation}
\frac{(Y_{1}X_{1}^{*}+Y_{2}X_{2}^{*})(X_{1}Y_{1}^{*}+X_{2}Y_{2}^{*})}
{(X_{1}X_{1}^{*}+X_{2}X_{2}^{*})(Y_{1}Y_{1}^{*}+Y_{2}Y_{2}^{*})}
\end{equation}
It should be pretty obvious that there are now some cross products. Multiplying through:
\begin{equation}
\frac
{
X_{1}X_{1}^{*}Y_{1}Y_{1}^{*} + X_{1}^{*}X_{2}Y_{1}Y_{2}^{*} + X_{1}X_{2}^{*}Y_{2}Y_{1}^{*} + X_{2}X_{2}^{*}Y_{2}Y_{2}^{*}
}
{
X_{1}X_{1}^{*}Y_{1}Y_{1}^{*} + X_{1}X_{1}^{*}Y_{2}Y_{2}^{*} + X_{2}X_{2}^{*}Y_{1}Y_{1}^{*} + X_{2}X_{2}^{*}Y_{2}Y_{2}^{*}
}
\end{equation}
The second and third terms of the numerator are no longer the same as the second and third terms of the denominator.