# 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

## More on “the museum”

Here’s a follow up to the museum of horrors. Last week, a bunch of scientists1 visited the creation museum and explored the place while trying to figure out just how bad it actually was. You can take a look at the reports which they’ve put up on their blogs on the brutal butchery of science.

Notes
[1] – Among them were Prof Steve Steve, Dr Tara, Dr Jason

Written by parseval

June 25, 2007 at 2:40 pm

Posted in pseudoscience, religion

## FT of some common functions

with one comment

In this post, let’s look at the fourier transform of some functions which are quite useful.

(i) The rectangle function
We’ll start with the rectangular function, also called the box function. It’s defined as

$f_a(x) = \begin{cases} 0, \quad |x| > a/2 \\ 1, \quad |x| \leq a/2 \end{cases}$

Now, consider the fourier pair of $f(x)$. We have,

$\phi(p) = \int\limits_{-\infty}^{\infty} f(x) e^{2 \pi i p x}dx$

$= \int\limits_{-a/2}^{a/2} e^{2 \pi i p x}dx$

$= \left(e^{2 \pi i p a/2} - e^{-2 \pi i p a/2}\right)/ \left(2 \pi i p \right)$

$= a \sin(\pi p a)/(\pi p a)$

$= a \text{sinc} (\pi p a)$

So, the fourier transform of the boxcar function is the sinc function!

I’ll revist this fourier pair again, while discussing the wave theory of light. In fact, we can use this fourier pair to show that the interference pattern we get in a double slit experiment is infact the sinc function!

(ii) The Gaussian function

Next, we’ll look at the gaussian function. The gaussian function has the interesting property that it’s fourier pair is also a gaussian function! Consider,

$f(x) = e^{-x^2/a^2}$

Let’s caculate the fourier pair, $\phi(p)$.

$\phi(p) = \int\limits_{-\infty}^{\infty} e^{\frac{-x^2}{a^2}} e^{2 \pi i p x} dx$
$= \phi(p) = \int\limits_{-\infty}^{\infty} e^{-\left(x/a - a \pi i p\right)^2} e^{-pi^2 p^2 a^2} dx$

To evaluate this integral, use the substitution,
$x/a - a \pi i p=r$

After evaluating the integral and substituting the limits, the expression for $\phi(p)$ is obtained as,

$\phi(p) = a \sqrt{\pi} e^{-\pi^2 p^2 a^2}$

which is also a gaussian.

Also, if you try plotting the fourier pairs for different values of a (and hence, different widths of the gaussian), you’ll notice that the wider the gaussian in x-space, the narrower it is in p-space (ie, the transform space), and vice versa.

(iii) The delta function

The dirac delta function (although, not strictly a function), can be represented as
$\delta(x) = \begin{cases} 0, \quad x \neq 0 \\ \infty, \quad x = 0 \end{cases}$

Now let’s apply the fourier transform to the delta function. We get,

$\phi(p) = \int\limits_{-\infty}^{\infty} \delta(x) e^{2 \pi i p x} dx$

and by the property of the delta function, this is,

$= e^{2 \pi i p 0}$

$= 1$

Therefore, we find that the fourier pair of the delta function is unity. That is $\delta(x) \rightleftharpoons 1$

Also, notice that
$\delta(x-a) \rightleftharpoons e^{2 \pi p a}$
$\delta(x+a) \rightleftharpoons e^{- 2 \pi p a}$

and hence,
$\delta(x+a) + \delta(x-a) \rightleftharpoons 2 \cos(2 \pi p a)$

(iv) The Shah function

The shah function, also known as a Dirac comb, is an infinite combination of evenly spaced dirac functions.

$f_a(x)= \sum_{n=-\infty}^{\infty} \delta(x-an)$

The fourier transform of the shah function is also another shah function, with a period of 1/a. You’ll find that the shah function is quite invaluable in convolutions, where it’s role is to create infinte “copies” of the original function, with period equal to the spacing between the teeth of the comb.

In my next post, I’ll explain more about convolution, especially the convolution theorem which is a real time saver in performing transforms, and other theorems relating to fourier transforms

Note: If you find any errors, please do inform me, and I’ll correct them. Also, click on the thumbnail images to get a detailed graph

Written by parseval

June 22, 2007 at 2:26 pm

Posted in mathematics

## Fourier transforms for the practical person

In this series of posts, I plan to outline some basic ideas which I’ve learnt on the theory of Fourier transforms, and it’s practical applications in a non-rigorous manner. Once I’ve laid out the basics, I’ll then show you some interesting stuff from what I’m currently working on.

Let’s start with Fourier series. It’s actually a remarkable fact, that we can express any arbitrary periodic function, simply as the sum of the ordinary sine and cosine functions we’ve all studied at high school. If $F(t)$ is a periodic function, then we have

$F(t) = \sum_{n=-\infty}^{\infty} A_n \cos(2 \pi n \nu_0 t) + B_n \sin(2 \pi n \nu_0 t)$

The Fourier transform is an extension of this, as the period of the function approaches infinity, and the gap between successive harmonics approaches 0. So, in some sense, the fourier transform decomposes a function into it’s frequency components.

