This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: yf=y.*exp(-1i*2*pi*f*(0:lx-1)*Ts) for i=1:ln %Multiply the FFT of X with the conj of Y and vice versa n_r=n(i)+(1:N) X(f+N+1,i)=a*xf(n_r)' Y(f+N+1,i)=conj(a*yf(n_r)') end end for alpha=-N/4:N/4 for f=-N/2:N/2 f1=f+alpha f2=f-alpha if (abs(f1)<N/2)&&(abs(f2)<N/2) %g acts to smooth X*Y out, this is more obvious if you plot g %s is the cross correlation of X's and Y's frequency components %seperated by f +/- alpha S(f+N/2+1,N/4+alpha+1)=g*(X(f1+N+1,:).*Y(f2+N+1,:))' end end end %Compute correlation coefficients Cx = fftshift(corrcoef(S').^2) Sheet1 Page 2 end...
View Full Document
- Spring '10