A Candle in the Dark

A look on science, politics, religion and events

Ain’t so convoluted

What’s a convolution, you ask? If you have two functions $f(x)$ and $g(x)$, the convolution of f and g, is defined as $f \otimes g = \int\limits_{-\infty}^{\infty} f(u) g(x-u) du$

where u is the dummy variable of integration.

The notation $f \ast g$ is also used to denote the convolution of f and g, although I’ll be using the former notation. Note that the convolution of f and g is itself a function of x. That is, $h(x) = f \otimes g$

Here’s one way to visualize the convolution. If you have two functions f and g with respect to the dummy variable, what the convolution actually does is,

STEP 1: “Flips” one of the functions about the y-axis. For example, $g(u)$ to $g(-u)$

STEP 2: Shifts it by an amount x. ie, to $g(x-u)$

STEP 3: “Slides” $g(x-u)$ along the u-axis by keeping u fixed, and allowing x to vary all the way from $-\infty$ to $\infty$. The value of the convolution at some point $x_0$, is $h(x_0) = \int\limits_{-\infty}^{\infty} f(u)g(x_0 - u) du$

So, if you consider the convolution integral, the value of the product $h(u) g(x_0-u)$, and hence $h(x_0)$ is zero when the two functions do not intersect. However, when the two functions do intersect, the value of the convolution at that point will be the integral of the product over the entire overlapping region (where the product is non-zero), and this value is simply the area of the overlapping region.

You can see detailed animated illustrations of this idea at Wolfram’s MathWorld.

Another useful way of thinking about the convolution of two functions, is by the concept of a functional. We can consider $h$ as a functional of the function $f$. That is, for every given function $f$, there will be a corresponding value of $h$. So, to calculate the value of $h(x)$ at some point $x_0$, we still need to know the entire function $f$.

There are useful properties associated with convolution. For example, convolutions are
(i) Commutative $f \otimes g = g \otimes f$

So, it doesn’t matter which function you flip.

(ii) Associative $f \otimes (g \otimes h) = (f \otimes g) \otimes h$

(iii) Distributive $f \otimes (g+h) = f \otimes g + f \otimes h$

Convolution theorem:
The convolution theorem is immensely useful to calculate fourier transforms and find fourier pairs. It states that, if $F_1(x) \rightleftharpoons \phi_1(p)$ and $F_2(x) \rightleftharpoons \phi_2(p)$, $F_1(x) \otimes F_2(x) \rightleftharpoons \phi_1(p) \cdot \phi_2(p)$

It’s an interesting result that the fourier transform of the convolution of two functions, is the product of the corresponding fourier transforms of the individual functions. This means that a convolution in the normal domain, becomes a product in the fourier domain and vice-versa

It’s actually easy to prove this useful result. For, if the convolution of two functions is given as $h(x) = \int\limits_{-\infty}^{\infty}F_1(u)F_2(x-u)du$

Then the fourier transform of h(x) is $\int\limits_{-\infty}^{\infty} h(x) e^{2 \pi i p x} dx$ $= \int\limits_{-\infty}^{\infty} \left( \int\limits_{-\infty}^{\infty} F_1(u)F_2(x-u) du\right) e^{2 \pi i x p} dx$ $= \int\limits_{-\infty}^{\infty} \int\limits_{-\infty}^{\infty} F_1(u) F_2(x-u) e^{2 \pi i x p} du dx$

Since x is a dummy variable, set $x-u=z$, while holding u constant, so that the integral reduces to $\int\limits_{-\infty}^{\infty} \int\limits_{-\infty}^{\infty} F_1(u) F_2(z) e^{2 \pi i p (z+u)} du dz$ $= \left(\int\limits_{-\infty}^{\infty} F_1(u) e^{2 \pi i p u} du\right) \cdot \left( \int\limits_{-\infty}^{\infty} F_2(z) e^{2 \pi i z p} dz \right)$ $= \phi_1(p) \cdot \phi_2(p)$

