| Signal Processing Blockset™ | ![]() |
Statistics
dspstat3
The Autocorrelation block computes the autocorrelation along each column of a frame-based input, and computes along the first dimension of an N-D sample-based input. The output of the block is always sample-based.
The Autocorrelation block accepts both real and complex fixed-point and floating-point inputs. Fixed-point signals are not supported for the frequency domain.
When the input to the Autocorrelation block is a frame-based M-by-N matrix u, the output, y, is a sample-based (l+1)-by-N matrix whose jth column has elements

where * denotes the complex conjugate, and l represents the maximum lag. y0,j is the zero-lag element in the jth column. When you select Compute all non-negative lags, l=M–1. Otherwise, l is specified as a nonnegative integer by the Maximum non-negative lag (less than input length) parameter.
Input u is zero when indexed outside of its valid range. When the input is real, the output is real; otherwise, the output is complex.
When the input is a sample-based N-D array, the block computes the autocorrelation along the first dimension of the input. The output is a sample based N-D array, where the size of the first dimension is l+1, and the sizes of all other dimensions match those of the input array. For example, when the input is an M-by-N-by-P array, the Autocorrelation block outputs an (l+1)-by-N-by-P sample-based array.
When you select Compute all non-negative lags, l=M–1. Otherwise, l is specified as a nonnegative integer by the Maximum non-negative lag (less than input length) parameter.
Input u is zero when indexed outside of its valid range. When the input is real, the output is real; otherwise, the output is complex.
The following diagrams show the data types used within the Autocorrelation block for fixed-point signals (time domain only).


You can set the product output, accumulator, and output data types in the Fixed-Point pane of the block dialog as discussed in the next section.
The output of the multiplier is in the product output data type when the input is real. When the input is complex, the result of the multiplication is in the accumulator data type. For details on the complex multiplication performed, see Multiplication Data Types.
The Main pane of the Autocorrelation block dialog appears as follows.

Select to compute the autocorrelation over all nonnegative lags in the range [0, length(input)-1].
Specify the maximum positive lag, l, for the autocorrelation. This parameter is enabled when you do not select the Compute all non-negative lags check box.
This parameter controls the scaling that is applied to the output. The following options are available:
None — Generates the raw autocorrelation yi,j without normalization.
Biased — Generates the biased estimate of the autocorrelation.
![]()
Unbiased — Generates the unbiased estimate of the autocorrelation.
![]()
Unity at zero-lag — Normalizes the estimate of the autocorrelation for each channel so that the zero-lag sum is identically 1.
![]()
This parameter is tunable, except in the Simulink external mode.
This parameter sets the domain in which the block computes convolutions to one of the following settings:
The Fixed-point pane of the Autocorrelation block dialog appears as follows.

Note Fixed-point signals are only supported for the time domain. To use the parameters on this pane, make sure Time is selected for the Computation domain parameter on the Main pane. |
Select the rounding mode for fixed-point operations.
Select the overflow mode for fixed-point operations.
Use this parameter to specify how you want to designate the product output word and fraction lengths. See Fixed-Point Data Types and Multiplication Data Types for illustrations depicting the use of the product output data type in this block:
When you select Inherit via internal rule, the product output word length and fraction length are calculated automatically. For information about how the product output word and fraction lengths are calculated when an internal rule is used, see Inherit via Internal Rule.
When you select Same as input, these characteristics match those of the block input.
When you select Binary point scaling, you can enter the word length and the fraction length of the product output, in bits.
When you select Slope and bias scaling, you can enter the word length, in bits, and the slope of the product output. This block requires power-of-two slope and a bias of zero.

As depicted in this figure, inputs to the accumulator are cast to the accumulator data type. The output of the adder remains in the accumulator data type as each element of the input is added to it. Use this parameter to specify how you want to designate this accumulator word and fraction lengths.
You also use this parameter to specify the accumulator word and fraction lengths resulting from a complex-complex multiplication in the block. See Multiplication Data Types for more information.
When you select Inherit via internal rule, the accumulator word length and fraction length are calculated automatically. For information about how the accumulator word and fraction lengths are calculated when an internal rule is used, see Inherit via Internal Rule.
When you select Same as product output, these characteristics match those of the product output.
When you select Same as input, these characteristics match those of the block input.
When you select Binary point scaling, you can enter the word length and the fraction length of the accumulator, in bits.
When you select Slope and bias scaling, you can enter the word length, in bits, and the slope of the accumulator. This block requires power-of-two slope and a bias of zero.
Choose how you specify the output word length and fraction length:
When you select Same as accumulator, these characteristics match those of the accumulator.
A special case occurs when Inherit via internal rule is specified for Accumulator, and the block input is complex. In that case, the output word length is one less than the accumulator word length.
When you select Same as product output, these characteristics match those of the product output.
When you select Same as input, these characteristics match those of the input to the block.
When you select Binary point scaling, you can enter the word length and the fraction length of the output, in bits.
When you select Slope and bias scaling, you can enter the word length, in bits, and the slope of the output. This block requires power-of-two slope and a bias of zero.
Select this parameter to prevent any fixed-point scaling you specify in this block mask from being overridden by the autoscaling tool in the Fixed-Point Tool.
| Port | Supported Data Types |
|---|---|
Input |
|
Output |
|
| Correlation | Signal Processing Blockset |
| xcorr | Signal Processing Toolbox |
![]() | Array-Vector Subtract | Autocorrelation LPC | ![]() |
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |