3. Fourier transforms#

Like Fourier series, the Fourier transform of a function \(f\) is a way to decompose \(f\) into complex exponentials. This is a very useful tool in quantum mechanics and signal processing, for example.

The difference between Fourier series and Fourier transforms is that while Fourier series are defined for functions on a bounded interval (or equivalently for periodic functions), the Fourier transform can be applied to functions on the whole real line. As a consequence, all complex exponentials

\[ e_t(x)=\exp(itx) \]

for arbitrary real numbers \(t\) are needed to decompose arbitrary functions \(f\) as above.

3.1. Definition and basic properties#

Definition 3.1 (Fourier transform)

Let \(f\) be a (real or complex) function on the real line \(\mathbb{R}\). The Fourier transform of \(f\) is the function

(3.1)#\[ \hat f(y) = \int_{-\infty}^\infty f(x)\exp(-2\pi i x y)dx. \]

Warning

Various other conventions exist for the definition of the Fourier transform, so be careful when combining different sources.

The most important property is that using the Fourier transform \(\hat f\), we can express the original function \(f\) using the Fourier inversion formula:

(3.2)#\[ f(x) = \int_{-\infty}^\infty \hat f(y)\exp(2\pi i x y)dy. \]

(This is like a linear combination of exponential functions, except the expression involves an integral rather than a sum.)

Here are several other properties of the Fourier transform, for a given function \(f\) with Fourier transform \(\hat f\):

  1. For any real number \(a\), the Fourier transform of \(f(x-a)\) equals \(\exp(-2\pi i ay)\hat f(y)\).

  2. For any real number \(a\ne0\), the Fourier transform of \(f(ax)\) equals \(|a|^{-1}\hat f(y/a)\).

  3. The Fourier transform of \(\frac{df}{dx}\) is \(2\pi iy\hat f(y)\).

  4. The Fourier transform of \(xf(x)\) is \(\frac{1}{2\pi i y}\) times the Fourier transform of \(\frac{df}{dx}\).

  5. (Plancherel’s theorem) We have

    \[ \int_{-\infty}^\infty|f(x)|^2 dx= \int_{-\infty}^\infty|\hat f(y)|^2 dy. \]

3.2. Examples#

3.2.1. The Fourier transform of a rectangular function#

Consider the rectangular (or “square pulse”) function

\[\begin{split} f(x) = \begin{cases} 1& \text{if }-1\le x\le 1,\\ 0& \text{otherwise} \end{cases} \end{split}\]

(see figure below). We compute

\[\begin{split} \begin{aligned} \hat f(y) &= \int_{-1}^1 \exp(-2\pi i x y)dx\\ &= \left[-\frac{1}{2\pi i y}\exp(-2\pi i x y)\right]_{x=-1}^1\\ &= -\frac{1}{2\pi i y}(\exp(-2\pi i y)-\exp(2\pi i y)). \end{aligned} \end{split}\]

Using the formula

\[ \sin t = \frac{e^{it}-e^{-it}}{2i} \]

we obtain

\[ \hat f(y)=\frac{\sin(2\pi y)}{\pi y}. \]

Note

The function \(\hat f\) can also be expressed as

\[ \hat f(y) = 2\sinc(2 y), \]

where

\[ \sinc(t) = \frac{\sin(\pi t)}{\pi t}. \]
Hide code cell source
from matplotlib import pyplot as plot
from myst_nb import glue
import numpy as np

fig, ax = plot.subplots(2, 1, figsize=(8,8))

ax[0].plot((-2, -1, -1, 1, 1, 2), (0, 0, 1, 1, 0, 0), color='red')
ax[0].set_xlabel('$x$')
ax[0].set_ylabel('$f(x)$')

y = np.linspace(-2, 2, 101)
fhat = 2 * np.sinc(2*y)
ax[1].plot(y, fhat, color='blue')
ax[1].set_xlabel('$y$')
ax[1].set_ylabel('$\\hat f(y)$')

glue("rectangular", fig, display=False)
_images/5f6b9cc4c71cad270f041c5a89b51677c76308dfaea8fb3ef9340a6564c923b9.png

Fig. 3.1 A rectangular function and its Fourier transform#

3.2.2. The Fourier transform of a Gaussian function#

For a fixed \(a>0\), consider the function

\[ f(x) = \exp(-\pi ax^2) \]

(see figure below). We compute

\[\begin{split} \begin{aligned} \hat f(y) &= \int_{-\infty}^\infty \exp(-\pi a x^2-2\pi i x y)dx\\ &= \int_{-\infty}^\infty \exp(-\pi a(x-iy/a)^2 - \pi y^2/a)dx\\ &= \int_{-\infty}^\infty \exp(-\pi a(x-iy/a)^2)dx\cdot \exp(- \pi y^2/a). \end{aligned} \end{split}\]

To finish the computation, we need the contour integration technique from complex analysis. The integral in the above expression can be interpreted as the integral of the function \(\exp(-\pi z^2)\) over the line \(\Im z=-y/a\). Shifting the line of integration to \(\Im z=0\) (the real axis), we get

\[ \hat f(y) = \int_{-\infty}^\infty \exp(-\pi ax^2)dx\cdot \exp(- \pi y^2/a). \]

Finally, we make use of the Gaussian integral

(3.3)#\[ \int_{-\infty}^\infty \exp(-\pi ax^2)dx = a^{-1/2} \]

(if you don’t know this, look it up in your favourite reference for integrals) to conclude

\[ \hat f(y) = a^{-1/2} \exp(-\pi y^2/a). \]
Hide code cell source
from matplotlib import pyplot as plot
from myst_nb import glue
import numpy as np

fig, ax = plot.subplots(2, 1, figsize=(8,8))
a = 0.5

x = np.linspace(-2, 2, 101)
f = np.exp(-np.pi * a * x**2)
ax[0].plot(x, f, color='red')
ax[0].set_xlabel('$x$')
ax[0].set_ylabel('$f(x)$')

y = np.linspace(-2, 2, 101)
fhat = a**(-1/2) * np.exp(-np.pi / a * y**2)
ax[1].plot(y, fhat, color='blue')
ax[1].set_xlabel('$y$')
ax[1].set_ylabel('$\\hat f(y)$')

glue("gaussian", fig, display=False)
_images/19e141620f1f9c7a64ce2c1f64002d74a476cd1ad65ad691f735b20b63bb353a.png

Fig. 3.2 The Gaussian function \(f_{1/2}(x)\) and its Fourier transform \(\widehat{f_{1/2}}(y)=\sqrt{2}f_2(y)\)#


3.3. Exercises#

Exercise 3.1

For a fixed \(a>0\), compute the Fourier transform of the function

\[ f(x) = \exp(-a|x|). \]

Exercise 3.2

Do Problem 2.20 in Griffiths [Gri95], which gives a step-by-step derivation of the Fourier inversion formula (called Plancherel’s theorem in [Gri95]).