
 
  for i=1:1024
     
      X(i) = 4*cos(i*pi/512)-5*sin(i*pi/128)+3*cos(i*pi/500) ;
   end;
   
   for i = 1:800
       Z(i) = X(i+200);
   end;
   
   plot(1:1:1024,X,1:1:800,Z)
   
   
   
   Y = xcorr(X);
   
   figure
   
   plot(1:1:1024,Y(1:1024))