From kozick@charcoal.eg.bucknell.edu Thu Mar 27 21:19 EST 1997 Date: Thu, 27 Mar 1997 21:19:11 -0500 From: Kozick Rich To: ligong@bucknell.edu, suqi@bucknell.edu, yuesun@bucknell.edu, fhaosng@bucknell.edu, piatt@bucknell.edu, tassone@bucknell.edu, grace@bucknell.edu, nclark@bucknell.edu, cdavies@bucknell.edu, morelli@bucknell.edu, dmorelli@sunlink.net, daviesfive@aol.com, kozick@bucknell.edu Subject: Problem 4.16 Hi, Here is a hint for Problem 4.16 for computing correlations with the FFT: If x1 and x2 are your two time signals, the you should be able to see that the number of points in the cross-correlation is N = length(x1) + length(x2) - 1; When you do the cross-correlation, just use "xcorr" with no extra argument, i.e. do not say 'unbiased'. Then, when you use the FFT, use N points, and: 1. Omit the (1/N) in front of the ifft, since we did not use the (1/N) on the direct correlation with xcorr. 2. Use the "fftshift" command to process the ifft output before displaying the results. This causes the correlation to be displayed with positive and negative values for the "lag" parameter. If you do this, then the direct and FFT methods should produce identical results. Try to understand what is going on with each step listed above. Please ask questions in class if you are unclear! Thanks and have fun. Rich