We can apply this theorem to find various convolutions. Here’s an example.

(i) Convolution with a delta function

Let $f(x) \rightleftharpoons \phi(p)$

We’re now interested in the convolution of f with a shifted delta function, $f(x) \otimes \delta(x-a)$
To find this, let’s apply the convolution theorem. We know that $f(x) \rightleftharpoons \phi(p)$ and $\delta(x-a) \rightleftharpoons e^{- 2 \pi i p a}$. Therefore $f(x) \otimes \delta(x-a) \rightleftharpoons \phi(p) \cdot e^{- 2 \pi i p a}$

And taking the inverse fourier transform of $\phi(p) \cdot e^{- 2 \pi i p a}$, we find that $f(x) \otimes \delta(x-a)$ is $f(x-a)$. Notice that f(x) is shifted by an amount a.

Finally, I’ll discuss one more property I’ll need to use before I move on to a part of what I’m currently working on, which is the application of fourier analysis in interferometry and diffraction. This property is the derivative of fourier transforms.

If, $F(x) \rightleftharpoons \phi(p)$, $\frac{dF}{dx} \rightleftharpoons -2 \pi i p \phi(p)$

and therefore, $\frac{d^n F}{dx^n} \rightleftharpoons \left(-2 \pi i p \right)^n \phi(p)$

which you can easily check this, by use of the Leibniz rule. This property of fourier transforms is useful in solving linear PDE’s.

Written by parseval

June 30, 2007 at 8:18 pm

Posted in mathematics

3 Responses

1. You can look at the convolution from another perspective.
Let f(x) be a physical quantity to be measured; faced with a limitation on the accuracy of the measuring device, you associate a “resolution function ” g(y) with the measurement made. Now your observed value h(u) is a convolution of the true distribution f(x) and the resolution function g(y) evaluated at x-u . the term g(x-u)du is representative of the probability that h(x) ->f(u) as u->x . evidently, if your resolution function is the dirac delta function, then the observed distrbution is always the true distribution. chiru

July 1, 2007 at 2:11 pm

2. Yeah, and in fact, that was to be a part of my next post 🙂

To add a physical example to what you said, consider the situation where we are trying to measure some light spectrum with a spectrometer. Now, if we measure a monochromatic source of light with the spectrometer, ideally the spectrometer should show a “spike” or a delta function only at that frequency.

However, since the spectrometer isn’t ideal, you’d see something like a steep gaussian function rather than a single infinte spike. So, if we “feed” a single delta function $\delta(\nu-\mu)$ to the spectrometer, we get an output of the form $f(\delta(\nu-\mu))$ , which is the impulse response of the system. (or the “resolution function” of the system as you called it)

Now, let’s measure a whole spectrum with our spectrometer. Let $x(\nu)$ be the actual intensity vs frequency spectrum we need to measure. First, by the property of the delta function, we have $x(\nu) = \int\limits_{-\infty}^{\infty} x(\mu) \delta(\mu - \nu) d\mu$.

So, if feed this actual distribution to our spectrometer, the output function will be, $F(x(\nu)) = f(\int\limits_{-\infty}^{\infty} x(\mu) \delta(\mu - \nu) d\mu)$.

Now the impulse response function is linear. That is, $f(a_1\delta(\nu)+a_2\delta(\nu)) = a_1f(\delta(\nu)) + a_2f(\delta(\nu))$.

Since the integral can be written as a reimann sum, we have $f(x(\nu)) = \int\limits_{-\infty}^{\infty} x(\mu) f( \delta(\mu - \nu)) d\mu$.

Which is nothing but the convolution of the “true” spectrum $x(\mu)$ with the resolution or the impulse response function, as you pointed out in your comment. parseval

July 1, 2007 at 3:48 pm

3. Sweet explanation, thanks nb

October 10, 2007 at 2:12 am