function alpha=momcum(h) %Let "convolved" be the matrix where the n'th column of the k'th row is coef_(n-1) ( (1 + h(1)z^1 + h(2)z^2 + ...)^k ), where coef_n means the coefficient of z^n. convolved = zeros(length(h),length(h)+1); convolved(1,1) = 1; convolved(1,(2:(length(h)+1))) = h(1:(length(h))); for (i = 2:length(h)) res = conv(convolved(i-1,:),convolved(1,:)); convolved(i,:) = res(1:length(h)+1); end alpha = zeros(1,length(h)); for (n = 1:length(h)) sum2 = 0; for (k = 1:n-1) sum2 = sum2 + convolved(k,n-k+1) * alpha(k); end alpha(n) = (h(n) - sum2)/convolved(n,1); end