function [beta,r,l1] = spefac2(right) % % function [beta,r,l1] = spefac2(right) Mikael Sternad 1992, rev 950517 % % Given the symmetric polynomial right(z,z^-1), % the sequence beta(1)..beta(n) and the real r is computed such that % r*[z**n+beta(1)*z**(n-1)+..+beta(n)] % *[z**(-n)+beta(1)*z**(-n+1)+..beta(n)] = right(z,z^-1) % 'right' is assumed to be positive definite on the unit circle % % Method: calculates roots of right-hand side, and creates beta from % the roots in |z|<1. % % The polynomial may have complex coefficients and roots close to |z|=1. % % Inaccurate results may occur for clustered roots. % % l1 is the 1-norm of the error rbetabeta* - right. lr = length(right); nr = fix(lr-1)/2; if right(nr+1)