Suppose f[n] = 7, 2, -3 and g[n] = 1, 9, -1. Assume both sequences f and g start at n = 0.
(a) Find the linear cross-correlation c[n] = f * g using the formulae above.
(b) Develop a graphical interpretation of this process.
(a) Both f and g are finite sequences of length N = 3. Their cross-correlation is a sequence c[n], for n = -2, -1.0, 1, 2, of length 5.
Using the formulae above with n = -2 gives
When n = -1 we have
\begin{aligned} c[-1] & =\sum_{m=0}^1 f[m] g[m+1] \\ & =f[0] g[1]+f[1] g[2] \\ & =(7)(9)+(2)(-1) \\ & =61 \end{aligned}The remaining terms are calculated in a similar fashion. You should calculate one or two terms yourself to verify that the full sequence is
c[n]=-7,61,28,-25,-3 \quad n=-2,-1,0,1,2(b) The graphical interpretation is developed along the same lines as for linear convolution in Example 24.27. Figure 24.32 shows the sequence f[m], for m = 0, 1, 2, denoted by the symbols o. Also shown is the sequence g[m] denoted by •.
The graph of g[m] can be translated n units to the left or right by changing the argument of g from g[m] to g[m – n]. If n is positive the graph moves to the right. Study the figure to observe this. Correlation is the sum of products of f[m] and g[m – n]. For each value of n, the graph of f[m] is superimposed. We are only interested in values of n for which the graphs overlap – otherwise each product is zero. For each value of n the superimposed graphs make it easy to see which values must be multiplied together and added. Placing these results in order confirms the result obtained in part (a), that is the correlation is -7, 61, 28, -25, -3.