I have a question about the computation of coherence between two signals with Welch's method.
The two signals are relatively short (e.g. 256 samples) and I would like as correct an estimate of shared frequencies between the signals as possible.
I am aware that I need to average over more than one segment of data for meaningful results and that overlapping segments will improve accuracy. Computational effort in the computation is not an issue, so I am using $noverlap = nseg-1$. Acquiring more samples is not possible.

The coherence is computed as $C_{xy} = \frac{|G_{xy}|^2}{G_{xx} G_{yy}}$ where $G_{xy}$ is the Cross-Spectral Density and $G_{xx}$ and $G_{yy}$ are the Power Spectral Densities of both signals, respectively.

My question is:
What is the optimal length of segments?
nseg=ndata (no averaging) leads to $C_{xy} = 1$ whereas a too small value of nseg leads to insufficient frequency resolution.
Is there any value for nseg for which an optimal compromise between sufficient averaging and frequency resolution can be found?

Both theoretical and best-practice suggestions would be appreciated!


There is good news and bad news. You are actually showing magnitude squared coherence(MSC). There is a very complete treatment of MSC, including closed form equations for the sample MSC as a function of independent samples. There is also a discussion on overlap in:

    G. C. Carter, “Coherence and time delay estimation,”
 Proceedings of the IEEE, vol. 75, no. 2, pp. 236–255, 1987

The bad news is in the plot, which is the sample pdf for MSC where the true MSC is .3, in a single bin where the legend denotes the number of independent terms. If you want 256 frequency bins, you really need around $256^2$ data points.

enter image description here

You might want to look up the paper and note any recent citations where there is some scheme to reduce the amount of data you need, but 256 points is not anywhere near enough.

  • $\begingroup$ Thanks for the answer and the link to the paper. It seems to state the exact problem I was describing in the introduction. However, if I understand correctly the equations given are valid for MSC estimation without overlap. This is actually done in a paper by Bortel and Sovka "Approximation of statistical distribution of magnitude squared coherence estimated with segment overlapping". A follow-up question: Does it help to increase the sampling frequency? This would increase the number of used samples without requiring to collect data over longer time periods. $\endgroup$ Apr 17 '18 at 6:17
  • $\begingroup$ If it did, I doubt by X 256. $\endgroup$
    – user28715
    Apr 17 '18 at 10:23
  • $\begingroup$ invention is often the child of desperation, there is “boot strapping” $\endgroup$
    – user28715
    Apr 17 '18 at 10:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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