Fs=8000;
n=[0:1:100000]';
x=sin(2*pi*(440/8000)*n);
w=4*randn(length(n),1);
w=w-mean(w);
y=x+w;
ryy=xcorr(y,y);
nn=[-length(n)+1:1:length(n)-1]';
plot(nn,ryy)
figure
plot(y)