From 09:00 PM Friday, August 7 - 10:30 AM CST Saturday, August 8, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

# Signal Correlation (Auto Correlation) (G Dataflow)

Computes the auto-correlation of a signal.

## reset

A Boolean that specifies whether to reset the internal state of the node.

 True Resets the internal state of the node. False Does not reset the internal state of the node.

This input is available only if x is a double-precision, floating-point number.

Default: False

## x

The input signal.

This input supports the following data types.

• Waveform
• 1D array of waveforms
• Double-precision, floating-point number
• 1D array of double-precision, floating-point numbers
• 1D array of complex double-precision, floating-point numbers
• 2D array of double-precision, floating-point numbers

## normalization

The normalization method to use to compute the auto correlation of the input signal.

This input is available only if x is a waveform or an array.

Name Description
none

Does not apply normalization.

unbiased

Applies unbiased normalization.

biased

Applies biased normalization.

Default: none

## sample length x

Length of each set of x-values. This node computes each set of values separately.

sample length x must be greater than 0.

This input is available only if x is a double-precision, floating-point number.

Default: 100

## error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

## use history data

A Boolean that specifies whether to use the data points before the current block to compute the auto-correlation.

 True Uses the data points before the current block to compute the auto-correlation. False Does not use the data points before the current block to compute the auto-correlation.

This input is available only if x is a double-precision, floating-point number.

Default: True

## Rxx

Autocorrelation of the input signal.

This output can return the following data types:

• Waveform
• 1D array of waveforms
• 1D array of double-precision, floating-point numbers
• 1D array of complex double-precision, floating-point numbers

## error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

## Algorithm for Calculating the Auto-Correlation

The auto-correlation Rxx(t) of a function x(t) is defined as

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

where the symbol $\otimes$ denotes correlation.

For the discrete implementation of this node, let Y represent a sequence whose indexing can be negative, let N be the number of elements in the input sequence x, and assume that the indexed elements of x that lie outside its range are equal to zero, as shown in the following relationship:

${x}_{j}=0,\text{}j<0\text{}\text{}orj\ge N$

Then this node obtains the elements of Y using the following formula:

${Y}_{j}=\sum _{k=0}^{N-1}{{x}_{k}}^{*}\cdot {x}_{j+k}$

for $j=-\left(N-1\right),-\left(N-2\right),\text{}...\text{},-1,0,1,\text{}...\text{},\left(N-2\right),\left(N-1\right)$

The elements of the output sequence Rxx are related to the elements in the sequence Y by

${Rxx}_{i}={y}_{i-\left(N-1\right)}$

for $i=0,1,2,...\text{},2N-2$

Notice that the number of elements in the output sequence Rxx is $2N-1$. Because you cannot use negative numbers to index arrays, the corresponding correlation value at t = 0 is the Nth element of the output sequence Rxx. Therefore, Rxx represents the correlation values that this node shifts N times in indexing.

## How This Node Applies Unbiased Normalization

This node applies unbiased normalization as follows:

${y}_{j}=\frac{1}{N-|j|}\sum _{k=0}^{N-1}{x}_{k}^{*}\cdot {x}_{j+k}$

for j = -(N-1), -(N-2), ..., -1, 0, 1, ..., (N-2), (N-1), and

${Rxx\left(unbiased\right)}_{i}={y}_{i-\left(N-1\right)}$

for i = 0, 1, 2, ..., 2N-2

## How This Node Applies Biased Normalization

This node applies biased normalization as follows:

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

for j = -(N-1), -(N-2), ..., -1, 0, 1, ..., (N-2), (N-1), and

${Rxx\left(biased\right)}_{i}={y}_{i-\left(N-1\right)}$

for i = 0, 1, 2, ..., 2N-2

Where This Node Can Run:

Desktop OS: Windows

FPGA: DAQExpress does not support FPGA devices

Web Server: Not supported in VIs that run in a web application