% Find the optimum pole location for Laguerre, using Fu & Dumont
%    article, IEEE Auto. Control, June 1993.     SM17.M

[r,c]=size(y);

for i=1:c,
 m1 = 0;
 m2 = 0;
 h = 0;
 for j=1:r-1,
  m1 = m1 + j*y(j,i)^2;
  m2 = m2 + j*(y(j,i)-y(j+1,i))^2;
  h = h + y(j,i)^2;
 end
 m1 = m1/h;
 m2 = m2/h;
 p(i)=(2*m1-1-m2)/(2*m1-1+sqrt(4*m1*m2-m2^2-2*m2))
 yl(:,i)=dimpulse(1,[1 -p(i)],40);
end