For a non-periodic function $F(t)$ which satisfies certain conditions, there are many conventions of describing the fourier transform. Following one such convention which is widely used, the forward fourier transform is

$F(t)=\int\limits_{-\infty}^{\infty} \phi(\nu) e^{-2 \pi i \nu t} d\nu$

While, the inverse fourier transform is

$\phi(\nu)=\int\limits_{-\infty}^{\infty} F(t) e^{+2 \pi i \nu t} dt$

Notice that, if $F(t)$ is a continuous time signal, then it’s transformed into the frequency domain by the forward transform. One of the properties of the fourier transforms is that, $\phi(\nu)$ and $F(t)$ are transforms of each other, and form a fourier pair, and are represented by $F(t) \rightleftharpoons \phi(\nu)$.

This means that, if $f(x) \rightleftharpoons \phi(p)$, then

$f(x)=\int\limits_{-\infty}^{\infty} \left( \int\limits_{-\infty}^{\infty} f(x) e^{2 \pi i x p}dx \right) e^{-2 \pi i x p} dp$

if $f(x)$ isn’t discontinuous. If it is discontinuous, then the value at that point will be the average of the value around the discontinuity. So, we can simplify our terminology and say that the fourier transform of $\phi(p)$ is $f(x)$ and vice versa.

In the next post, I’ll look at the fourier transform of some useful functions, but before that, there’s one more nice result. For an Electromagnetic wave, or a signal in a wire, the fourier transform of the voltage can be complex. However the conjugate product $\phi(\nu) \phi^{\ast}(\nu)=|\phi(\nu)|^2$, is real and is proportional to the power density (or, power per unit frequency). This is know as the spectral power density.

Written by parseval

June 16, 2007 at 8:35 am

Posted in mathematics

## Fishy Medicine

It’s time again for the annual “miracle fish cure”. You’ve all probably heard of the amazing fish “medicine” that the Bathini Goud family offers to people who suffer from Asthma. This year’s event has recently started in Hyderabad1.

Asthmatics gather in Hyderabad for “miracle cure”

Thousands of asthmatics have lined up in Hyderabad to take the ”fish medicine” that the Bathini Goud family has been administering since 1845.

It’s a purported miracle cure, where patients swallow a live fish whole, to be cured of asthma.

One memember of the family which gives the “medicine”, claims (emphasis mine)

Cheating means to cheat someone. Here the crowds have come themselves, ask them if they are being charged without getting cured. That would be cheating. These people do not even know what cheating is,”

That’s the pity. But, I think he should know. Raising hopes with a false claim, whose efficacy has never been verified in any test, and potentially endangering the lives of asthmatics who move away from conventional (yet exteremly effective) inhalers and corticosteroids, is very much cheating.

It saddens me somewhat, that such rubbish is still being practised freely. How hard would it be to conduct a double blind experiment to see if the drug really works? And if it works, to analyze the ingredients and try understanding the chemical basis for it’s efficacy, and improving it? Why doesn’t any one in our government intervene to put an end to this nonsense2?

I long for the day when the majority of our society wakes up from a demon haunted world. IMO, public awarness of science can play a large role and serve as a candle in our dark, superstitous society.

Notes

Written by parseval

June 9, 2007 at 8:28 pm

Posted in politics, pseudoscience

## Creation Museum

with one comment

Imagine that you’re visiting a museum for the first time on a bright sunny afternoon, perhaps with your family or kids. You say to yourself “Hey, this is going to be a great experience. It’ll be wonderful to look at fossils, learn about the history of the earth, the time scale involved and about evolution”.

But then, when you enter the museum, you notice something peculiar. A T-rex grazing in a meadow with human children playing around it? Museum guides calmly explaining that the Earth is 6000 years old? A Triceratops wearing a saddle? What’s going on?

Well, It sure ain’t Kansas anymore. Belive it or not, these are scenes from the recently opened, 27 million dollar, Creation Museum in Kentucky.

The Creation Museum proudly claims to present a “walk through history”, and bring the pages of the Bible to life. In fact, the co-founder of the museum claims that “It’s a great place for children who are in public school and haven’t really decided what to believe yet”. Really? Take a look at a photographic tour of the exhibits for yourself.

What’s more astonishing is that museum opened to a full crowd, with more than 4000 visitors in the first day. A related survey conducted by the Princeton Survey Research Associates International, showed that 48% of Americans polled believed that “God created humans pretty much in the present form at one time within the last 10,000 years or so” 1.

The first time I read this, all I could think was

HUH?? IS THIS FOR REAL?

Passing of lies to young children as science is beyond shameful, it’s criminal.

Although I’m sorely tempted to rant further about this atrocity, I’ll simply end with the Wizard’s First Rule

People are stupid; given proper motivation, almost anyone will believe almost anything. Because people are stupid, they will believe a lie because they want to believe it’s true, or because they are afraid it might be true. People’s heads are full of knowledge, facts, and beliefs, and most of it is false, yet they think it all true. People are stupid; they can only rarely tell the difference between a lie and the truth, and yet they are confident they can, and so all are easier to fool.

Notes

Written by parseval

June 2, 2007 at 10:06 am

Posted in pseudoscience, religion