# Signal Correlation (Auto Correlation Matrix) (G Dataflow)

Computes the auto-correlation matrix of a signal.

## reset

A Boolean to determine initialization of the internal state of the node.

 True Initializes the internal states to zero. False Initializes the internal states to the final states from the previous call of this node.

This node automatically initializes the internal state to zero on the first call and runs continuously until this input is True. For a large data sequence consisting of smaller blocks, when this input is True, this node calculates the histogram of the current block only and ignores previous blocks.

Default: False

## signal

The input signal.

This input can be a 2D array of double-precision, floating-point numbers or a 2D array of complex double-precision, floating-point numbers.

## order

Order of the auto-correlation matrix. If the order is smaller than zero, this node returns an error.

Default: 0

## method

Method used to compute the auto-correlation matrix.

Name Value Description
AutoCorrelation 0 Uses the auto-correlation method.
Pre-Windowed 1 Uses the pre-windowed method.
Post-Windowed 2 Uses the post-windowed method.
Covariance 3 Uses the covariance method.
Modified Covariance 4 Uses the modified covariance method.

Determining Which Method to Use

Auto-correlation matrix is widely used in the field of spectrum analysis to estimate the spectral components within the input signal. In general, Covariance and Modified Covariance methods give better results in spectral estimation processing than the AutoCorrelation, Pre-Windowed and Post-Windowed methods. NI recommends that you use the Covariance or the Modified Covariance method to estimate the auto-correlation matrix when performing spectrum analysis.

Algorithm Definition for the Auto-Correlation Method

If method is AutoCorrelation, R is a data matrix of size (N+k)-by-(k+1) defined as follows.

$R=\left[\begin{array}{ccc}{x}_{0}& \cdots & 0\\ ⋮& \ddots & ⋮\\ {x}_{k}& \cdots & {x}_{0}\\ ⋮& \text{}& ⋮\\ {x}_{N-1}& \cdots & {x}_{N-k-1}\\ ⋮& \ddots & ⋮\\ 0& \cdots & {x}_{N-1}\end{array}\right]$

where

• x i is the i th element in the input signal
• N is the length of the input signal
• k is order

The normalization factor is equal to N.

Algorithm Definition for the Pre-Windowed Method

If method is Pre-Windowed, R is a matrix of size N-by-(k+1) defined as follows.

$R=\left[\begin{array}{ccc}{x}_{0}& \cdots & 0\\ ⋮& \ddots & ⋮\\ {x}_{k}& \cdots & {x}_{0}\\ ⋮& \text{}& ⋮\\ {x}_{N-1}& \cdots & {x}_{N-k-1}\end{array}\right]$

where

• x i is the i th element in the input signal
• N is the length of the input signal
• k is order

The normalization factor is equal to N.

Algorithm Definition for the Post Windowed Method

If method is Post-Windowed, R is a matrix of size N-by-(k+1) defined as follows.

$R=\left[\begin{array}{ccc}{x}_{k}& \cdots & {x}_{0}\\ ⋮& \text{}& ⋮\\ {x}_{N-1}& \cdots & {x}_{N-k-1}\\ ⋮& \ddots & ⋮\\ 0& \cdots & {x}_{N-1}\end{array}\right]$

where

• x i is the i th element in the input signal
• N is the length of the input signal
• k is order

The normalization factor is equal to N.

Algorithm Definition for the Covariance Method

If method is Covariance, R is a matrix of size (N-k)-by-(k+1) defined as follows.

$R=\left[\begin{array}{ccc}{x}_{k}& \cdots & {x}_{0}\\ ⋮& \text{}& ⋮\\ {x}_{N-1}& \cdots & {x}_{N-k-1}\end{array}\right]$

where

• x i is the i th element in the input signal
• N is the length of the input signal
• k is order

The normalization factor is equal to N-k.

Algorithm Definition for the Modified Covariance Method

If method is Modified Covariance, R is a matrix of size 2(N-k)-by-(k+1) defined as follows.

$R=\left[\begin{array}{ccc}{x}_{k}& \cdots & {x}_{0}\\ ⋮& \text{}& ⋮\\ {x}_{N-1}& \cdots & {x}_{N-k-1}\\ {\begin{array}{c}{x}_{0}\end{array}}^{*}& \cdots & {\begin{array}{c}{x}_{k}\end{array}}^{*}\\ ⋮& \text{}& ⋮\\ {\begin{array}{c}{x}_{N-k-1}\end{array}}^{*}& \cdots & {\begin{array}{c}{x}_{N-1}\end{array}}^{*}\end{array}\right]$

where

• x i is the i th element in the input signal
• N is the length of the input signal
• k is order
• x i * is the complex conjugate of x i

The normalization factor is equal to 2*(N-k).

Default: AutoCorrelation

## 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

## autocorrelation matrix

Auto-correlation matrix of the input signal.

The output can return a 2D array of double-precision, floating-point numbers or a 2D array of complex double-precision, floating-point numbers.

The size of the auto-correlation matrix is (order+1) multiplied by (order+1).

## 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 Matrix

This node uses the following equation to calculate the auto-correlation matrix.

$M=\frac{{R}^{H}*R}{s}$

where

• M is autocorrelation matrix
• R is data matrix
• s is normalization factor
• R H is the conjugate transpose of matrixR

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

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