% CHEBYSHEVPOLES gives the poles of a Chebyshev filter, turned 
% 90 degrees in the complex plane from what is usually used in 
% filter theory in order to be suitable for use as a mask of a
% distribution function described by simple pole expansions.
%
% poles = CHEBYSHEVPOLES(n, r, vc)
%
% n:      number of poles
% r:      ripple of the Chebyshev filter or mask
% vc:     scaling factor corresponding to filter (mask) width


function maskpoles = chebyshevpoles(n,r,vc)
P = zeros(2*n+1,1);
P(2*n+1) = 1;
t0=[1];t1=[1 0];tii=[2 0 -1];
if n<1,
  tii=t0;
elseif n<2
  tii=t1;
else
  for ii=2:n
    tii=2*[t1 0]-[0 0 t0];
    t0=t1;t1=tii;
  end
end
P = P + r^2*conv(tii,tii).';
maskpoles = roots(P) * vc;
