Version:

Last Modified: January 9, 2017

Computes the cross correlation of two signals.

The correlation method to use.

If **x** and **y** are small, the direct method typically is faster. If **x** and **y** are large, the frequency domain method typically is faster. Additionally, slight numerical differences can exist between the two methods.

Name | Description |
---|---|

direct | Computes the cross correlation using the direct method of linear correlation. |

frequency domain | Computes the cross correlation using an FFT-based technique. |

**Default: **frequency domain

The normalization method to use to compute the cross correlation between the two input signals.

Name | Description |
---|---|

none | Does not apply normalization. |

unbiased | Applies unbiased normalization. |

biased | Applies biased normalization. |

**Default: **none

Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

**Default: **No error

Cross correlation of the two input signals.

The cross correlation Rxy(*t*) of the sequences *x*(*t*) and *y*(*t*) is defined by the following equation:

$Rxy(t)=x(t)\otimes y(t)={\int}_{-\infty}^{\infty}x*(\tau )\cdot y(t+\tau )d\tau $

where the symbol $\otimes $ denotes correlation.

The discrete implementation of cross correlation is as follows. Let
${x}_{j}=0,\text{\hspace{0.17em}}j<0\text{\hspace{0.17em}}\text{\hspace{0.17em}}orj\ge N$

and

${y}_{j}=0,\text{\hspace{0.17em}}j<0\text{\hspace{0.17em}}\text{\hspace{0.17em}}or\text{\hspace{0.17em}}j\ge M$

Then this node obtains the elements of *h* using the following equation:

${h}_{j}=\underset{k=0}{\overset{N-1}{\sum}}{{x}_{k}}^{*}\cdot {y}_{j+k}$

for $j=-(N-1),-(N-2),\text{\hspace{0.17em}}\mathrm{...}\text{\hspace{0.17em}},-1,0,1,\text{\hspace{0.17em}}\mathrm{...}\text{\hspace{0.17em}},(M-2),(M-1)$

The elements of the output sequence **Rxy** are related to the elements in the sequence *h* by

${Rxy}_{i}={h}_{i-(N-1)}$

for $i=0,1,2,\mathrm{...}\text{\hspace{0.17em}},N+M-2$

Because you cannot index LabVIEW arrays with negative numbers, the corresponding cross correlation value at *t* = 0 is the *N*^{th} element of the output sequence **Rxy**. Therefore, **Rxy** represents the correlation values that this node shifts *N* times in indexing.

This node applies unbiased normalization as follows:

${R}_{xy}{\left(unbiased\right)}_{j}=\frac{1}{f\left(j\right)}{Rxy}_{j}$

for *j* = 0, 1, 2, ..., *M* + *N* - 2

where *R*_{xy} is the cross correlation between *x* and *y* with no normalization. *f*(*j*) is:

This node applies biased normalization as follows:

${R}_{xy}{\left(biased\right)}_{j}=\frac{1}{\mathrm{max}(M,N)}{Rxy}_{j}$

for *j* = 0, 1, 2, ..., *M* + *N* - 2

where *R*_{xy} is the cross correlation between *x* and *y* with no normalization.

**Where This Node Can Run: **

Desktop OS: Windows

FPGA: Not supported