function [rmse] = RMSE(x, y)

npts=length(x);

s=0;
for k=1:npts

   rmse = (x(k)-y(k))^2;
   s=s+rmse;
%    figure(2)
%    plot(k,rmse,'r')
%    hold on
end

s = s/npts;%média dos desvios

rmse = sqrt(s);

% rmse = rmse/max(rmse);%rmse normalizado à amplitude
