On Aug 12, 11:25 pm, "TVcommercials" <
[email protected]> wrote:
> >I have a question regarding the coherence function (defined, e.g., at
> >http://www.dsprelated.com/dspbooks/mdft/Coherence_Function.html). The
> >coherence between two signals (at a frequency f) is the squared norm
> >of the cross spectral density of the signals at frequency f, divided
> >by the product of the power spectral densities of each signal at
> >frequency f; in other words, the squared Fourier transform of the
> >cross correlation, divided by the product of the Fourier transforms of
> >each autocorrelation. I am having trouble understanding when this
> >quantity would not be equal to 1. Applying the fact that the Fourier
> >transform of a cross correlation of two signals is equal to the
> >product of the Fourier transforms of each signal (where the first
> >Fourier coefficient in the product is conjugated--see
> >http://en.wikipedia.org/wiki/Cross_correlation#Properties), it seems
> >the numerator in the coherence function will always be equal to the
> >denominator. Am I missing something?
>
> >Thanks,
>
> >Ben
>
> I think if you work out the math, you can see that is not the case. If you
> apply the trick that Wikipedia link shows, the coherence function will
> reduce to C_xy(w) = R_x^{*}(w) * R_y^{*}(w), that is, the product of the
> complex conjugates of the autocorrelations of x and y. This may very well
> be zero at times.
>
> Hope that helps! Let me know if you need more clarifications!
TVCommercials: I'm not sure how you obtained this result. Here's my
derivation...say that "x#y" is the cross correlation of functions x
and y, for lack of a better convention, and let F[x](f) be the Fourier
transform of function x, at frequency f. Cxy(f) is the coherence
between x and y at frequency f, and |...|^2 denotes squared complex
norm. And ^{*} is conjugation as per your notation.
Cxy(f) = | F[x#y](f) |^2 / ( F[x#x](f) * F[y#y](f) ) = | F[x](f)^{*}
* F[y](f) |^2 / ( | F[x](f) |^2 * | F[y](f) |^2 ) = ( | F[x](f) |^2
* | F[y](f) |^2 ) / ( | F[x](f) |^2 * | F[y](f) |^2 ) = 1.
The second equality employs the fact from wikipedia. So it is pretty
simple to see that if one uses exactly calculated Fourier coefficients
for fixed signals x and y, Cxy(f) will always be 1. Hopefully the
awkward notation didn't obscure things.
Gleaning tidbits from multiple responses, it would seem that coherence
can be less than one when one calculates not just a single, exact
cross spectral density coefficient, but rather an expectation,
averaged over realizations of a process or over time. Averaging
multiple cross spectral density coefficients, they will sum to
something small if they are all randomly oriented in the complex
plane, but if they are similarly oriented, IE if there is a consistent
phase relationship between the two signals at the frequency in
question, they will average to a nonzero value. So coherence is a
measure of the consistency of the phase relation between two signals
at a given frequency, over realizations or over time? (It is clear
that noise will reduce this consistency.)
My problem, still, is how to precisely understand the meaning of a
coherence measure between two fixed signals, rather than stochastic
processes of which we can obtain multiple realizations. I suppose
this makes sense if the cross spectral density coefficients are
computed by averaging coefficients at different points in time, but is
this indeed how one normally finds coherence between two fixed
signals? I'm using a software package (EEGLAB, "crossf" function)
whose documentation suggests that it simply uses an FFT or STFT to
calculate cross spectral densities, but I've certainly been able to
obtain non-unit values of coherence (in fact, I often get coherence
plots that are almost everywhere zero). Perhaps it does have
something to do with the window function being applied to the cross
correlation before FT-ing, but this seems rather hard to interpret.