2D Cross Correlation (DBL) VI
- Updated2025-07-30
- 3 minute(s) read
Computes the cross correlation of the input sequences X and Y. Wire data to the X and Y inputs to determine the polymorphic instance to use or manually select the instance.

Inputs/Outputs
X
—
X is the first input sequence.
Y
—
Y is the second input sequence.
algorithm
—
algorithm specifies the correlation method to use. When algorithm is direct, this VI computes the cross correlation using the direct method of linear correlation. When algorithm is frequency domain, this VI computes the cross correlation using an FFT-based technique. 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.
Rxy
—
Rxy is the cross correlation of X and Y.
error
—
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. |
2D Cross Correlation
The CrossCorrelation VI computes two-dimensional cross correlation as follows:
for i = –(M1–1), … , –1, 0, 1, … , (M2–1) and j = –(N1–1), … , –1, 0, 1, … , (N2–1)
where M1 is the number of rows of matrix X,
N1 is the number of columns of matrix X, M2 is the number of rows of matrix Y, N2 is the number of columns of matrix Y, the indexed elements outside the ranges of X and Y are equal to zero, as shown in the following relationships:x(m,n) = 0, m < 0 or m ≥ M1 or n < 0 or n ≥ N1
and
y(m,n) = 0, m < 0 or m ≥ M2 or n < 0 or n ≥ N2.
The elements of the output matrix Rxy are related to the elements in h as follows:
Rxy(I,j) = h(i–(M1–1), j–(N1–1)) for i = 0, 1, 2, … , M1+M2–2 and j = 0, 1, 2, … , N1+N2–2.
X
—
algorithm
—
Rxy
—
error
—