% Demonstrate ensemble stochastic processM=4000;N=50;Nsub=6;
x=randn(M,N);
% Uncomment next two lines when we filter the process
% b=1;a=[1 -1.5 .85];
% x=filter(b,a,x')';
n=0:N-1;
nn=20;mm=21; % nn and mm are the positions of the markers
for i=1:Nsub
subplot(Nsub,1,i);
stem(n,x(i,:),'MarkerSize',3);%axis([0 N -2.5 2.5]);
hold on
plot(nn,x(i,nn+1),'o','MarkerSize',6,'MarkerFaceColor','r','MarkerEdgeColor','k')
plot(mm,x(i,mm+1),'^','MarkerSize',6,'MarkerFaceColor','g','MarkerEdgeColor','k')
hold off
end
ac=mean(x(:,nn).*x(:,mm))
subplot(Nsub,1,1)
No comments:
Post a Comment