Monday, November 2, 2009

Cross correlation continued....

I have included a better description of the figure.
The xcorr function is used 'unbiased' as I am simply showing that the cross correlation rxw is not equal to rwx.


% m-file showing that rxw /= (not equal to) rwx
% rxw(m)=0 for m<0,>= 0;
% rwx(m)=0 for m>0, =h(-m) m<= 0;
% This is important when deriving the Yule-Walker equations for an AR
% process
N=2^16;n=0:N-1;w=randn(size(n));
b=[0 1];a=[1 -1.8 .9];
x=filter(b,a,w);
M=150;m=-M:M;rxw=xcorr(x,w,M);rwx=xcorr(w,x,M);
subplot(2,1,1);plot(m,rxw,'.');
title('Crosscorrelation rxw');xlabel('m');ylabel('rxw');grid
subplot(2,1,2);plot(m,rwx,'.');xlabel('m');ylabel('rwx');grid

1 comment:

  1. Found TeX editor for MATLAB at
    http://www.mathworks.com/matlabcentral/fileexchange/11946-tex-editor.
    Going to try it out tomorrow. It may help to include equations in my BLOG.

    ReplyDelete