class="resources" CrossCorrelation (Not in Base Package) - LabVIEW 7.1 Help - Support - National Instruments
Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

CrossCorrelation (Not in Base Package)

Computes the cross correlation of the input signals X and Y. Details  

algorithm specifies the method used for computing the cross correlation. When algorithm is set to direct, the VI computes the correlation using the direct form, Rxy[i] = Sum(x[k]y[i+k]). When algorithm is set to frequency domain (default), the VI computes the correlation using a FFT-based technique. The direct method is typically faster for small input sizes, whereas the frequency-domain method is faster for large input sizes. Additionally, slight numerical differences can exist between the two methods.

0Direct
1Frequency domain (default)
X is the input signal.
Y is the input signal Y.
Rxy is the cross correlation of input signals X and Y.
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

CrossCorrelation Details

The cross correlation Rxy(t) of the signals x(t) and y(t) is defined as

,

where the symbol denotes correlation.

The discrete implementation of the CrossCorrelation VI is as follows. Let h represent a sequence whose indexing can be negative, let n be the number of elements in the input sequence X, let m be the number of elements in the sequence Y, and assume that the indexed elements of X and Y that lie outside their range are equal to zero,

xj = 0, j < 0 or j n

and

yj = 0, j < 0 or j m.

Then the CrossCorrelation VI obtains the elements of h using

for j = –(n – 1), –(n – 2), …, –2, –1, 0, 1, 2, …, m – 1

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

Rxyi = hi – (n – 1)

for i = 0, 1, 2, …, size – 1, size = n + m – 1,

where size is the number of elements in the output sequence Rxy.

Because you cannot index LabVIEW arrays with negative numbers, the corresponding cross correlation value at t = 0 is the nth element of the output sequence Rxy. Therefore, Rxy represents the correlation values that the CrossCorrelation VI shifted n times in indexing.

The following block diagram shows one way to index the CrossCorrelation VI.

The following graph is the result of the preceding block diagram.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit