function [y,ssp,iter]=minphase(h);
y=[1 zeros(1,length(h)-1)];
ssp=realmax;
ss=ssp/2;
iter=0;
d=0;
while (ss<ssp)
    y=y+d';
    ssp=ss;
    iter=iter+1;
    Ar=toeplitz([y(1),zeros(1,length(h)-1)],y);
    Al=fliplr(toeplitz([y(length(h)),zeros(1,length(h)-1)],fliplr(y)));
    A=Al+Ar;
    b=h'-Al*y';
    d=A\b;
    ss=norm(d);
end;