i
i
i
i
i
i
i
i
9.2. Convolution 195
So clearly, convolving b with d just gives back b again. The sequence d is known
as the discrete impluse. It is occasionally useful in expressing a lter: for instance,
the process of smoothing a signal b with a lter a and then subtracting that from
the original could be expressed as a single convolution with the lter d a:
c = b ab= db ab=(d a) b.
9.2.3 Convolution as a Sum of Shifted Filters
There is a second, entirely equivalent, way of interpreting Equation (9.2). Look-
ing at the samples of ab one at a time leads to the weighted-average interpretation
that we have already seen. But if we omit the [i], we can instead think of the sum
as adding together entire sequences. One piece of notation is required to make
this work: if b is a sequence, then the same sequence shifted to the right by j
places is called b
j
(Figure 9.8):
b
j
[i]=b[i j].
Then, we can write Equation (9.2) as a statement about the whole sequence (ab)
420246
i
420246
i
b
3
[i ]b
3
[i ]
b[i ]b[i ]
Figure 9.8. Shifting a se-
quence
b
to get
b
j
.
rather than element-by-element:
(ab)=
j
a[j]b
j
.
Looking at it this way, the convolution is a sum of shifted copies of b, weighted
by the entries of a (Figure 9.9). Because of commutativity, we can pick either a
Σ
0
0 5 10 15
a[j ]
a[j ]b
j
a[j ]b
j
a[5]b
5
a[5]a[5]
a[9]
a[9]b
9
a b
Figure 9.9. Discrete convolution as a sum of shifted copies of the filter.
i
i
i
i
i
i
i
i
196 9. Signal Processing
or b as the lter; if we choose b, then we are adding up one copy of the lter for
every sample in the input.
9.2.4 Convolution with Continuous Functions
While it is true that discrete sequences are what we actually work with in a com-
puter program, these sampled sequences are supposed to represent continuous
functions, and often we need to reason mathematically about the continuous func-
tions in order to gure out what to do. For this reason it is useful to dene con-
volution between continuous functions and also between continuous and discrete
functions.
The convolution of two continuous functions is the obvious generalization of
Equation (9.2), with an integral replacing the sum:
(fg)(x)=
+
−∞
f(t)g(x t) dt. (9.3)
One way of interpreting this denition is that the convolution of f and g, evaluated
at the argument x, is the area under the curve of the product of the two functions
0
00
x
t t
0 xx
1
x
2
area
area
g(x)
f(t)
f(t)g(x t)
(f g)(x )
××
==
Figure 9.10. Continuous convolution.
i
i
i
i
i
i
i
i
9.2. Convolution 197
after we shift f so that f (0) lines up with g(x). Just like in the discrete case,
the convolution is a moving average, with the lter providing the weights for the
average (See Figure 9.10).
Like discrete convolution, convolution of continuous functions is commuta-
tive and associative, and it is distributive over addition. Also as with the discrete
case, the continuous convolution can be seen as a sum of copies of the lter rather
than the computation of weighted averages. Except, in this case, there are in-
nitely many copies of the lter:
(fg)=
+
−∞
f(t)g
t
dt.
Example (Convolution of two box functions). Let f be a box function:
f(x)=
1
1
2
x<
1
2
,
0 otherwise.
Then what is ff? The denition (Equation (9.3)) gives
(ff)(x)=
−∞
f(t)f (x t) dt.
Figure 9.11 shows the two cases of this integral. The two boxes might have zero
overlap, which happens when x ≤−1 or x 1; in this case the result is zero.
When 1 <x<1, the overlap depends on the separation between the two boxes,
–½ 0 ½
0 0
f(x)
f(t)
f(t)f(x t)
(f f )(x)
x
x
t t
–½
3
Figure 9.11. Convolving two boxes yields a tent function.
i
i
i
i
i
i
i
i
198 9. Signal Processing
which is |x|; the result is 1 −|x|.So
(ff)(x)=
1 −|x|−1 <x<1,
0 otherwise.
This function, known as the tent function, is another common lter (see Sec-
tion 9.3.1).
The Dirac Delta Function
In discrete convolution, we saw that the discrete impulse d acted as an identity:
da = a. In the continuous case, there is also an identity function, called the
Dirac impulse or Dirac delta function, denoted δ(x).
Intuitively, the delta function is a very narrow, very tall spike that has innites-
imal width but still has area equal to 1 (Figure 9.12). The key dening property of
Figure 9.12. The Dirac
delta function δ(
x
).
the delta function is that multiplying it by a function selects out the value exactly
at zero:
−∞
δ(x)f(x)dx = f(0).
The delta function does not have a well-dened value at 0 (you can think of its
value loosely as +), but it does have the value δ(x)=0for all x =0.
From this property of selecting out single values, it follows that the delta func-
tion is the identity for continuous convolution (Figure 9.13). The convolution of
2.1
1.4
2.9
2.1
2.1
1.4
1.4
2.9
2.9
f(x )
δ(t)
δ(t)f (xt)
(δ f )(x)
x
x
t t t
Figure 9.13. Convolving a function with δ(
x
) returns a copy of the same function.
i
i
i
i
i
i
i
i
9.2. Convolution 199
δ with a function f is
(δf)(x)=
−∞
δ(t)f(x t)dt = f(x).
So δf= f.
9.2.5 Discrete-Continuous Convolution
There are two ways to connect the discrete and continuous worlds. One is sam-
pling: we convert a continuous function into a discrete one by writing down the
function’s value at all integer arguments and forgetting about the rest. Given a
continuous function f (x), we can sample it to convert to a discrete sequence a[i]:
a[i]=f(i).
Going the other way, from a discrete function, or sequence, to a continuous func-
tion, is called reconstruction. This is accomplished using yet another form of
convolution, the discrete-continuous form. In this case, we are ltering a discrete
sequence a[i] with a continuous lter f(x):
(af)(x)=
i
a[i]f(x i).
The value of the reconstructed function af at x is a weighted sum of the samples
a[i] for values of i near x (Figure 9.14). The weights come from the lter f,which
is evaluated at a set of points spaced one unit apart. For example, if x =5.3 and
a [i ]
f(xi )
a[i]f(xi )
(af )(x)
x
1
x
2
0 0 0
x
3
× × ×
= = =
Σ
Σ
Σ
Figure 9.14. Discrete-continuous convolution.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.136.233.19