quadinv.m 595 B

12345678910111213141516171819202122232425262728293031323334353637
  1. function [V,E] = quadinv(N,NW)
  2. % calculates the quadratic inverse eigenvectors
  3. %
  4. % Input
  5. % N: number of samples
  6. % NW: time-bandwidth product
  7. %
  8. % Output
  9. % V: The quadratic inverse eigenvectors
  10. % E: the quadratic inverse eigenvalues
  11. x = 0:N-1;
  12. indx = find(x);
  13. y = ones(size(x))*(2*NW/N)^2;
  14. y(indx) = (sin(2*pi*NW*x(indx)/N)./(pi*x(indx))).^2;
  15. M = toeplitz(y);
  16. [C,D] = eig(N*M);
  17. tmp = diag(D);
  18. K = 4*NW;
  19. V = sqrt(N)*C(:,N:-1:N-K+1);
  20. E = tmp(N:-1:N-K+1);
  21. for ii =1:K
  22. if(sum((N-1-2*x)'.*V(:,ii))<0)
  23. V(:,ii) = flipud(V(:,ii));
  24. end;
  25. end;
  26. return;