cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

FFTs transfer functions and coherence

Fred_Kohlhepp
23-Emerald I

FFTs transfer functions and coherence

I've seen power spectrum and phase calculations for signals in mathcad. How can I compute cross correlation and coherence functions from FFT's?

Fred Kohlhepp
fkohlhepp@sikorsky.com
12 REPLIES 12
PhilipOakley
5-Regular Member
(To:Fred_Kohlhepp)

On 2/26/2009 1:07:13 PM, fkohlhepp wrote:
>I've seen power spectrum and
>phase calculations for signals
>in mathcad. How can I compute
>cross correlation and
>coherence functions from
>FFT's?
>
>Fred Kohlhepp
>fkohlhepp@sikorsky.com

Cross correlation is just the vectorised multiplication of the two indvidual FFTs, then invert that. Need to make sure both signals are padded enough at each end so that there is not a wrap around. The FFTs must be of a length that is greater than the sum of the lengths of the original signals.

Need to check up on 'coherence'

Philip Oakley

On 2/26/2009 1:07:13 PM, fkohlhepp wrote:
>I've seen power spectrum and
>phase calculations for signals
>in mathcad. How can I compute
>cross correlation and
>coherence functions from
>FFT's?
>
>Fred Kohlhepp
>fkohlhepp@sikorsky.com
_______________________________

I understand "correlation", cross-correlation and coherence maybe some author or in-house wording that are called differently in the literature. Nothing in DAEP, Statistic e-book ... under these two invocations. Interesting: in ORIGINLAB, "coherence" is not in the index but it reports the general "correlation" chapter and what they call "coefficient of determination".

jmG

Mathcad 14 (signal processing, spectral analysis) has a coherence function that does What I'm after (I think.) But how do I relate that function back to frequency?

Fred Kohlhepp
fkohlhepp@sikorsky.com

On 2/28/2009 8:17:05 AM, fkohlhepp wrote:
>Mathcad 14 (signal processing,
>spectral analysis) has a
>coherence function that does
>What I'm after (I think.) But
>how do I relate that function
>back to frequency?
>
>Fred Kohlhepp
>fkohlhepp@sikorsky.com
_______________________

The coherence (Y1,Y2,n,r,W) is a "local observer".

It does not change or otherwise affect the spectral.
If that's what you were looking for.

jmG



On 3/1/2009 1:49:54 AM, jmG wrote:
>On 2/28/2009 8:17:05 AM, fkohlhepp
>wrote:
>>Mathcad 14 (signal processing,
>>spectral analysis) has a
>>coherence function that does
>>What I'm after (I think.) But
>>how do I relate that function
>>back to frequency?
>>
>>Fred Kohlhepp
>>fkohlhepp@sikorsky.com
>_______________________
>
>The coherence (Y1,Y2,n,r,W) is a "local
>observer".
>
>It does not change or otherwise affect
>the spectral.
>If that's what you were looking for.
>
>jmG
>
>
>
I have two data vectors. They happen (this time) to be measurements from two accelerometers on a structure, more often they are a force measurement (from a "shaker") and an accelerometer. We normally look at the transfer function (or frequency response function), so much force produces so much acceleration at a given frequency. We look at coherence (on a spectrum analyzer this is a "built-in" function) to see how much of the acceleration measured is due to the force applied; if there happens to be another force that's creating the acceleration then the coherence will be low, if the acceleration is due mostly to the force, the coherence will be high (close to 1.) If I have an exciter at a fixed frequency (a rotating shaft)the coherence of an accelerometer with that frequency will be high, and it will be low at other frequencies because the exciter isn't putting any power into those frequencies. That, as I understand it, is the usefulness of the coherence function; to determine if two signals share a causal relationship.

So my question is this:
I have two data vectors, samples taken at a fixed sampling frequency for a given length of time. We can develop the FFT of these time histories, and relate the "frequency" of each "bin" by the expression "frq[i := f.sampling * i /N.samples".
The coherence function will calculate the coherence of these two signals, how do I relate that vector of values to frequency?


Fred Kohlhepp
fkohlhepp@sikorsky.com

The response found in two mathematical records must be realized in the real physical world with real objects interacting. There can be no isolated coherence, say, like flying a plane, unless it was struck by birds, for example, and how shouldn't the appearance of birds get in any FFTs of a time series flight box? An FFT from one source can have an outlier in the coefficients from purely mathematical reasons that you interpret as a physical event.

The coherence is a 'distance' measure, so in this case where the sampling is in time, the peaks will be at the common repetition period.

It measures how well the other signal, when delayed the relevant amount, looks just like the original signal.

If there is a nice sine wave present in both, then you would expect there to be a peak in the coherence at the sine wave's period (in samples).

It proably isn't the right measure if you expect a pure sine wave driving frequency and a set of nice sine waves out. However your example suggests that a spectrum is being thrown at the unit under test and you are looking for which bits are amplified, which attenuated, and perhaps where the phase delays are. It will be useful for that.

Wikipedia had some useful stuff on "coherence".

Also why not create (in mathcad) two known test signals and see how the function responds.

I haven't had time to checak but suspect that inex 0 is zero delay, while index 'last' is a delay of -1.

Philip Oakley

The coherence is just the same as the CORR function in MathCad. The math formulas are the same. A more difficult problem is two sets of finite, discreet signals assayed by FFT saperately and the corr of them is 0.0972 and 1.00 on their time axis. A t-test shows a 0.916 fraction that they are alike, 0.084 unalike. But a coherence/corr of the two FFTs is only 0.452655. So there is a difference between the philosophys of probability and coherence.

On 3/2/2009 5:52:49 AM, bones7xx wrote:
>The coherence is just the same
>as the CORR function in
>MathCad. The math formulas
>are the same. A more
>difficult problem is two sets
>of finite, discreet signals
>assayed by FFT saperately and
>the corr of them is 0.0972 and
>1.00 on their time axis. A
>t-test shows a 0.916 fraction
>that they are alike, 0.084
>unalike. But a coherence/corr
>of the two FFTs is only
>0.452655. So there is a
>difference between the
>philosophys of probability and
>coherence.

No! corr(v1,v2) gives a single number.

coherence(v1,v2,n,r,[w]) takes two "timestream" files and returns a vector of values.


Fred Kohlhepp
fkohlhepp@sikorsky.com
PhilipOakley
5-Regular Member
(To:Fred_Kohlhepp)

On 3/2/2009 8:21:19 AM, fkohlhepp wrote:
>On 3/2/2009 5:52:49 AM, bones7xx wrote:
>>The coherence is just the same
>>as the CORR function in
...
>
>No! corr(v1,v2) gives a single number.
>
>coherence(v1,v2,n,r,[w]) takes two
>"timestream" files and returns a vector
>of values.
>
>
>Fred Kohlhepp
>fkohlhepp@sikorsky.com

I think what is being said is that each individual coherence value is a correlation of v1 with v2 shifted by the index (roughly speaking)

Philip Oakley

the description of coherence (vx, vy, n, r, [w]) from the Mathcad site is:

"Returns the coherence of vectors vx and vy. The signal vectors are divided into n overlapping intervals with fraction of overlap r. Each data segment is windowed with taper w."

The length n of the returned vec doesn't need to be the length of vx. vy as I read this. The prep of the data into n pieces seems clear, but I don't know what is done to each pair of the segmented data; compute a cross correlation as that element of the output vector? ?

This calc is based on time slicing the data, and it may have a DFT equivalent in the freq domain. Anyone know more detail about the calculations done by this function?

Lou
Fred_Kohlhepp
23-Emerald I
(To:LouP)

On 3/3/2009 8:35:37 AM, lpoulo wrote:

>The length n of the returned
>vec doesn't need to be the
>length of vx. vy as I read
>this.

The retuned data is always shorter than the input data. vx and vy are time stream samples. If you take an FFT, you get a data vector of the same length as they are. If you run coherence, you get a shorter vector; the length depends on the number of slices and the overlap.



Fred Kohlhepp
fkohlhepp@sikorsky.com
Top Tags