I want to show you something that I think is really neat. (Whether you think it is neat is your decision, not mine. I don’t like it when people tell me what I will think about something they’re about to show me.)

I do not know why this calculation is not readily available. All I know is that I had to search high and low to find an example with sufficient detail that I could duplicate it. In fact, it is difficult to find a text which actually states the result at all, never mind one which works it out for a particular case.

- I intend to take a function which is zero outside the interval [-1/2, 1/2]…
- I will compute several terms in the associated Fourier series…
- I will compute its Fourier transform…
- and I will hit you between the eyes with the relationship between them.

I won’t even keep it a secret:

- the coefficients in the Fourier series are samples of the Fourier transform.
- alternatively, the Fourier transform of the Fourier series is discrete samples of the original continuous Fourier transform.

I think that’s marvelous. But even knowing that it’s true, I don’t see it stated very often.

There are several things I will not do in this post.

- I will use but not discuss Fourier series or the Fourier transform;
- I will work the example for a very specific set of parameters;
- that is, I will not yet try changing the interval to, say, [0, 2 ];
- I won’t even prove the relationship;
- I will not show you the relationship to the discrete Fourier transform (i.e. the FFT);

**I should say that the proof really just amounts to showing that the Fourier transform of the cosine exists and is a pair of delta functions.**

It may be that the FFT is so important that most people do not care about the relationship between a Fourier series and a Fourier transform. Well, I do.

Having told you all the things I will not do in this post, let me emphasize that I think this example — or, frankly, any similar example — is marvelous and worthwhile. There are a lot of things that have to be done right to get the details to come out right. And given one good example, I can make a whole lot of sense out of theory.

This example is based on one in Bracewell (Bracewell, Ronald N.; **The Fourier Transformation and Its Applications**. McGraw Hill, 2000 (3rd ed). ISBN 0 07 303938 1), around p. 244, slightly modified. It is a most excellent book for insight; the mathematics is there, and right, but in the background. The text is marred by typos, but is extraordinary despite them.

I need some pictures. To get them, I need four things. I start with a **Fourier transform**, namely the square of a sinc function, which itself is some form of sin(x) / x:

We find the **inverse Fourier transform**:

Hey, it’s our favorite counterexample for wavelets: the linear spline scaling function. Ok, it’s skinnier, not of width 2, but it is a triangle. This one does not even fill up the interval [-1/2, 1/2].

Next, I need the **Fourier Series** of that triangle. Well, I don’t really want an infinite series; I just want a finite approximation. Let’s get 7 terms icluding the constant:

Mathematica complains about convergence, but it turns out, it’s good enough. We see that there is no term in , so it looks like we only got 6 terms.

I have shown both the Fourier Series in red and the original single triangle in blue. Strictly speaking, and we need to be strict on this point, that is not the Fourier series of the triangle, but of its periodic extension. We might call it the Fourier series associated with the single triangular pulse.

Finally, just for the drawings, I want to **sample the Fourier Transform at the integers:**

.

Let me put it all together.

The top left is a single triangular pulse in the time domain, of height 1, centered at the origin, of width 0.4. We might say it is band-limited in time, or that it is of compact support.

The top right is the Fourier transform of that triangular pulse. It is continuous, and not of compact support.

The bottom left shows the triangular pulse and (the first 7 terms of) its fourier series. Although the triangular pulse is not periodic, the Fourier series is.

The bottom right shows two things. The continuous Fourier transform and red dots which are, by definition, samples of that transform.

Drum roll, please. **They are also the coefficients of the fourier series.**

How can that be? For crying out loud, there are 13 samples but 7 coefficients! Worse, although the constant term in the Fourier series is .2, and that is equal to the sample F[0], the first cosine term has coefficient 0.350056 while the sample F[1] = 0.175028 .

Hey, if we multiply the sample value by 2, we get: 0.350056 . Which is our leading cosine coefficient.

Conceptually, some of our samples are for negative frequencies, but we wrote the Fourier series with positive frequencies only. If we use complex exponentials instead of cosines, then we get negative frequencies too, and the series coefficients will be cut in half (except the constant term).

Alternatively (but equivalently), since , an individual series term such as

could be wriiten as

,

and there are our sample values equal to 0.175028 at -1 and 1.

Let me take a longer look.

We started with the Fourier transform:

.

If we remember that the sinc function is the Fourier transform of a rectangle, then the sinc^2 function is the Fourier transform of the convolution of two rectangles.

But the convolution of two rectangles is a triangle. That the inverse Fourier transform is a triangle should seem more than plausible.

Specifically, it turns out to be:

.

I can’t say I like the way Mathematica writes it, but the graph showed that we do in fact have a single triangular pulse.

Then I asked Mathematica for the first 7 terms of the Fourier series of the triangle:

.

As I said, it turns out there are in fact only 6 terms: we are missing one in . (Strictly speaking, my command probably asked Mathematica for the first 6 non-zero terms. Whatever.)

