Processing math: 100%
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

9.6: The Convolution Operation

( \newcommand{\kernel}{\mathrm{null}\,}\)

In the list of properties of the Fourier transform, we defined the convolution of two functions, f(x) and g(x) to be the integral

(fg)(x)=f(t)g(xt)dt.

In some sense one is looking at a sum of the overlaps of one of the functions and all of the shifted versions of the other function. The German word for convolution is faltung, which means "folding" and in old texts this is referred to as the Faltung Theorem. In this section we will look into the convolution operation and its Fourier transform.

Before we get too involved with the convolution operation, it should be noted that there are really two things you need to take away from this discussion. The rest is detail. First, the convolution of two functions is a new functions as defined by (???) when dealing wit the Fourier transform. The second and most relevant is that the Fourier transform of the convolution of two functions is the product of the transforms of each function. The rest is all about the use and consequences of these two statements. In this section we will show how the convolution works and how it is useful.

Note

The convolution is commutative.

First, we note that the convolution is commutative: fg=gf. This is easily shown by replacing xt with a new variable, y=xt and dy=dt.

(gf)(x)=g(t)f(xt)dt=g(xy)f(y)dy=f(y)g(xy)dy=(fg)(x).

The best way to understand the folding of the functions in the convolution is to take two functions and convolve them. The next example gives a graphical rendition followed by a direct computation of the convolution. The reader is encouraged to carry out these analyses for other functions.

Example 9.6.1

Graphical Convolution of the box function and a triangle function.

Solution

In order to understand the convolution operation, we need to apply it to specific functions. We will first do this graphically for the box function

