function R=covf2(z,M)
%COVF2   Computes covariance function estimates
%
%	R = covf2(Z,M)
%
%	The routine is a subroutine to COVF. See COVF for further
%	details.

%	L. Ljung 10-1-86,11-11-94
%	Copyright (c) 1986-95 by the MathWorks, Inc.
%	$Revision: 1.3 $  $Date: 1995/01/24 00:50:09 $

[N,nz]=size(z);
z=[z;zeros(M,nz)];
j=[1:N];
for k=1:M
a=z(j,:)'*z(j+k-1,:);
R(:,k)=conj(a(:))/N;
end
