08-09-2005
04:57 AM
- last edited on
07-17-2026
08:11 PM
by
Content Cleaner
Hello,
I am trying to calculate the coherence of a stimulus and response signal using the Network Functions (avg) VI's. The problem is that I always get a coherence of "1" at all frequencies. This problem is already known (see KnowledgeBase document: Why is the Network Functions (avg) VI's Coherence Function Output "1"? [link removed; article no longer available]).
My trouble is that the described solution (-> the stimulus and response input matrices need to have at least two rows to get non-unity coherence values) doesn't help me much, because I only have one array of stimulus data and one array of response values.
Thus, how can I fullfil the 'coherence-criteria' to input at least two rows of data each when I just have one row of data each?
Any hint or idea is very much appreciated. Thanks!
Horst
08-09-2005 07:28 AM
F(x) F*(x) |F(x)|^2
Sxx = ------ * ------- = ---------- (no phase information)
N N N^2
F(y) F*(x)
Sxy = ------ * -------
N N
Cross power spectrum Sxy
Transfer function = ------------------------ = -----
Power spectrum Sxx
| Sxy | ^2
Coherence = -------------
Sxx * Syy
where:
F(x) is the complex Fourier transform of the time domain signal x, and
F*(x) is the complex conjugate of the Fourier transform of x, and
N is the number of points in x.
Note that SXX is the magnitude squared. It is faster to compute the square of the magnitude than it is to compute the magnitude. Although the complex-to-polar VI would look simpler on the diagram, it would take longer since it computes the magnitude proper, (an extra square-root operation), and it computes the angle (extra arc-tangent operations).
Since N^2 is a term in both Sxy and Sxx, and since we are dividing one by the other, we do not need to explicitly divide by N^2; it is cancelled automatically.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
08-09-2005 12:15 PM
08-31-2005 12:01 PM
Hi,
In this case did you manage to calculate the coherence using the power/cross power spectrum vi blocks?
08-31-2005 12:34 PM
Blog for (mostly LabVIEW) programmers: Tips And Tricks
08-31-2005 12:35 PM
Blog for (mostly LabVIEW) programmers: Tips And Tricks