%PREDICTOR DE LOS VALORES DE AUTOCORRELACIÓN.
%function rav1=predval(av1)
%Entradas:
%av1:av0 de las cuatro tramas anteriores.
%Salidas:
%rav1:predicción de los valores de autocorrelación.
function rav1=predval(av1)
R=[av1(1:8) ;av1(2) ,av1(1:7) ;av1(3), av1(2) ,av1(1:6);av1(4),av1(3),av1(2),av1(1:5)];
R=[R;av1(5),av1(4),av1(3),av1(2),av1(1:4);av1(6),av1(5),av1(4),av1(3),av1(2),av1(1:3)];
R=[R;av1(7) ,av1(6),av1(5) ,av1(4) ,av1(3) ,av1(2) ,av1(1:2)];
R=[R;av1(8),av1(7),av1(6),av1(5),av1(4),av1(3),av1(2),av1(1)];
aav1=inv(R)*av1(2:9)';
aav1=[-1;aav1(1:8)];
for i=1:9
   sum=0;
   for k=1:(10-i)
      sum=sum+(aav1(k)*aav1(k+i-1));
   end
   rav1(i)=sum;
end


