Main Content

corrmtx

Data matrix for autocorrelation matrix estimation

Description

H = corrmtx(x,m) returns an (n+m)-by-(m+1) rectangular Toeplitz matrix H = H such that HH is a biased estimate of the autocorrelation matrix for the input vector x. n is the length of x, m is the prediction model order, and H is the conjugate transpose of H.

example

H = corrmtx(x,m,method) computes the matrix H according to the method specified by method.

[H,r] = corrmtx(___) also returns the (m + 1)-by-(m + 1) autocorrelation matrix estimate r, computed as HH, for any of the previous syntaxes.

Examples

collapse all

Generate a signal composed of three complex exponentials embedded in white Gaussian noise. Compute the data and autocorrelation matrices using the 'modified' method.

n = 0:99;
s = exp(i*pi/2*n)+2*exp(i*pi/4*n)+exp(i*pi/3*n)+randn(1,100);
m = 12;
[X,R] = corrmtx(s,m,'modified');

Plot the real and imaginary parts of the autocorrelation matrix.

[A,B] = ndgrid(1:m+1);
subplot(2,1,1)
plot3(A,B,real(R))
title('Re(R)')
subplot(2,1,2)
plot3(A,B,imag(R))
title('Im(R)')

Input Arguments

collapse all

Input data, specified as a vector.

Prediction model order, specified as a positive real integer.

Matrix computation method, specified as 'autocorrelation', 'prewindowed', 'postwindowed', 'covariance' or 'modified'.

  • 'autocorrelation': (default) H 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 mth-order prediction model. The matrix can be used to perform autoregressive parameter estimation using the Yule-Walker method. For more details, see aryule.

  • 'prewindowed': H 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 mth-order prediction model.

  • 'postwindowed': H 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 mth-order prediction model.

  • 'covariance': H is the (nm)-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 mth-order prediction model. The matrix can be used to perform autoregressive parameter estimation using the covariance method. For more details, see arcov.

  • 'modified': H is the 2(nm)-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 mth-order prediction model. The matrix can be used to perform autoregressive parameter estimation using the modified covariance method. For more details, see armcov.

Output Arguments

collapse all

Data matrix, returned for autocorrelation matrix estimation. The size of H depends on the matrix computation method specified in method.

Biased autocorrelation matrix, returned as a (m + 1)-by-(m + 1) rectangular Toeplitz matrix.

Algorithms

The Toeplitz data matrix computed by corrmtx depends on the method you select. The matrix determined by the autocorrelation (default) method is:

H=1n[x(1)000x(2)x(1)00x(3)x(2)00x(m)x(m1)x(1)0x(m+1)x(m)x(2)x(1)x(m+2)x(m+1)x(3)x(2)x(n1)x(n2)x(nm)x(nm1)x(n)x(n1)x(nm+1)x(nm)0x(n)x(nm+2)x(nm+1)00x(n1)x(n2)00x(n)x(n1)000x(n)].

In the matrix, m is the same as the input argument m to corrmtx and n is length(x). Variations of this matrix are used to return the output H of corrmtx for each method:

  • 'autocorrelation' — (default) H = H.

  • 'prewindowed'H is the n-by-(m + 1) submatrix of H whose first row is [x(1) … 0] and whose last row is [x(n) … x(nm)].

  • 'postwindowed'H is the n-by-(m + 1) submatrix of H whose first row is [x(m + 1) … x(1)] and whose last row is [0 … x(n)].

  • 'covariance'H is the (nm)-by-(m + 1) submatrix of H whose first row is [x(m + 1) … x(1)] and whose last row is [x(n) … x(nm)].

  • 'modified'H is the 2(nm)-by-(m + 1) matrix Hmod defined by

    Hmod=12(nm)[x(m+1)x(1)x(n)x(nm)x(1)x(m+1)x(nm)x(n)].

References

[1] Marple, S. Lawrence. Digital Spectral Analysis: With Applications. Prentice-Hall Signal Processing Series. Englewood Cliffs, N.J: Prentice-Hall, 1987.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced before R2006a