TExcelTAD
Home › Fourier Analysis & Signals › The Fourier Transform

The Fourier Transform

The Fourier transform turns a signal f(t)f(t) into its spectrum f^(s)\hat{f}(s), a complex function of frequency. This lesson computes the standard transform pairs, the rectangle, the triangle, the Gaussian and the one-sided exponential, and builds the intuition that will carry the rest of the course: narrow in time means wide in frequency, and smooth in time means fast decay in frequency.

Definition

f^(s)=Ff(s)=∫−∞∞f(t) e−2πist dt,f(t)=∫−∞∞f^(s) e2πist ds\hat{f}(s) = \mathcal{F}f(s) = \int_{-\infty}^{\infty} f(t)\, e^{-2\pi i s t}\, dt, \qquad f(t) = \int_{-\infty}^{\infty} \hat{f}(s)\, e^{2\pi i s t}\, ds

∣f^(s)∣\lvert \hat{f}(s) \rvert is the magnitude spectrum (how much of frequency ss) and arg⁡f^(s)\arg \hat{f}(s) the phase spectrum (where in time those oscillations line up). The transform exists, for example, whenever ∫∣f∣<∞\int \lvert f \rvert < \infty.

Four essential pairs

f(t)f(t) f^(s)\hat{f}(s) Notes
Π(t)\Pi(t): 1 for ∣t∣<1/2\lvert t \rvert < 1/2, else 0 sinc⁡(s)=sin⁡πsπs\operatorname{sinc}(s) = \dfrac{\sin \pi s}{\pi s} jumps: decay like 1/s1/s
Λ(t)=max⁡(1−∣t∣,0)\Lambda(t) = \max(1 - \lvert t \rvert, 0) sinc⁡2(s)\operatorname{sinc}^2(s) corners: decay like 1/s21/s^2
e−πt2e^{-\pi t^2} e−πs2e^{-\pi s^2} smooth: decays faster than any power
e−ate^{-at} for t≥0t \ge 0, 0 before 1a+2πis\dfrac{1}{a + 2\pi i s} complex: has a phase
python · try it yourself
import numpy as np

dt = 0.0005
t = np.arange(-30, 30, dt)
pairs = {
    "rect":     ((np.abs(t) < 0.5).astype(float), lambda s: np.sinc(s)),
    "triangle": (np.clip(1 - np.abs(t), 0, None), lambda s: np.sinc(s) ** 2),
    "gaussian": (np.exp(-np.pi * t ** 2),        lambda s: np.exp(-np.pi * s ** 2)),
    "one-sided exp (a=1)": (np.where(t >= 0, np.exp(-np.clip(t, 0, None)), 0.0), lambda s: 1 / (1 + 2j * np.pi * s)),
}
S = np.array([0.0, 0.3, 1.2, 2.5])
for name, (f, exact) in pairs.items():
    num = np.array([np.sum(f * np.exp(-2j * np.pi * s * t)) * dt for s in S])
    print(f"{name:20s} max error vs formula: {np.max(np.abs(num - exact(S))):.1e}")
rect                 max error vs formula: 5.0e-04
triangle             max error vs formula: 8.3e-08
gaussian             max error vs formula: 2.3e-12
one-sided exp (a=1)  max error vs formula: 2.5e-04

The errors are tiny (Riemann-sum and truncation errors), confirming all four formulas.

Reading a spectrum

The one-sided exponential, a capacitor discharging or a struck bell's envelope, has a complex transform: its magnitude 1/a2+4π2s21/\sqrt{a^2 + 4\pi^2 s^2} is largest at low frequencies, and its phase −arctan⁡(2πs/a)-\arctan(2\pi s / a) runs from 0 to −90∘-90^\circ, reflecting that the signal is not symmetric in time.

python · try it yourself
import numpy as np

a = 2.0
for s in (0, 0.1, 0.3, 1, 3):
    F = 1 / (a + 2j * np.pi * s)
    print(f"s={s:4}: |F| = {abs(F):.4f}   phase = {np.degrees(np.angle(F)) + 0.0:7.2f} deg")
