% Problem 4.16 in Ifeachor and Jervis DSP text.

x1 = [1.5, 2.0, 1.5, 2.0, 2.5];
x2 = [0, 0.33, 0.67, 1.0];
r12d = xcorr(x1, x2);

N = length(x1) + length(x2) - 1;
X1 = fft(x1, N);
X2 = fft(x2, N);
r12f = fftshift(ifft(conj(X1).*X2));

r12d

r12f
