function [err_ls]=trnseq_eval(trnseq,span)

% Inputs : trnseq  - a matrix of training sequences of size
%		     (# of antennas X length of training seq)
%	    span   - span of the channel (must be an integer)
% Out: err_ls	   - Least Squares Estimation error (as a multiplicative term)

[ant,trnlen]=size(trnseq);
S=[];tol=1e-6;
for k=1:ant
  	S=[S;toeplitz(trnseq(k,span:-1:1),trnseq(k,span:end))];
end;
err_ls=sum(1./(real(eig(S*S'/(trnlen-span+1)))+tol))/(span*ant);