Finally, I computed and plotted samples of the fourier transform. What were the samples? The plotted points were

so the y-values were the right column of that array.

Let me explicitly convert the fourier series to complex exponentials, using

.

It takes me a little work to get Mathematica to display those coefficients in order (i.e. the coefficient of followed by the coefficient of , and so on). but when I have them, the ordered list is:

{0.00486189, 0, 0.0109393, 0.0509144, 0.114557, 0.175028, 0.2,

0.175028, 0.114557, 0.0509144, 0.0109393, 0, 0.00486189}

so there we have the 13 fourier series coefficients for the first several powers of , where “several” is n = -6 to 6.

I observe that the missing term in the Fourier series corresponds to a sample value of… 0.

Hit that drum again, maestro, while I repeat myself. **Those 13 coefficients are exactly the 13 samples of the fourier transform.**

I am not quite done. What we have is a fascinating observation. The Fourier series coefficients are samples of the Fourier transform.

**But why?**

Consider that we have two different functions of time: the triangle and the (truncated) Fourier series.

Maybe we should find the Fourier transform of the Fourier series instead of the Fourier transform of the single triangle.

Recall the truncated fourier series

.

Ask for its fourier transform and get

.

We see two things. One, Dirac deltas at the integers. This tells us that the Fourier transform of the Fourier series is discrete not continuous. Two, the coefficients in front of the Dirac deltas are precisely the coefficients in the Fourier series. This is why the coefficients of the Fourier series match the samples — because the samples are the Fourier transform of the Fourier series.

Blow your trumpet, Gabriel:

- we have a continuous Fourier transform for the triangular pulse,
- we have a discrete Fourier transform for the (periodic) Fourier series associated with the triangular pulse,
- and that discrete Fourier transform consists of samples of the continuous Fourier transform.

I’m not sure that a drawing of the Fourier transform of the Fourier series will be convincing. After all, the easiest way to draw it is to plot the samples of the continuous Fourier transform! Those red dots on the picture, by themselves, are the Fourier transform of the Fourier series.

Maybe it’s okay to ask and emphasize: **why are the two Fourier transforms not the same?** Because we’ve taken Fourier transforms of two different functions. The (infinite) Fourier series is not equal to the triangular pulse (nor is the finite approximation); the series and the finite approximation correspond to a periodic extension of the triangular pulse, and an approximation of that periodic extension. In our first math class about Fourier series we ignored that difference, and focused on one period of the periodic extension; the Fourier transform shows us that we sometimes need to honor the difference between a non-periodic function and a periodic extension of it.

That it works out exactly depends on the Fourier transform of a cosine being precisely a (pair of) Dirac delta(s). If there’s a proportionality constant there, then we’ll be off by that constant factor. Similarly, that the samples were at the integers just required that we be taking the fourier transform of, e.g. rather than of Cos[t].

This may be why this example is so hard to find. You will discover that most of your books use a different form of the Fourier transform (different choices of the FourierParameters).

Let me state my Fourier transform pair explicitly. I used the Mathematica option FourierParameters -> . Then the Fourier transform F(s) of a function f(t) is

and the inverse Fourier transform recovers f(t) from F(s):

Oh, there’s one other convention to be aware of, the definition of the sinc function.

Mathematica is using

sinc(x) = (sin x)/x,

and Bracewell is using

.

Where Bracewell wrote (for the transform of a triangle of half-width 1/10)

,

I would have needed to write

.

(In fact, I arranged to use a triangle of half-width 1/5, instead.)

Let me close with a Mathematica detail. If you attempt to confirm either of those transform integrals directly, you should define a function using “set-delayed”, i.e. “:=”, instead of “=”. There’s a parameter inside each of those integrals, and you want to evaluate the integral first, then the parameter. That is, for example, if we write the inverse transform as… then we get…

and in particular, f1[0] = 1/2, which is wrong.

Instead,

Further, if you want to plot that inverse transform, you will probably find that you will need to compute points explicitly and plot them; the “//Evaluate” that would speed up the computation within the plot command appears to override the “set-delayed”.

It would probably be very instructive for me to look at all this for a triangular pulse of width greater than 1. Maybe I will. But this post was delayed while I fought with the explicit integrals, and I’ve returned to color theory….

Oh, I should at least point out that this example gives us a very useful insight:

**because we recognize the Fourier series coefficients as samples of the Fourier transform, we know a heck of a lot about the sizes of the Fourier series coefficients, even without computing them.** In particular, looking at the continuous transform at integers 7 and 8, we see that the next coefficient in the series is larger than the last one we computed, and the one after that is about the same size as the last one computed, and all the ones after that are very small. We know this without computing them, just by looking at the graph. (OK, it helps that we understand that the graph does get smaller and smaller as the x^2 — make that s^2 — in the denominator gets larger.)

## Leave a Reply