function r=ator(a,b,m)
% function R=ator(a,b,m)
% get autocorrelation vector corresponding to filter a

%R=xcorr(impz(1,a,5000),m,'coeff');
%R=R(1+m+(0:m));

p=length(a)-1;
gamma = atog(a);
if nargin==3
  gamma((p+1):m) = 0;
  gamma = gamma(1:m);
end

r=gtor(gamma);
if nargin==2
  r = r*sqrt(b)/prod(1-abs(gamma).^2);
end