half_power = a / (2 * np.pi)
print(f"half-power frequency a/(2 pi) = {half_power:.4f}: |F|^2 there = {abs(1 / (a + 2j * np.pi * half_power)) ** 2:.4f} = (1/a^2)/2 = {1 / a ** 2 / 2:.4f}")
s=   0: |F| = 0.5000   phase =    0.00 deg
s= 0.1: |F| = 0.4770   phase =  -17.44 deg
s= 0.3: |F| = 0.3639   phase =  -43.30 deg
s=   1: |F| = 0.1517   phase =  -72.34 deg
s=   3: |F| = 0.0528   phase =  -83.94 deg
half-power frequency a/(2 pi) = 0.3183: |F|^2 there = 0.1250 = (1/a^2)/2 = 0.1250

The half-power point s=a/(2π)s = a/(2\pi) is the "cutoff frequency" of the RC low-pass filter whose impulse response this is.

In software

  • Spectra of continuous signals are almost always estimated from samples with the FFT; analytic pairs like these are the test cases for such code.
  • np.sinc is the normalized sinc sin⁡(πx)/(πx)\sin(\pi x)/(\pi x), matching this course; some books define sinc⁡x=sin⁡x/x\operatorname{sinc} x = \sin x / x.

Exercises

Exercise 1: Value at zero

Why is f^(0)=∫f(t) dt\hat{f}(0) = \int f(t)\,dt? Use it to find Λ^(0)\hat{\Lambda}(0).

Answer

At s=0s = 0 the exponential is 1; Λ^(0)=1\hat{\Lambda}(0) = 1.

Solution

e−2πi⋅0⋅t=1e^{-2\pi i \cdot 0 \cdot t} = 1, so f^(0)\hat{f}(0) is the area under ff. The triangle of base 2 and height 1 has area 1, matching sinc⁡2(0)=1\operatorname{sinc}^2(0) = 1.

Exercise 2: Zeros of the sinc

At which frequencies is the spectrum of Π\Pi zero, and why?

Answer

At s=±1,±2,…s = \pm 1, \pm 2, \ldots.

Solution

sin⁡(πs)=0\sin(\pi s) = 0 at integers s≠0s \ne 0. At those frequencies a whole number of periods fits in the pulse's width 1, so the oscillation integrates to zero against the pulse.

Exercise 3: A wider pulse (code)

Numerically compute the transform of a rectangle of width 2 (1 for ∣t∣<1\lvert t \rvert < 1) at s=0,0.25,0.5s = 0, 0.25, 0.5 and guess the formula.

Answer

Values 2, about 1.2732 and 0; formula 2sinc⁡(2s)2\operatorname{sinc}(2s).

Solution
python · try it yourself
import numpy as np
dt = 0.0005
t = np.arange(-5, 5, dt)
f = (np.abs(t) < 1).astype(float)
for s in (0, 0.25, 0.5):
    val = np.sum(f * np.exp(-2j * np.pi * s * t)) * dt
    print(s, round(val.real, 4) + 0.0, round(2 * np.sinc(2 * s), 4) + 0.0)
0 2.0 2.0
0.25 1.2732 1.2732
0.5 0.0 0.0

Twice as wide in time gives a spectrum twice as tall and half as wide, the scaling theorem.

Test yourself

The Gaussian e−πt2e^{-\pi t^2} has Fourier transform…

  1. sinc⁡(s)\operatorname{sinc}(s)
  2. e−πs2e^{-\pi s^2}
  3. 1/(1+s2)1/(1 + s^2)
  4. a delta

f^(0)\hat{f}(0) equals…

  1. f(0)f(0)
  2. the area under ff
  3. the maximum of ff
  4. 0

A signal with jumps has a spectrum that decays like…

  1. e−s2e^{-s^2}
  2. 1/s1/s
  3. 1/s31/s^3
  4. it does not decay