<< convmtx | FOSSEE_Signal_Processing_Toolbox | cplxpair >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > corrmtx

# corrmtx

Generate a data matrix for autocorrelation matrix estimation.

### Syntax

    X = corrmtx(x, m)
    [X, R] = corrmtx(x, m)
    X = corrmtx(x, m, s)
    [X, R] = corrmtx(x, m, s)

### Parameters

x:

  Vector. Input vector of size N for which the correlation matrix of size `m` is to be calculated.

m:

  Positive integer. Size of the correlation matrix to be computed. Must be strictly smaller than the length of `x`.

s:

  String. Method for the type of output matrix `X`. Options are:

- 'autocorrelation' (default):

  Generates an autocorrelation estimate.

- 'prewindowed':

  Uses prewindowed data.

- 'postwindowed':

  Uses postwindowed data.

- 'covariance':

  Uses nonwindowed data.

- 'modified':

  Uses forward and backward prediction error estimates.

X:

  Matrix. Data matrix as specified by the input `s`.

R:

  Matrix. Autocorrelation matrix estimate calculated as `X'*X`.

### Description

Consider the generic matrix X below _ _ | x(1) ..........0 | | : . : | | : . : | | x(m+1).......x(1)| | : . : | | : . : | X = | x(n-m).....x(m+1)| | : . : | | : . : | | x(n).......x(n-m)| | : . : | | : . : | |_0 ..........x(n)_| -- For different inputs of string s the output would vary ass described below 'autocorrelation' — (default) X = X, above. 'prewindowed' — X is the n-by-(m + 1) submatrix of X whose first row is [x(1) … 0] and whose last row is [x(n) … x(n – m)] 'postwindowed' — X is the n-by-(m + 1) submatrix of X whose first row is [x(m + 1) … x(1)] and whose last row is [0 … x(n)] 'covariance' — X is the (n – m)-by-(m + 1) submatrix of X whose first row is [x(m + 1) … x(1)] and whose last row is [x(n) … x(n – m)] 'modified' — X is the 2(n – m)-by-(m + 1) matrix X_mod shown below _ _ | x(m+1) ......x(1)| | : . : | | : . : | | x(n-m).....x(m+1)| | : . : | | : . : | | x(n).......x(n-m)| X_mod= | x*(1).....x*(m+1)| | : . : | | : . : | | x*(m+1)...x*(n-m)| | : . : | | : . : | |_x*(n-m) ...x*(n)_|

### Examples

    x = [1, 2, 3, 4, 5]
    m = 3
    [X, R] = corrmtx(x, m, 'autocorrelation')

### See also

- peig — Pseudospectrum using the eigenvector method.
- pmusic — Psuedospectrum using MUSIC algorithm
- rooteig — Frequencies and power of sinusoids using eigenvector algorithm
- rootmusic — Frequencies and power of sinusoids using the root MUSIC algorithm
- xcorr

### Authors

- Parthe Pandit

### Bibliography

Marple, S. Lawrence. Digital Spectral Analysis. Englewood Cliffs, NJ: Prentice-Hall, 1987.

Report an issue
<< convmtx | FOSSEE_Signal_Processing_Toolbox | cplxpair >>