DSP Blockset Previous page   Next Page
Autocorrelation

Compute the autocorrelation of a vector input

Library

Statistics

Description

The Autocorrelation block computes the autocorrelation of each channel in an input matrix or vector, u. The block computes the autocorrelation along each column of a frame-based input, and computes along the vector dimension of a sample-based vector input. The block does not accept sample-based matrix inputs. Outputs are always sample based.

M-by-N matrix inputs must be frame based. The result, 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. Note that y1,j is the zero-lag element in the jth column. When Compute all non-negative lags is selected, l=M. 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.

If the input is a sample-based vector (row, column, or 1-D), the output is sample based, with the same shape as the input and length l+1. The block computes the autocorrelation of sample-based vector inputs along the vector dimensions. The Autocorrelation block does not accept a sample-based full-dimension matrix input.

The Autocorrelation block accepts both real and complex floating-point inputs. It also accepts real fixed-point inputs.

Fixed-Point Data Types

The following diagram shows the data types used within the Autocorrelation block for fixed-point signals.

You can set the product output, accumulator, and output data types in the block mask as discussed below.

Dialog Box

Compute all non-negative lags
Select to compute the autocorrelation over all nonnegative lags in the range [0length(input)-1].
Maximum non-negative lag (less than input length)
Specify the maximum positive lag, l, for the autocorrelation. This parameter is enabled when the Compute all non-negative lags check box is not selected.
Scaling
This parameter controls the scaling that is applied to the output. The following options are available:

Computation domain
This parameter sets the domain in which the block computes convolutions to one of the following settings:
Show additional parameters
If selected, additional parameters specific to implementation of the block become visible as shown.

Allow overrides from DSP Fixed-Point Attributes blocks
If you select this parameter, fixed-point data types for this block may be set by DSP Fixed-Point Attributes blocks in your model. If this parameter is unselected, the data types are always set by the parameters in the block mask.
Fixed-point output attributes
Choose how you will specify the output word length and fraction length. If you select Same as input, these characteristics will match those of the input to the block. If you select User-defined, the Output word length and Output fraction length parameters become visible.
Output word length
Specify the word length, in bits, of the output. This parameter is only visible if User-defined is specified for the Fixed-point output attributes parameter.
Output fraction length
Specify the fraction length, in bits, of the output. This parameter is only visible if User-defined is specified for the Fixed-point output attributes parameter.
Fixed-point accumulator attributes

As depicted above, 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 would like to designate this accumulator word and fraction lengths.
If you select Same as output, the accumulator word and fraction lengths are the same as those of the output of the block. If you select User-defined, the Accumulator word length and Accumulator fraction length parameters become visible.
Accumulator word length
Specify the word length, in bits, of the accumulator. This parameter is only visible when User-defined is specified for the Fixed-point accumulator attributes parameter.
Accumulator fraction length
Specify the fraction length, in bits, of the accumulator. This parameter is only visible when User-defined is specified for the Fixed-point accumulator attributes parameter.
Fixed-point product output attributes

As depicted above, the output of the multiplier is placed into the product output data type and scaling. Use this parameter to specify how you would like to designate this product output word and fraction lengths.
If you select Same as accumulator, the product output word and fraction lengths are the same as those of the accumulator of the block. If you select Same as output, they are the same as those of the output of the block. If you select User-defined, the Product output word length and Product output fraction length parameters become visible.
Product output word length
Specify the word length, in bits, of the product output. This parameter is only visible when User-defined is specified for the Fixed-point product output attributes parameter.
Product output fraction length
Specify the fraction length, in bits, of the product output. This parameter is only visible when User-defined is specified for the Fixed-point product output attributes parameter.
Round integer calculations toward
Select the rounding mode for fixed-point operations.
Saturate on integer overflow
If selected, overflows saturate.

Supported Data Types

To learn how to convert your data types to the above data types in MATLAB and Simulink, see Supported Data Types and How to Convert to Them.

See Also

Correlation
DSP Blockset
xcorr
Signal Processing Toolbox


Previous page  Analytic Signal Autocorrelation LPC Next page

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS