# 18.7.2 Algorithms (Coherence)

Power spectral density is the Fourier transform of correlation. From the discrete correlation theorem, we know that the Fourier transform of the correlation of two signals is equal to the product of a Fourier transform of one signal and a conjugated Fourier transform of the other. Therefore, power spectral density can be calculated with a Fourier transform. Additionally, the cross power density of two signals, x and y, can be computed as follows:

$P_{xy}(f)=YX^{*}\,\!$

where X and Y are the Fourier transform of x and y respectively, and * denotes the complex conjugation.

Similarly, auto power density can be computed as follows:

$P_{xx}(f)=XX^{*}\,\!$

Thus, the computation of coherence can be rewritten as follows:

$C_{xy}(f)=\frac{\left| YX^{*}\right| ^2}{XX^{*}YY^{*}}\,\!$

The input signals, x and y, are divided into overlapping sections. The coherence of each section is then computed using the above equation.

Automatic Computation of Sampling Interval

When <Auto> is selected for Sampling Interval, the sampling interval needed in the computation is computed automatically by Origin.

The automatically computed sampling interval is the average increment of the time sequence, which is usually from the X column associated with the input signal. If there is no associated X column, the row numbers will be used. Note that if Origin fails to get the average increment, the sampling interval will be set to 1.

Windows

Specifies the window type used by FFT. The default option is Hanning.

• Rectangle
Rectangular window:
$w[n] = \begin{cases} 1, & \mbox{if }0 \leq n \leq N-1 \\ 0, & \mbox{otherwise } \end{cases}$
• Welch
Welch window
$w[n]=1-\left[ \frac{n-\frac 12(N-1)}{\frac 12(N+1)}\right] ^2\,\!$
• Triangular
Triangular window
$w[n]=\frac 2N\left[ \frac N2-\left| n-\frac N2\right| \right] \,\!$
• Bartlett
Bartlett window
$w[n]=\frac 2{N-1}\left[ \frac{N-1}2-\left| n-\frac{N-1}2\right| \right] \,\!$
• Hanning
Hann Window
$w[n]=\frac 12\left[ 1-\cos (\frac{2\pi n}{N-1})\right] \,\!$
• Hamming
Hamming window:
$w[n]=0.54-0.46\cos (\frac{2\pi n}{N-1}) \,\!$
• Blackman
Blackman window
$w[n]=0.42-0.5\cos (\frac{w\pi n}{N-1})+0.08\cos (\frac{4\pi n}{N-1}) \,\!$
• Gaussian
Gaussian window:
$w[n]=exp(0.5\left( \frac{Alpha(n-\frac N2)}{\frac N2}\right) ^2) \,\!$
where Alpha is specified by the Alpha parameter.
• Kaiser
Kaiser window:
$w[n]=I(beta*\sqrt{1-(\frac{2n}{N-1}-1)^2}) / I(beta) \,\!$
where I(ix) denotes Bessel Function and beta is specified by the Beta parameter.