function tstat=dmtstat(e1,e2,l);
y=(e1.^2)-(e2.^2);
n=length(y);
bhat=mean(y);
res=y-bhat;
g=mean(res.^2);
if l>0;
for j=1:l;
	h=sum(res(1:n-j).*res(j+1:n))/n;
	h=2*h*(l+1-j)/(l+1);
g=g+h;	
end;
end;
tstat=bhat/sqrt(g/n);

