0001 function [V,E] = quadinv(N,NW)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 x = 0:N-1;
0015 indx = find(x);
0016 y = ones(size(x))*(2*NW/N)^2;
0017
0018 y(indx) = (sin(2*pi*NW*x(indx)/N)./(pi*x(indx))).^2;
0019
0020 M = toeplitz(y);
0021 [C,D] = eig(N*M);
0022
0023 tmp = diag(D);
0024
0025 K = 4*NW;
0026
0027 V = sqrt(N)*C(:,N:-1:N-K+1);
0028
0029 E = tmp(N:-1:N-K+1);
0030
0031 for ii =1:K
0032 if(sum((N-1-2*x)'.*V(:,ii))<0)
0033 V(:,ii) = flipud(V(:,ii));
0034 end;
0035 end;
0036
0037 return;