## Documentation Center |

Data matrix for autocorrelation matrix estimation

`X = corrmtx(x,m)X = corrmtx(x,m,'method') [X,R] = corrmtx(...)`

`X = corrmtx(x,m)` returns
an (*n*+`m`)-by-(`m`+1)
rectangular Toeplitz matrix `X`,
such that `X'X` is a (biased) estimate of the autocorrelation
matrix for the length *n* data vector `x`. `m` must
be a positive integer strictly less than the length of the input `x`.

`X = corrmtx(x,m,'method') ` computes
the matrix

`'autocorrelation'`: (default)`X`is the (*n*+`m`)-by-(`m`+1) rectangular Toeplitz matrix that generates an autocorrelation estimate for the length*n*data vector`x`, derived using*prewindowed*and*postwindowed*data, based on an`m`th order prediction error model.`'prewindowed'`:`X`is the*n*-by-(`m`+1) rectangular Toeplitz matrix that generates an autocorrelation estimate for the length*n*data vector`x`, derived using*prewindowed*data, based on an`m`th order prediction error model.`'postwindowed'`:`X`is the*n*-by-(`m`+1) rectangular Toeplitz matrix that generates an autocorrelation estimate for the length*n*data vector`x`, derived using*postwindowed*data, based on an`m`th order prediction error model.`'covariance'`:`X`is the (*n-*`m`)-by-(`m`+1) rectangular Toeplitz matrix that generates an autocorrelation estimate for the length*n*data vector`x`, derived using*nonwindowed*data, based on an`m`th order prediction error model.`'modified'`:`X`is the 2(*n-*`m`)-by-(`m`+1) modified rectangular Toeplitz matrix that generates an autocorrelation estimate for the length*n*data vector`x`, derived using forward and backward prediction error estimates, based on an`m`th order prediction error model.

`[X,R] = corrmtx(...)` also
returns the (`m`+1)-by-(`m`+1) autocorrelation
matrix estimate `R`, calculated as `X'*X`.

```
n = 0:99;
s = exp(i*pi/2*n)+2*exp(i*pi/4*n)+exp(i*pi/3*n)+randn(1,100);
X = corrmtx(s,12,'mod');
```

[1] Marple, S. L. *Digital Spectral
Analysis*. Englewood Cliffs, NJ: Prentice-Hall, 1987, pp. 216–223.

Was this topic helpful?