I am trying to plot the auto and cross correlation of the bitstream that is obtained from a nonlinear dynamical system.
The graph is the Auto and cross-correlation for the bitstream obtained from the same nonlinear dyanamical system.
I am not sure how to interpret the graph. Whether the program is incorrect or not. I wanted to obtain the plot of lags vs ACF but what I got is different than the actual plot given in a book. Please help.
A = .5; B = 1.99; phin = .5; xphi(1) = A - (B*phin);
for it = 2:1:5000
xphi(it) = A - (B*abs(xphi(it-1)));
end
phi = 2*(xphi>=0.5)-1;
A = .51; B = 1.90; phin = .5; xphit(1) = A - (B*phin);
for it = 2:1:5000
xphit(it) = A - (B*abs(xphit(it-1)));
end
phit = 2*(xphit>=0.5)-1;
CST = xcorr(phit,phi);
AST = xcorr(phi,phi);
Time = 0;
for nn = 2:1:length(CST)
Time(nn) = Time(nn-1) + 1;
end
plot(Time,AST,'r',Time,CST,'g'); title('\bf AUTO & CROSS correlation');
xlabel('\bf Time'); ylabel('\bf Auto & Cross correlation'); legend('red-AC','green-CC');
The plot should resemble
where the figure on top is the cross-correlation and the bottom is the auto-correlation