PDA

View Full Version : Question regarding Coherence


bdeen
08-12-2008, 01:02 AM
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

John
08-12-2008, 02:09 AM
On Aug 11, 8:02 pm, bdeen <[email protected]> wrote:
> I have a question regarding the coherence function (defined, e.g., athttp://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--seehttp://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

It is not equal to one if you average the FFTs first with overlap, as
in Welch's method.

John

glen herrmannsfeldt
08-12-2008, 03:22 AM
bdeen 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.

I believe this is the transform equivalent of the normalized dot product.

(x dot y) / sqrt( (x dot x) (y dot y) )

It is 1 if x equals y.

For coherence, it is also 1 if x and y are equal.
If x and y are similar, close to the same frequency but
not exactly, on average the cross correlation will be zero.

Light sources have a coherence time and coherence length, over
which they can be considered coherent. Long for lasers,
short (but not zero) for incandescent lamps.

-- glen

bdeen
08-12-2008, 04:00 AM
On Aug 11, 9:09 pm, John <[email protected]> wrote:
> On Aug 11, 8:02 pm, bdeen <[email protected]> wrote:
>
>
>
> > I have a question regarding the coherence function (defined, e.g., athttp://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--seehttp://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
>
> It is not equal to one if you average the FFTs first with overlap, as
> in Welch's method.
>
> John

I think I see what you mean. So, is it the case that coherence is
only a meaningful quantity when the Fourier transforms at hand are not
calculated exactly, but approximated using something like Welch's
method? If this is true, it seems strange that most textbooks and
websites that I have seen introduce the coherence function purely with
its formal definition, without mentioning approximation techniques
used to calculate it...Generally, it seems rather strange to define a
quantity such that it is only meaningful when not exactly calculated.

In any case, I now have a new question...How exactly are high and low
coherence to be interpreted, given that no interpretation is implied
by the formal definition alone, without conditions on how the Fourier
transforms are calculated? I believe that high coherence should
correspond to a consistent phase difference between the two signals at
a given frequency (i.e. a phase difference that remains constant over
time), but I lack a rigorous understanding of this, insofar as I know
little about FT approximation methods.

bdeen
08-12-2008, 04:01 AM
On Aug 11, 9:09 pm, John <[email protected]> wrote:
> On Aug 11, 8:02 pm, bdeen <[email protected]> wrote:
>
>
>
> > I have a question regarding the coherence function (defined, e.g., athttp://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--seehttp://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
>
> It is not equal to one if you average the FFTs first with overlap, as
> in Welch's method.
>
> John

I think I see what you mean. So, is it the case that coherence is
only a meaningful quantity when the Fourier transforms at hand are not
calculated exactly, but approximated using something like Welch's
method? If this is true, it seems strange that most textbooks and
websites that I have seen introduce the coherence function purely with
its formal definition, without mentioning approximation techniques
used to calculate it...Generally, it seems rather strange to define a
quantity such that it is only meaningful when not exactly calculated.

In any case, I now have a new question...How exactly are high and low
coherence to be interpreted, given that no interpretation is implied
by the formal definition alone, without conditions on how the Fourier
transforms are calculated? I believe that high coherence should
correspond to a consistent phase difference between the two signals at
a given frequency (i.e. a phase difference that remains constant over
time), but I lack a rigorous understanding of this, insofar as I know
little about FT approximation methods.

glen herrmannsfeldt
08-12-2008, 05:55 AM
bdeen wrote:
(snip)

> I think I see what you mean. So, is it the case that coherence is
> only a meaningful quantity when the Fourier transforms at hand are not
> calculated exactly, but approximated using something like Welch's
> method? If this is true, it seems strange that most textbooks and
> websites that I have seen introduce the coherence function purely with
> its formal definition, without mentioning approximation techniques
> used to calculate it...Generally, it seems rather strange to define a
> quantity such that it is only meaningful when not exactly calculated.

I suppose that sounds right. It is really only useful for
approximate signals. In laser experiments, you sometimes determine
the coherence between two beams from the same laser (beam splitter)
with different path lengths. Incoherence is due to randomness
in the emission process. Ideally, all atoms are exactly the
same, but in a real system there is randomness. (Gas atoms
colliding or lattice vibrations in a crystal.)

> In any case, I now have a new question...How exactly are high and low
> coherence to be interpreted, given that no interpretation is implied
> by the formal definition alone, without conditions on how the Fourier
> transforms are calculated? I believe that high coherence should
> correspond to a consistent phase difference between the two signals at
> a given frequency (i.e. a phase difference that remains constant over
> time), but I lack a rigorous understanding of this, insofar as I know
> little about FT approximation methods.

In laser experiments, it gives the possible strength of
an interference pattern. It is actually the time average
that generates the incoherence. A single photon will be
coherent with itself. Another reason for approximations.

-- glen

08-12-2008, 10:26 AM
On Aug 12, 3:01 pm, bdeen <[email protected]> wrote:
> On Aug 11, 9:09 pm, John <[email protected]> wrote:
>
>
>
> > On Aug 11, 8:02 pm, bdeen <[email protected]> wrote:
>
> > > I have a question regarding the coherence function (defined, e.g., athttp://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--seehttp://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
>
> > It is not equal to one if you average the FFTs first with overlap, as
> > in Welch's method.
>
> > John
>
> I think I see what you mean. So, is it the case that coherence is
> only a meaningful quantity when the Fourier transforms at hand are not
> calculated exactly, but approximated using something like Welch's
> method? If this is true, it seems strange that most textbooks and
> websites that I have seen introduce the coherence function purely with
> its formal definition, without mentioning approximation techniques
> used to calculate it...Generally, it seems rather strange to define a
> quantity such that it is only meaningful when not exactly calculated.
>
> In any case, I now have a new question...How exactly are high and low
> coherence to be interpreted, given that no interpretation is implied
> by the formal definition alone, without conditions on how the Fourier
> transforms are calculated? I believe that high coherence should
> correspond to a consistent phase difference between the two signals at
> a given frequency (i.e. a phase difference that remains constant over
> time), but I lack a rigorous understanding of this, insofar as I know
> little about FT approximation methods.

If you take a sine wave and work out the coherence you get 1 all the
time. In fact for any signal where you work out the FFT exactly
and not via averaging. This can be confusing for sure and it is not
always pointed out.

K.

Rune Allnor
08-12-2008, 11:55 AM
On 12 Aug, 02:02, bdeen <[email protected]> wrote:
> I have a question regarding the coherence function (defined, e.g., athttp://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.

I investigated these questions some time ago:

http://groups.google.no/group/comp.dsp/msg/f6e25e66551ff73d?hl=no

The trick is to apply non-rectangular windows and bias functions
to the correlation functions before computing the coherence.

>*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--seehttp://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?

These are statistichal considerations. It is not the FTs of the
signals
that are equal; it is the *expected* FTs of the signals that are
equal.
Expectations are taken over every possible realization of the process
and at every possible time. In a perfect world there will be
differences
between realizations which don't show up in the manipulations of
expectations.

What you have to play with is *one* realization, and the FFT is a
deterministic provcedure, and as you say, if you do the maths
you find that Cxy(f) == 1, which isn't very useful.

It seems to me that the purpose of the window functions in these
computations is to 'break the FFT free' from the deterministic
constraints. The net effect of the window functions is to
mess up the deterministic analysis enough that the results
of the (deterministic) computations become 'quasi random'
in tune with the gist of the statistichal nature of the context.

Mind you, the interpretation of these resutls are my very
personal take on the situation! Don't expect to find such
arguments or interpretations elsewhere (or even that other
people agree with me)!

Rune

Scott Seidman
08-12-2008, 02:03 PM
bdeen <[email protected]> wrote in news:72fbe007-820d-40c8-b062-
[email protected]:

> ow exactly are high and low
> coherence to be interpreted,

A perfectly linear noise-free relationship between input and output will
yield unity coherence. Both noise and non-linearity decrease coherence.
If you do something like transfer function estimates, you can use coherence
and the number of epochs you used to put a confidence interval around your
estimates. Highly recommend Bendat and Piersol.


--
Scott
Reverse name to reply

TVcommercials
08-13-2008, 04:25 AM
>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 yo
apply the trick that Wikipedia link shows, the coherence function wil
reduce to C_xy(w) = R_x^{*}(w) * R_y^{*}(w), that is, the product of th
complex conjugates of the autocorrelations of x and y. This may very wel
be zero at times.

Hope that helps! Let me know if you need more clarifications!

bdeen
08-13-2008, 05:36 AM
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.

glen herrmannsfeldt
08-13-2008, 09:56 PM
bdeen wrote:
(snip)

> 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.)

Remove the "at a given frequency" and I agree.

> 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 think it depends on what you mean by "two fixed signals".

In optics, it is often the result of a beam splitter on
a signal laser. You can also measure coherence between two
different lasers sufficiently well tuned. (Be careful of
phase locking if part of one beam can get into the other laser.)

How about coherence of radio signals, either delayed versions
of the same signal, or from two different (on the same
carrier frequency) stations?

Two unrelated sources measured over a sufficiently long
time should have zero coherence.

-- glen