I'm trying to calculate (with Matlab) the minimal and maximal Eigenvalues $\lambda_{min}$ and $\lambda_{max}$ of the autocorrelationmatrix $R$ to adjust the stepsize of an adaptive filter.

My input signal $x$ is a vector of colored noise. And my plan is to do something like

lmin = min(eig(xcorr(x)));
lmax = max(eig(xcorr(x)));

But it fails becaus 'For standard eigenproblem EIG(A), A must be square.'

I think this is a little bit strange, because in my opinion the output of the autocorrelation is always just a vector.

Please help me to find the point, whether I need to use something else than Matlabs 'eig' function or if it's mathematically not possible to calculate the eigenvalues of a single vector.


The autocorrelation matrix is a Toeplitz symmetric matrix that can be formed as:

Rxx = toeplitz(xcorr(x));

and that should give you a sensible (square) matrix that can be passed to eig.

| improve this answer | |
  • $\begingroup$ Thanks a lot. One last question: According to the literature the stability of a standard LMS is given by $0<\mu< \frac{2}{\lambda_{max}}$. Is it necessary to normalize lmax=max(eig(toeplitz(xcorr(x))) (and lmin)? If yes what is the right way? Dividing it by length(x) or length(xcorr(x)) which is $2\cdot x -1$. $\endgroup$ – Matt Jan 10 '16 at 11:18
  • $\begingroup$ I don't believe it is usual to normalize the eigenvalues at all. They are what they are. $\endgroup$ – Peter K. Jan 10 '16 at 21:50

[Edited after a rank 1 mistake diagonalized by @Jazzmaniac]

xcorr of a vector only yields a vector, on which you should build an autocovariance matrix as proposed by @Peter K.

If I remember well, the largest eigenvalue roughly grows as the dimension $n$. The theory for these matrices is beyond my knowledge. You can get more information in Largest eigenvalues and sample covariance matrices.

It is common practice to normalize the covariance matrix, to get either biased (xcorr(x,'biased')) or unbiased (xcorr(x,'unbiased')) estimators of the covariance matrix.

In my memory for adaptive filtering, with the symmetry, one takes only half of the autocorrelation to generate the Toepliz matrix: for instance xc = xcorr(x,'biased'), then Rxx = toeplitz(xc(length(x):end)).

You can follow with profit the derivation and Matlab codes in:

  1. Hayes, Monson H., Statistical Digital Signal Processing and Modeling, John Wiley & Sons, Inc., 1996, Chapter 9: Adaptive filtering (with Matlab code),
  2. Poularikas, Alexander D. and Ramadan, Zayed M., Adaptive Filtering Primer with MATLAB (with Matlab code).
| improve this answer | |
  • $\begingroup$ Thanks for your responce: using something like rng(1); x = randn(1000,1); gives me lmin = -5.3606e-13 and lmax = 996.1415 and a ratio (lmax/lmin) = -1.8583e+15. This value looks very huge to me. Do you have know-how to tell me if this are realistic values? $\endgroup$ – Matt Jan 9 '16 at 15:06
  • $\begingroup$ You can divise the covariance matrix by the number of samples. You should get a max eigenvalue close to 1. $\endgroup$ – Laurent Duval Jan 9 '16 at 18:06
  • $\begingroup$ The matrix $x'\times x$ has a trivial eigenstructure: It has one eigenvector $x$ with eigenvalue $|x|^2$ and an $n$-1 dimensional eigensubspace with eigenvalue 0, where $n$ is the dimension of the vector space. So your code is equivalent to lmin = 0; lmax = sum(abs(x)^2) $\endgroup$ – Jazzmaniac Jan 10 '16 at 0:50
  • $\begingroup$ @Jazzmaniacc Yes I am of rank one in stupidity. Correcting.. $\endgroup$ – Laurent Duval Jan 10 '16 at 8:51
  • $\begingroup$ @LaurentDuval, the matrix might be rank one, but you're certainly not stupid! ;-) Everyone makes mistakes and I must admit I'm often too pedantic. So sorry in case I was giving you the impression you were stupid! $\endgroup$ – Jazzmaniac Jan 10 '16 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.