Stan Pawlukiewicz
Guest
|
Posted:
Thu Dec 01, 2005 5:17 pm Post subject:
Re: Coherence Calculation |
|
|
David L. Jones wrote:
| Quote: | Stan Pawlukiewicz wrote:
David L. Jones wrote:
Peter K. wrote:
David L. Jones wrote:
A rather unusual question...
I am looking for a way to calculate the coherence value of two signals
which are several cycles of a fixed frequency sinusoidal like waveform.
i.e. I need a single value in the range 0-1 for the coherence of the
two waveforms.
Using coherence on pure (or close-to-pure) sinusoids is usually a bad
idea -- because, if the sinusoids are of the same frequency (i.e. are
phase or frequency locked), they'll be "completely coherent", and if
they're not they won't be.
Yes, I am aware it's not the best of ideas, as coherence is usually
done and calculated over a frequency domain with broadband data.
The two waveforms will in practice not be pure sinusoids, but will have
minor noise and distortion components, so in theory a coherence
calculation is possible. In fact, the goal is to have them as
completely coherent as possible (as it is for most systems) i.e. no
noise or distortion is added to the system, and all of the output
signal is due entirely to the input signal.
I have tried calculating the coherence using the standard formula:
|Sxy|^2 / (Sxx.Syy)
where Sxy is the Cross Power Spectrum and Sxx and Syy are the AutoPower
Spectrums
and then extracting the value of the single frequency I am interesed in
from the frequency domain response.
But the coherence specturm calcuation using this technique is only
valid with averaged data samples, and I only have *one* set of sampled
data for each waveform, so I always get a result of 1.0 regardless of
the actual coherence between the two waveforms.
I don't think it's because you only have one set of data, I think it's
because you're only looking at one frequency --- that of the sinusoids
of interest.
No, it's the same over the entire frequency domain. The standard
coherence function as presented relies on averaging. If you have
calculate coherence with no averaging you get a result of 1.0 in every
frequency bin. This is why every dynamic signal analyser will not allow
you to display coherence without turning on averaging.
Does anyone know of a way to calculate coherence, or a "coherence like"
result for *non-averaged* data that gives a result from 0 to 1 for two
similar sine waves?
Start back at square one: tell us why you're really interested in the
sine waves! :-)
For mostly political reasons (don't ask!) I require a "coherence"
number of 0 to 1 to indicate the "quality" of one waveform compared to
a reference.
The standard way to do this is with a coherence function, but in this
case I do not have the averaged data sets available to do this usign
the standard technique.
In the end I may have to compare the signals in the time domain instead
of using the coherence function in the frequency domain. I have a way
to do this to give a 0 to 1 "coherence like" number, but I am wondering
if anyone knows how to do it in the frequency domain using a coherence
function?
I know there are many other ways to compare two waveforms, but I need a
0 to 1 "coherence" indication display.
In Matlab
coh=rand;
;)
In Labwindows/CVI:
coherence=Random(0.8,1.0);
Tempting, very tempting! ;-)
The stupid thing is, I could most likely get away with it, having just
shifted our managerial focus to being "results driven"!
Dave :)
|
Have you looked at one of the Bendat and Piersol books, like Random
Data? Most of the stuff they do is vibration analysis and I do recall
they cover coherence in some detail. |
|