%Example of autocorrelation calculation
rand('seed', 1000); % use seed to make repeatable
x=10*randn(1, 1001); % generate random samples
t = 0: 0.001 : 1; % sampling index
[t1, R] = corb(x, x, 1000) ; % autocorrelation
subplot(2, 1, 1); 
plot(t,x);
xlabel('TIME'); ylabel('X');
subplot(2, 1, 2); 
plot(t1,R);
xlabel('LAG'); ylabel('RX');