function C = addcent(A,B)
%
%  function C = addcent(A,B)
%
% A, B conjugated symmetrical polynomials A= aa_*, B=bb_* of differing size.
% addcent adds them, with correct centering. It also prunes away leading zeros
%  Mikael Sternad 920212
la = (length(A)-1)/2; lb= (length(B)-1)/2;
if la > lb
  bpadd = [zeros(1,la-lb) B zeros(1,la-lb)];
  C = A + bpadd;
else
  apadd = [zeros(1,lb-la) A zeros(1,lb-la)];
  C = apadd + B ;
end
% Reduce size of vector by eliminating zeros in beginning and end:
if C==zeros(1,length(C)), return
else
  n=1;
  while C(n) == 0, n=n+1; end
  C = C(n:length(C)-n+1);
end