function e = lspdiff(a,R,N)

%Ra = xcorr(impz(1,a,10000),N+length(a),'coeff');
%Ra = Ra(1+N+length(a)+(0:N+length(a)));
Ra = ator(real(a),1,N+1)';

e = sum(abs(R(length(a):N+1)-Ra(length(a):N+1)));