f(x)={1,|x|1,0,|x|>1

and the triangular function

g(x)={x,0x1,0,otherwise

as shown in Figure 9.6.1.

clipboard_e6a907b0041c2ac188a19c9537ce3c187.png
Figure 9.6.1: A plot of the box function f(x) and the triangle function g(x).

Next, we determine the contributions to the integrand. We consider the shifted and reflected function g(tx) in Equation (???) for various values of t. For t=0, we have g(x0)=g(x). This function is a reflection of the triangle function, g(x), as shown in Figure 9.6.2.

clipboard_ee5e7b1aae9b40ca5510f962174accdfb.png
Figure 9.6.2: A plot of the reflected triangle function, g(t).

We then translate the triangle function performing horizontal shifts by t. In Figure 9.6.3 we show such a shifted and reflected g(x) for t=2, or g(2x).

clipboard_e7b2d44581f89c5223abcb20017d175b5.png
Figure 9.6.3: A plot of the reflected triangle function shifted by 2 units, g(2t).

In Figure 9.6.3 we show several plots of other shifts, g(xt), superimposed on f(x).

The integrand is the product of f(t) and g(xt) and the integral of the product f(t)g(xt) is given by the sum of the shaded areas for each value of x.

In the first plot of Figure 9.6.4 the area is zero, as there is no overlap of the functions. Intermediate shift values are displayed in the other plots in Figure 9.6.4. The value of the convolution at x is shown by the area under the product of the two functions for each value of x.

clipboard_e25bd11f03e4c3d51e61ba834dde2d46e.png
Figure 9.6.4: A plot of the box and triangle functions with the overlap indicated by the shaded area.

Plots of the areas of the convolution of the box and triangle functions for several values of x are given in Figure 9.6.3. We see that the value of the convolution integral builds up and then quickly drops to zero as a function of x. In Figure 9.6.5 the values of these areas is shown as a function of x.

clipboard_edb3d7b7a36c0efbbf1203b09197075c2.png
Figure 9.6.5: Copy and Paste Caption here. (Copyright; author via source)

The plot of the convolution in Figure 9.6.5 is not easily determined using the graphical method. However, we can directly compute the convolution as shown in the next example.

Example 9.6.2

Analytically find the convolution of the box function and the triangle function.

Solution

The nonvanishing contributions to the convolution integral are when both f(t) and g(xt) do not vanish. f(t) is nonzero for |t|1, or 1t1.g(xt) is nonzero for 0xt1, or x1tx. These two regions are shown in Figure 9.6.6. On this region, f(t)g(xt)=xt.

clipboard_e76f9252116cc5b305c095843735c97a4.png
Figure 9.6.6: Intersection of the support of g(x) and f(x).

Isolating the intersection in Figure 9.6.7, we see in Figure 9.6.7 that there are three regions as shown by different shadings. These regions lead to a piecewise defined function with three different branches of nonzero values for 1<x<0, 0<x<1, and 1<x<2.

clipboard_e4534d84d87b81c39823aad08a8161f55.png
Figure 9.6.7: Intersection of the support of g(x) and f(x) showing the integration regions.

The values of the convolution can be determined through careful integration. The resulting integrals are given as

(fg)(x)=f(t)g(xt)dt={x1(xt)dt,1<x<0xx1(xt)dt,0<x<11x1(xt)dt,1<x<2={12(x+1)2,1<x<012,0<x<112[1(x1)2]1<x<2

A plot of this function is shown in Figure 9.6.5.

Convolution Theorem for Fourier Transforms

In this section we compute the Fourier transform of the convolution integral and show that the Fourier transform of the convolution is the product of the transforms of each function,

F[fg]=ˆf(k)ˆg(k).

First, we use the definitions of the Fourier transform and the convolution to write the transform as

F[fg]=(fg)(x)eikxdx=(f(t)g(xt)dt)eikxdx=(g(xt)eikxdx)f(t)dt.

We now substitute y=xt on the inside integral and separate the integrals:

F[fg]=(g(xt)eikxdx)f(t)dt=(g(y)eik(y+t)dy)f(t)dt=(g(y)eikydy)f(t)eiktdt=(f(t)eiktdt)(g(y)eikydy)

We see that the two integrals are just the Fourier transforms of f and g. Therefore, the Fourier transform of a convolution is the product of the Fourier transforms of the functions involved:

F[fg]=ˆf(k)ˆg(k)

Example 9.6.3

Compute the convolution of the box function of height one and width two with itself.

Solution

Let ˆf(k) be the Fourier transform of f(x). Then, the Convolution Theorem says that F[ff](k)=ˆf2(k), or

(ff)(x)=F1[ˆf2(k)].

For the box function, we have already found that

ˆf(k)=2ksink.

So, we need to compute

(ff)(x)=F1[4k2sin2k]=12π(4k2sin2k)eikxdk.

One way to compute this integral is to extend the computation into the complex k-plane. We first need to rewrite the integrand. Thus,

(ff)(x)=12π4k2sin2keikxdk=1π1k2[1cos2k]eikxdk=1π1k2[112(eik+eik)]eikxdk=1π1k2[eikx12(ei(1k)+ei(1+k))]dk.

We can compute the above integrals if we know how to compute the integral

I(y)=1πeikyk2dk.

Then, the result can be found in terms of I(y) as

(ff)(x)=I(x)12[I(1k)+I(1+k)].

We consider the integral

Ceiyzπz2dz

over the contour in Figure 9.6.8.

clipboard_e9435ebac0bfcda0f3a28322f1be53600.png
Figure 9.6.8: Contour for computing Peiyzπz2dz.

We can see that there is a double pole at z=0. The pole is on the real axis. So, we will need to cut out the pole as we seek the value of the principal value integral.

Recall from Chapter 8 that

CReiyzπz2dz=ΓReiyzπz2dz+ϵReiyzπz2dz+Ceeiyzπz2dz+Rϵeiyzπz2dz.

The integral CReiyzπz2dz vanishes since there are no poles enclosed in the contour! The sum of the second and fourth integrals gives the integral we seek as ϵ0 and R. The integral over ΓR will vanish as R gets large according to Jordan’s Lemma provided y<0. That leaves the integral over the small semicircle.

As before, we can show that

limϵ0Cϵf(z)dz=πiRes[f(z);z=0].

Therefore, we find

I(y)=Peiyzπz2dz=πiRes[eiyzπz2;z=0].

A simple computation of the reside gives I(y)=y, for y<0.

When y>0, we need to close the contour in the lower half plane in order to apply Jordan’s Lemma. Carrying out the computation, one finds I(y)=y, for y>0. Thus,

I(y)={y,y>0,y,y<0,

We are now ready to finish the computation of the convolution. We have to combine the integrals I(y),I(y+1), and I(y1), since (ff)(x)=I(x) 12[I(1k)+I(1+k)]. This gives different results in four intervals:

(ff)(x)=x12[(x2)+(x+2)]=0,x<2,=x12[(x2)(x+2)]=2+x2<x<0,=x12[(x2)(x+2)]=2x,0<x<2,=x12[(x2)(x+2)]=0,x>2.

A plot of this solution is the triangle function,

(ff)(x)={0,x<22+x,2<x<02x,0<x<20,x>2

which was shown in the last example.

Example 9.6.4

Find the convolution of the box function of height one and width two with itself using a direct computation of the convolution integral.

Solution

The nonvanishing contributions to the convolution integral are when both f(t) and f(xt) do not vanish. f(t) is nonzero for |t|1, or 1t1.f(xt) is nonzero for |xt|1, or x1tx+1. These two regions are shown in Figure 9.6.10. On this region, f(t)g(xt)=1.

clipboard_ee1f94c0e08ef1fb63063cc73d8e9c75f.png
Figure 9.6.9: Plot of the regions of support for f(t) and f(xt).
clipboard_e0491afa61fae3c8cf02208dd45f25ec3.png
Figure 9.6.10: A plot of the convolution of a box function with itself. The areas of the overlaps of as f(xt) is translated across f(t) are shown as well. The result is the triangular function.

Thus, the nonzero contributions to the convolution are

(ff)(x)={x+11dt,0x2,1x1dt,2x0,={2+x,0x2,2x,2x0.

Once again, we arrive at the triangle function.

In the last section we showed the graphical convolution. For completeness, we do the same for this example. In Figure 9.6.10 we show the results. We see that the convolution of two box functions is a triangle function.

Example 9.6.5

Show the graphical convolution of the box function of height one and width two with itself.

Let’s consider a slightly more complicated example, the convolution of two Gaussian functions.

Example 9.6.6

Convolution of two Gaussian functions f(x)=eax2.

Solution

In this example we will compute the convolution of two Gaussian functions with different widths. Let f(x)=eax2 and g(x)=ebx2. A direct evaluation of the integral would be to compute

(fg)(x)=f(t)g(xt)dt=eat2b(xt)2dt.

This integral can be rewritten as

(fg)(x)=ebx2e(a+b)t2+2bxtdt.

One could proceed to complete the square and finish carrying out the integration. However, we will use the Convolution Theorem to evaluate the convolution and leave the evaluation of this integral to Problem 12.

Recalling the Fourier transform of a Gaussian from Example 9.5.1, we have

ˆf(k)=F[eax2]=πaek2/4a

and

ˆg(k)=F[ebx2]=πbek2/4b.

Denoting the convolution function by h(x)=(fg)(x), the Convolution Theorem gives

ˆh(k)=ˆf(k)ˆg(k)=πabek2/4aek2/4b.

This is another Gaussian function, as seen by rewriting the Fourier transform of h(x) as

ˆh(k)=πabe14(1a+1b)k2=πabea+b4abk2.

In order to complete the evaluation of the convolution of these two Gaussian functions, we need to find the inverse transform of the Gaussian in Equation (???). We can do this by looking at Equation (???). We have first that

F1[πaek2/4a]=eax2.

Moving the constants, we then obtain

F1[ek2/4a]=aπeax2.

We now make the substitution α=14a,

F1[eαk2]=14παex2/4α.

This is in the form needed to invert (???). Thus, for α=a+b4ab we find

(fg)(x)=h(x)=πa+beaba+bx2.

Application to Signal Analysis

There are many applications of the convolution operation. One of these areas is the study of analog signals. An analog signal is a continuous signal and may contain either a finite, or continuous, set of frequencies. Fourier transforms can be used to represent such signals as a sum over the frequency content of these signals. In this section we will describe how convolutions can be used in studying signal analysis.

The first application is filtering. For a given signal there might be some noise in the signal, or some undesirable high frequencies. For example, a device used for recording an analog signal might naturally not be able to record high frequencies. Let f(t) denote the amplitude of a given analog signal and ˆf(ω) be the Fourier transform of this signal such the example provided in Figure 9.6.11. Recall that the Fourier transform gives the frequency content of the signal.

clipboard_ef71080320d20afbf93bf62ec9f193b0c.png
Figure 9.6.11: Schematic plot of a signal f(t) and its Fourier transform ˆf(ω).

There are many ways to filter out unwanted frequencies. The simplest would be to just drop all of the high (angular) frequencies. For example, for some cutoff frequency ω0 frequencies |ω|>ω0 will be removed. The Fourier transform of the filtered signal would then be zero for |ω|>ω0. This could be accomplished by multiplying the Fourier transform of the signal by a function that vanishes for |ω|>ω0. For example, we could use the gate function

pω0(ω)={1,|ω|ω00,|ω|>ω0,

as shown in Figure 9.6.12.

clipboard_ec68afa9bc8d81753835cad1447c91ff8.png
Figure 9.6.12: (a) Plot of the Fourier transform f(ω) of a signal. (b) The gate function pω0(ω) used to filter out high frequencies. (c) The product of the functions, ˆg(ω)=ˆf(ω)pω0(ω), in (a) and (b) shows how the filters cuts out high frequencies, |ω|>ω0.

In general, we multiply the Fourier transform of the signal by some filtering function ˆh(t) to get the Fourier transform of the filtered signal,

ˆg(ω)=ˆf(ω)ˆh(ω).

The new signal, g(t) is then the inverse Fourier transform of this product, giving the new signal as a convolution:

g(t)=F1[ˆf(ω)ˆh(ω)]=h(tτ)f(τ)dτ.

Such processes occur often in systems theory as well. One thinks of f(t) as the input signal into some filtering device which in turn produces the output, g(t). The function h(t) is called the impulse response. This is because it is a response to the impulse function, δ(t). In this case, one has

h(tτ)δ(τ)dτ=h(t).

Another application of the convolution is in windowing. This represents what happens when one measures a real signal. Real signals cannot be recorded for all values of time. Instead data is collected over a finite time interval. If the length of time the data is collected is T, then the resulting signal is zero outside this time interval. This can be modeled in the same way as with filtering, except the new signal will be the product of the old signal with the windowing function. The resulting Fourier transform of the new signal will be a convolution of the Fourier transforms of the original signal and the windowing function.

Example 9.6.7: Finite Wave Train, Revisited

We return to the finite wave train in Example 9.5.6 given by

h(t)={cosω0t,|t|a0,|t|>a.

Solution

We can view this as a windowed version of f(t)=cosω0 t obtained by multiplying f(t) by the gate function

ga(t)={1,|x|a0,|x|>a

This is shown in Figure 9.6.13. Then, the Fourier transform is given as a convolution,

ˆh(ω)=(ˆfˆga)(ω)=12πˆf(ωv)ˆga(v)dv.

Note that the convolution in frequency space requires the extra factor of 1/(2π).

clipboard_e66bd3d82b59ff0f5efc3240b67ad323a.png
Figure 9.6.13: A plot of the finite wave train.
Note

The convolution in spectral space is defined with an extra factor of 1/2π so as to preserve the idea that the inverse Fourier transform of a convolution is the product of the corresponding signals.

We need the Fourier transforms of f and ga in order to finish the computation. The Fourier transform of the box function was found in Example 9.5.2 as

ˆga(ω)=2ωsinωa

The Fourier transform of the cosine function, f(t)=cosω0t, is

ˆf(ω)=cos(ω0t)eiωtdt=12(eiω0t+eiω0t)eiωtdt=12(ei(ω+ω0)t+ei(ωω0)t)dt=π[δ(ω+ω0)+δ(ωω0)]

Note that we had earlier computed the inverse Fourier transform of this function in Example 9.5.5.

Inserting these results in the convolution integral, we have

ˆh(ω)=12πˆf(ωv)ˆga(v)dv=12ππ[δ(ωv+ω0)+δ(ωvω0)]2vsinvadv=sin(ω+ω0)aω+ω0+sin(ωω0)aωω0.

This is the same result we had obtained in Example 9.5.6.

Parseval’s Equality

Note

The integral/sum of the (modulus) square of a function is the integral/sum of the (modulus) square of the transform.

As another example of the convolution theorem, we derive Parseval’s Equality (named after Marc-Antoine Parseval (1755-1836)):

|f(t)|2dt=12π|ˆf(ω)|2dω.

This equality has a physical meaning for signals. The integral on the left side is a measure of the energy content of the signal in the time domain. The right side provides a measure of the energy content of the transform of the signal. Parseval’s equality, is simply a statement that the energy is invariant under the Fourier transform. Parseval’s equality is a special case of Plancherel’s formula (named after Michel Plancherel, 1885-1967).

Let’s rewrite the Convolution Theorem in its inverse form

F1[ˆf(k)ˆg(k)]=(fg)(t).

Then, by the definition of the inverse Fourier transform, we have

f(tu)g(u)du=12πˆf(ω)ˆg(ω)eiωtdω.

Setting t=0,

f(u)g(u)du=12πˆf(ω)ˆg(ω)dω.

Now, let g(t)=¯f(t), or f(t)=¯g(t). We note that the Fourier transform of g(t) is related to the Fourier transform of f(t) :

ˆg(ω)=¯f(t)eiωtdt=¯f(τ)eiωτdτ=f(τ)eiωτdτ=ˉf(ω).

So, inserting this result into Equation (???), we find that

f(u)¯f(u)du=12π|ˆf(ω)|2dω

which yields Parseval’s Equality in the form (???) after substituting t=u on the left.

As noted above, the forms in Equations (???) and (???) are often referred to as the Plancherel formula or Parseval formula. A more commonly defined Parseval equation is that given for Fourier series. For example, for a function f(x) defined on [π,π], which has a Fourier series representation, we have

a202+n=1(a2n+b2n)=1πππ[f(x)]2dx.

In general, there is a Parseval identity for functions that can be expanded in a complete sets of orthonormal functions, {ϕn(x)},n=1,2,, which is given by

n=1<f,ϕn>2=f2.

Here f2=f,f. The Fourier series example is just a special case of this formula.


This page titled 9.6: The Convolution Operation is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Russell Herman via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?