Fourier Series & Transforms

4–5 hours ~10 min read

Fourier Series & Transforms

Any reasonable signal is a sum of pure rotations eiωte^{i\omega t} — and the complex exponentials are orthogonal, so each rotation's weight can be read off independently by an inner product. That single idea, "project onto a pure frequency," is the whole of Fourier analysis. We build it here in continuous time so the discrete and quantum versions later feel inevitable.

Learning Objectives

By the end of this lesson you will be able to:

  1. Prove the orthogonality of complex exponentials on an interval and use it to extract Fourier coefficients.
  2. Compute the complex Fourier series of a periodic function and state the convergence guarantees you can rely on.
  3. Define the continuous Fourier transform and its inverse, and apply linearity, time/frequency shift, and the convolution theorem.
  4. Derive Parseval/Plancherel and interpret it as conservation of energy between time and frequency domains.
  5. Implement a numerical Fourier-series approximation and demonstrate the convolution theorem with np.fft.

Intuition

Picture a signal — a sound, a voltage, an image row — as a recipe. The Fourier idea is that the recipe is always a blend of pure tones: each tone is a complex rotation eiωte^{i\omega t} spinning at its own frequency ω\omega, weighted by a complex amplitude that carries both how much (modulus) and what phase (argument). The Fourier transform is the machine that hands you the recipe; the inverse transform stirs the tones back into the signal.

Why does reading off one tone not disturb the others? Because the pure tones are orthogonal: over a full period, eimte^{i m t} and einte^{i n t} have zero overlap unless m=nm=n. This is the continuous sibling of the roots-of-unity vanishing sum from lesson 1 — distinct frequencies average to nothing. Orthogonality is what makes "project onto frequency ω\omega" a clean, independent measurement, exactly as orthonormal basis vectors let you read off coordinates in linear algebra.

Two domains, one object. The time domain answers "what is the value now?"; the frequency domain answers "what is it made of?" Operations that are tangled in one domain become trivial in the other — most spectacularly, convolution (smearing/filtering, expensive in time) becomes plain multiplication in frequency. Keep this dual picture in mind; the discrete version in lesson 3 turns it into an algorithm, and the quantum version turns that algorithm into a circuit.


Theory

Orthogonality of complex exponentials

Work on the interval [0,T][0,T] and define, for integer nn, the functions en(t)=ei2πnt/Te_n(t) = e^{i 2\pi n t/T}. These are exactly the tones whose period divides TT. Equip the space of (square-integrable) functions on [0,T][0,T] with the Hermitian inner product (conjugate the left factor, matching Appendix C §1):

f,g:=0Tf(t)g(t)dt. \langle f, g\rangle := \int_0^T f(t)^{*}\,g(t)\,dt.

Lemma (orthogonality).

em,en=0Tei2πmt/Tei2πnt/Tdt=Tδmn. \langle e_m, e_n\rangle = \int_0^T e^{-i2\pi m t/T}\,e^{i2\pi n t/T}\,dt = T\,\delta_{mn}.

Proof. The integrand is ei2π(nm)t/Te^{i2\pi(n-m)t/T}. If m=nm=n it equals 11 and integrates to TT. Otherwise let k=nm0k = n-m\neq 0 and integrate the exponential:

0Tei2πkt/Tdt=[Ti2πkei2πkt/T]0T=Ti2πk(ei2πk1)=Ti2πk(11)=0, \int_0^T e^{i2\pi k t/T}\,dt = \left[\frac{T}{i2\pi k}\,e^{i2\pi k t/T}\right]_0^T = \frac{T}{i2\pi k}\big(e^{i2\pi k} - 1\big) = \frac{T}{i2\pi k}\big(1 - 1\big) = 0,

since ei2πk=1e^{i2\pi k} = 1 for integer kk. \blacksquare

This is the continuous analog of the roots-of-unity orthogonality $\tfrac1N\sum_x \omega^{x(j-k)} = \delta_{jk}([AppendixE§6](../../appendix/Emathidentities.md)):replacethesumover ([Appendix E §6](../../appendix/E-math-identities.md)): replace the sum over N$ sample points by an integral over the period. The {en/T}\{e_n/\sqrt T\} form an orthonormal family.

Fourier series of a periodic function

Let ff be TT-periodic and square-integrable on a period. Because {en}\{e_n\} is a complete orthogonal system (a theorem of analysis we use, not reprove), ff has the complex Fourier series

f(t)=n=cnei2πnt/T. f(t) = \sum_{n=-\infty}^{\infty} c_n\, e^{i2\pi n t/T}.

The coefficients fall out of orthogonality: take the inner product of both sides with eme_m and use the lemma. Only the n=mn=m term survives,

em,f=ncnem,en=ncnTδmn=cmT, \langle e_m, f\rangle = \sum_n c_n\langle e_m, e_n\rangle = \sum_n c_n\,T\delta_{mn} = c_m\,T,

so the analysis formula is

cn=1T0Tf(t)ei2πnt/Tdt. \boxed{\,c_n = \frac{1}{T}\int_0^T f(t)\,e^{-i2\pi n t/T}\,dt\,}.

Each cnc_n is the (normalized) overlap of ff with the pure tone of frequency n/Tn/T — the amount of that tone in the blend. Note c0=1T0Tfdtc_0 = \tfrac1T\int_0^T f\,dt is the average (DC) value.

Reality and symmetry. If ff is real then cn=cnc_{-n} = c_n^{*} (conjugate-symmetric spectrum), because conjugating the integrand flips the sign of the exponent. Pairing ±n\pm n then recovers the familiar real sine/cosine series:

f(t)=c0+n=1[ancos2πntT+bnsin2πntT],an=2Recn,  bn=2Imcn. f(t) = c_0 + \sum_{n=1}^{\infty}\Big[a_n\cos\tfrac{2\pi n t}{T} + b_n\sin\tfrac{2\pi n t}{T}\Big], \quad a_n = 2\operatorname{Re}c_n,\ \ b_n = -2\operatorname{Im}c_n.

Convergence (what you can rely on). For fL2[0,T]f\in L^2[0,T] the partial sums converge to ff in the L2L^2 (mean-square) sense: fnMcnen20\|f - \sum_{|n|\le M} c_n e_n\|_2 \to 0. If ff is piecewise-C1C^1, the series converges pointwise to f(t)f(t) where ff is continuous and to the midpoint 12(f(t+)+f(t))\tfrac12\big(f(t^+)+f(t^-)\big) at jumps; near a jump the partial sums overshoot by a fixed 9%\approx 9\% (the Gibbs phenomenon), which never disappears but moves toward the jump as MM grows. We will see Gibbs in the code.

The continuous Fourier transform

Let the period TT\to\infty: the discrete frequencies n/Tn/T crowd into a continuum ξ\xi, the sum becomes an integral, and the Fourier series becomes the Fourier transform. For an integrable (or L2L^2) function f:RCf:\mathbb R\to\mathbb C we use the convention

  f^(ξ)=F[f](ξ)=f(t)ei2πξtdt   \boxed{\;\hat f(\xi) = \mathcal F[f](\xi) = \int_{-\infty}^{\infty} f(t)\,e^{-i2\pi\xi t}\,dt\;}

with frequency ξ\xi in cycles per unit time, and the inversion formula

  f(t)=F1[f^](t)=f^(ξ)e+i2πξtdξ  . \boxed{\;f(t) = \mathcal F^{-1}[\hat f](t) = \int_{-\infty}^{\infty} \hat f(\xi)\,e^{+i2\pi\xi t}\,d\xi\;}.

The e2πiξte^{\mp 2\pi i\xi t} kernel and the ±\pm sign convention match the DFT forward/inverse pair in lesson 3 and the program-wide choice in Appendix C §4 (no stray 1/2π1/2\pi factors with this "ordinary frequency" convention — a convenience we exploit below).

Key properties

Let f^=F[f]\hat f = \mathcal F[f], g^=F[g]\hat g = \mathcal F[g], and a,bCa,b\in\mathbb C. The following are direct consequences of the integral definition.

Linearity. F[af+bg]=af^+bg^\mathcal F[a f + b g] = a\hat f + b\hat g (the integral is linear).

Time shift. F[f(tt0)](ξ)=ei2πξt0f^(ξ)\mathcal F[f(t - t_0)](\xi) = e^{-i2\pi\xi t_0}\,\hat f(\xi).

Proof. Substitute u=tt0u = t - t_0, du=dtdu = dt: f(tt0)ei2πξtdt=f(u)ei2πξ(u+t0)du=ei2πξt0f^(ξ)\int f(t-t_0)e^{-i2\pi\xi t}\,dt = \int f(u)e^{-i2\pi\xi(u+t_0)}\,du = e^{-i2\pi\xi t_0}\hat f(\xi). A delay in time is a linear phase in frequency — modulus unchanged, phase tilted. (The relative-phase intuition from lesson 1 reappears: shifting a signal does not change its energy spectrum, only its phases.)

Frequency shift (modulation). F[ei2πξ0tf(t)](ξ)=f^(ξξ0)\mathcal F[e^{i2\pi\xi_0 t}f(t)](\xi) = \hat f(\xi - \xi_0) — multiplying by a tone in time slides the spectrum (dual of the time-shift rule).

Convolution theorem. Define the convolution $(f * g)(t) = \int_{-\infty}^{\infty} f(\tau),g(t-\tau),d\tau$. Then

  F[fg]=f^g^  and duallyF[fg]=f^g^. \boxed{\;\mathcal F[f * g] = \hat f \cdot \hat g\;}\qquad\text{and dually}\qquad \mathcal F[f\cdot g] = \hat f * \hat g.

Proof. Write out and swap the order of integration (justified for L1L^1 functions by Fubini):

F[fg](ξ)=t ⁣ ⁣τf(τ)g(tτ)dτ  ei2πξtdt=τf(τ)[tg(tτ)ei2πξtdt]dτ. \mathcal F[f*g](\xi) = \int_t\!\!\int_\tau f(\tau)g(t-\tau)\,d\tau\;e^{-i2\pi\xi t}\,dt = \int_\tau f(\tau)\Big[\int_t g(t-\tau)e^{-i2\pi\xi t}\,dt\Big]d\tau.

The inner integral is the time-shift rule: $\int_t g(t-\tau)e^{-i2\pi\xi t}dt = e^{-i2\pi\xi\tau} \hat g(\xi)$. Hence

F[fg](ξ)=g^(ξ)τf(τ)ei2πξτdτ=f^(ξ)g^(ξ). \mathcal F[f*g](\xi) = \hat g(\xi)\int_\tau f(\tau)e^{-i2\pi\xi\tau}\,d\tau = \hat f(\xi)\hat g(\xi). \qquad\blacksquare

This is the property that makes the FFT a workhorse of computation: convolution costs O(N2)O(N^2) directly but O(NlogN)O(N\log N) via "transform, multiply, inverse-transform." We use it in the code.

Parseval / Plancherel — derivation. With the ordinary-frequency convention above, the transform preserves energy:

  f(t)2dt=f^(ξ)2dξ  . \boxed{\;\int_{-\infty}^{\infty}|f(t)|^2\,dt = \int_{-\infty}^{\infty}|\hat f(\xi)|^2\,d\xi\;}.

Proof. Start from the left and write f2=ff|f|^2 = f\,f^{*}, expressing ff by inversion and ff^{*} by the conjugate of inversion:

tf(t)2dt=tf(t)(ξf^(ξ)ei2πξtdξ) ⁣dt=tf(t)ξf^(ξ)ei2πξtdξdt. \int_t |f(t)|^2\,dt = \int_t f(t)\Big(\int_\xi \hat f(\xi) e^{i2\pi\xi t}\,d\xi\Big)^{\!*}\,dt = \int_t f(t)\int_\xi \hat f(\xi)^{*} e^{-i2\pi\xi t}\,d\xi\,dt.

Swap the order of integration (Fubini) and group the tt-integral:

=ξf^(ξ)[tf(t)ei2πξtdt]dξ=ξf^(ξ)f^(ξ)dξ=ξf^(ξ)2dξ. = \int_\xi \hat f(\xi)^{*}\Big[\int_t f(t)e^{-i2\pi\xi t}\,dt\Big]d\xi = \int_\xi \hat f(\xi)^{*}\,\hat f(\xi)\,d\xi = \int_\xi |\hat f(\xi)|^2\,d\xi. \qquad\blacksquare

The bracket is just the forward transform f^(ξ)\hat f(\xi). The polarized version fg=f^g^\int f^{*}g = \int \hat f^{*}\hat g (Plancherel) follows identically with gg in place of the second ff — i.e. the Fourier transform is unitary on L2L^2, an inner-product-preserving map. This is the continuous shadow of the fact, proved in lesson 3, that the normalized DFT matrix is unitary — and ultimately of why the Quantum Fourier Transform is a legal (unitary) quantum operation.

Reading the frequency domain

The spectrum f^\hat f is itself complex: f^(ξ)|\hat f(\xi)| is the magnitude spectrum (how much energy at frequency ξ\xi) and argf^(ξ)\arg\hat f(\xi) is the phase spectrum (the alignment of that component). Sharp features in time spread out in frequency and vice versa — a delta in time is flat in frequency; a single tone in time is a spike in frequency. This reciprocity (formalized by the uncertainty principle and by the sampling theorem in lesson 3) is the recurring theme: localizing in one domain costs spread in the other.


Worked Examples

Example 1 — Fourier series of a square wave

Let ff be the odd square wave of period T=2πT = 2\pi with f(t)=+1f(t) = +1 on (0,π)(0,\pi) and 1-1 on (π,0)(-\pi,0) (so TT-periodic). Compute its complex coefficients $c_n = \tfrac1T\int_{-\pi}^{\pi} f(t)e^{-int},dt(here (here 2\pi n/T = n$).

For n=0n=0: c0=12πππf=0c_0 = \tfrac1{2\pi}\int_{-\pi}^{\pi} f = 0 (equal ++ and - areas; zero average).

For n0n\neq 0, split the integral and use eintdt=eint/(in)\int e^{-int}dt = e^{-int}/(-in):

cn=12π[0π(+1)eintdt+π0(1)eintdt]. c_n = \frac{1}{2\pi}\Big[\int_0^{\pi}(+1)e^{-int}\,dt + \int_{-\pi}^{0}(-1)e^{-int}\,dt\Big].

The first integral is 1in(einπ1)\frac{1}{-in}(e^{-in\pi}-1); the second is 1in(1einπ)-\frac{1}{-in}(1 - e^{in\pi}). Using e±inπ=(1)ne^{\pm in\pi} = (-1)^n and simplifying,

cn=12π1in[((1)n1)(1(1)n)]=12π2((1)n1)in=1(1)niπn. c_n = \frac{1}{2\pi}\cdot\frac{1}{-in}\Big[\big((-1)^n - 1\big) - \big(1 - (-1)^n\big)\Big] = \frac{1}{2\pi}\cdot\frac{2\big((-1)^n - 1\big)}{-in} = \frac{1 - (-1)^n}{i\pi n}.

So cn=0c_n = 0 for even nn and cn=2iπnc_n = \dfrac{2}{i\pi n} for odd nn. Reassembling the real series (pairing ±n\pm n, only odd nn survive) gives the classic

f(t)=4πk=0sin((2k+1)t)2k+1=4π(sint+13sin3t+15sin5t+). f(t) = \frac{4}{\pi}\sum_{k=0}^{\infty}\frac{\sin\big((2k+1)t\big)}{2k+1} = \frac{4}{\pi}\Big(\sin t + \tfrac13\sin 3t + \tfrac15\sin 5t + \cdots\Big).

Only odd harmonics appear (by the symmetry f(t+π)=f(t)f(t+\pi) = -f(t)), and their amplitudes decay like 1/n1/n — slow decay characteristic of a jump discontinuity, which is why truncating the series produces Gibbs overshoot near t=0,πt=0,\pi.

Example 2 — Transform of a Gaussian (a fixed point)

Let f(t)=eπt2f(t) = e^{-\pi t^2}. Its transform is itself:

f^(ξ)=eπt2ei2πξtdt=eπξ2. \hat f(\xi) = \int_{-\infty}^{\infty} e^{-\pi t^2}e^{-i2\pi\xi t}\,dt = e^{-\pi\xi^2}.

Sketch. Complete the square in the exponent: πt2i2πξt=π(t+iξ)2πξ2-\pi t^2 - i2\pi\xi t = -\pi(t + i\xi)^2 - \pi\xi^2. Pulling out eπξ2e^{-\pi\xi^2} leaves eπ(t+iξ)2dt\int e^{-\pi(t+i\xi)^2}dt, which equals eπu2du=1\int e^{-\pi u^2}du = 1 (the Gaussian integral, with a contour-shift justification). Hence f^(ξ)=eπξ2\hat f(\xi) = e^{-\pi\xi^2}. The Gaussian is the eigenfunction with eigenvalue 11: maximally "spread-balanced" between domains, the extremal case of the time–frequency reciprocity. (Wide Gaussians in time become narrow in frequency and vice versa, as the scaling property F[f(at)]=1af^(ξ/a)\mathcal F[f(at)] = \tfrac1{|a|}\hat f(\xi/a) shows.)

Example 3 — Convolution as filtering

Let gg be a normalized box of width ww: g(t)=1wg(t) = \tfrac1w for tw/2|t|\le w/2, else 00. Then $(f * g)(t) = \tfrac1w\int_{t-w/2}^{t+w/2} f(\tau),d\tauisthemovingaverageof is the *moving average* of f$ — a smoother. Its transform is, by the convolution theorem, fg^=f^g^\widehat{f*g} = \hat f\cdot\hat g where $\hat g(\xi) = \operatorname{sinc}(w\xi) = \sin(\pi w\xi)/(\pi w\xi).Because. Because \hat gdecaysawayfrom decays away from \xi=0$, multiplication suppresses high frequencies: smoothing in time = low-pass filtering in frequency. This is the entire logic of digital filtering, and the next code cell verifies it numerically.


Hands-on (Python)

import numpy as np
import matplotlib.pyplot as plt

# =====================================================================
# 1. Numerically approximate a Fourier series (square wave) and see Gibbs
# =====================================================================
def square_wave(t):
    """Odd square wave, period 2π: +1 on (0, π), -1 on (-π, 0)."""
    return np.sign(np.sin(t))

def fourier_partial_sum(t, M):
    """Sum the odd harmonics through (2M-1): (4/π) Σ sin((2k+1)t)/(2k+1)."""
    out = np.zeros_like(t)
    for k in range(M):
        n = 2 * k + 1
        out += np.sin(n * t) / n
    return (4 / np.pi) * out

t = np.linspace(-np.pi, np.pi, 2000, endpoint=False)
plt.figure(figsize=(8, 4))
plt.plot(t, square_wave(t), "k--", lw=1, label="target square wave")
for M in (1, 3, 10, 50):
    plt.plot(t, fourier_partial_sum(t, M), lw=1, label=f"M={M} harmonics")
plt.title("Fourier partial sums → square wave (note Gibbs overshoot at jumps)")
plt.xlabel("t"); plt.ylabel("f(t)"); plt.legend(fontsize=8); plt.tight_layout(); plt.show()

# Cross-check the *coefficients* numerically against the closed form 2/(iπn) for odd n.
# square_wave(t) = sign(sin t) is exactly the Example-1 signal: +1 on (0,π), -1 on (π,2π).
T = 2 * np.pi
M = 200_000
ts = np.linspace(0, T, M, endpoint=False)             # one period, uniform grid
dt = T / M
f = square_wave(ts)
for n in (1, 2, 3, 5):
    # cn = (1/T)∫_0^T f e^{-int} dt, as a Riemann sum (version-robust; np.trapz was
    # removed in NumPy 2.0). For odd n this matches 2/(iπn); for even n it is 0.
    cn = np.sum(f * np.exp(-1j * n * ts)) * dt / T
    closed = (1 - (-1) ** n) / (1j * np.pi * n)        # = 2/(iπn) for odd n, 0 for even n
    print(f"n={n}:  numeric c_n = {cn: .4f}   closed form = {closed: .4f}")

# =====================================================================
# 2. Demonstrate the convolution theorem with np.fft
#    Claim:  conv(f, g)  ==  IFFT( FFT(f) * FFT(g) )   (circular convolution)
# =====================================================================
rng = np.random.default_rng(0)
N = 256
f = rng.standard_normal(N)                             # a noisy signal
# A small normalized box kernel (moving-average / low-pass filter), zero-padded to length N.
w = 9
g = np.zeros(N); g[:w] = 1.0 / w

# (a) Direct CIRCULAR convolution (matches what the DFT computes):
direct = np.array([np.sum(f * np.roll(g[::-1], k + 1)) for k in range(N)])

# (b) Via the convolution theorem: multiply spectra, transform back.
via_fft = np.fft.ifft(np.fft.fft(f) * np.fft.fft(g)).real

print("\nconvolution theorem holds:",
      np.allclose(direct, via_fft, atol=1e-10))        # True

# Show that convolving with the box suppresses high-frequency content (low-pass).
F   = np.fft.rfft(f)
FG  = np.fft.rfft(via_fft)
freq = np.fft.rfftfreq(N)
plt.figure(figsize=(8, 4))
plt.plot(freq, np.abs(F),  label="|FFT(signal)|")
plt.plot(freq, np.abs(FG), label="|FFT(signal ∗ box)|")
plt.title("Convolution with a box = multiplication by a sinc = low-pass filter")
plt.xlabel("frequency"); plt.ylabel("magnitude"); plt.legend(); plt.tight_layout(); plt.show()

What you should observe: the partial sums visibly converge to the square wave, with the persistent ~9% Gibbs overshoot hugging the jumps as MM grows; the numerically computed cnc_n match 2/(iπn)2/(i\pi n) for odd nn and vanish for even nn; np.allclose(direct, via_fft) prints True, confirming F[fg]=f^g^\mathcal F[f*g] = \hat f\hat g; and the filtered spectrum is visibly attenuated at high frequencies — convolution in time is multiplication in frequency.

Note on circular vs. linear convolution. np.fft computes circular convolution (the DFT treats data as one period of a periodic signal — see lesson 3). For linear convolution, zero-pad both inputs to length len(f)+len(g)1\ge \text{len}(f)+\text{len}(g)-1 before transforming. This periodicity is the bridge from the continuous theory here to the discrete machinery next.


Exercises

1. (Easy) Linearity and shift. Given f^(ξ)\hat f(\xi), write the transform of $h(t) = 3f(t) - f(t-5)intermsof in terms of \hat f$.

Solution

By linearity and the time-shift rule, $\hat h(\xi) = 3\hat f(\xi) - e^{-i2\pi\xi\cdot 5}\hat f(\xi) = \big(3 - e^{-i10\pi\xi}\big)\hat f(\xi)$. The delay contributes a frequency-dependent phase factor ei10πξe^{-i10\pi\xi}; the magnitude spectrum is reshaped by 3ei10πξ|3 - e^{-i10\pi\xi}|.

2. (Easy) DC coefficient. Show that the n=0n=0 Fourier coefficient c0c_0 equals the average of ff over a period, and compute it for f(t)=2+3cos(2πt/T)f(t) = 2 + 3\cos(2\pi t/T).

Solution

c0=1T0Tf(t)e0dt=1T0Tfc_0 = \tfrac1T\int_0^T f(t)e^{0}\,dt = \tfrac1T\int_0^T f, which is the mean by definition. For f=2+3cos(2πt/T)f = 2 + 3\cos(2\pi t/T) the cosine integrates to 00 over a full period, leaving c0=2c_0 = 2. (The cos\cos contributes c±1=3/2c_{\pm 1} = 3/2 each, since cosθ=12(eiθ+eiθ)\cos\theta = \tfrac12(e^{i\theta}+e^{-i\theta}).)

3. (Medium) Parseval for a finite series. For a real TT-periodic ff with coefficients cnc_n, prove the series form of Parseval: 1T0Tf(t)2dt=ncn2\tfrac1T\int_0^T|f(t)|^2\,dt = \sum_{n}|c_n|^2.

Solution

Write f=ncnenf = \sum_n c_n e_n and f=mcmemf^{*} = \sum_m c_m^{*} e_m^{*} with en(t)=ei2πnt/Te_n(t)=e^{i2\pi nt/T}. Then

1T0Tf2dt=1T0Tn,mcncmenemdt=n,mcncm1Tem,en=n,mcncmδmn=ncn2, \tfrac1T\int_0^T |f|^2\,dt = \tfrac1T\int_0^T \sum_{n,m} c_n c_m^{*}\, e_n e_m^{*}\,dt = \sum_{n,m} c_n c_m^{*}\,\tfrac1T\langle e_m, e_n\rangle = \sum_{n,m} c_n c_m^{*}\,\delta_{mn} = \sum_n |c_n|^2,

using the orthogonality lemma 1Tem,en=δmn\tfrac1T\langle e_m, e_n\rangle = \delta_{mn}. Energy in time = energy in the coefficients. \blacksquare

4. (Medium) Convolution by hand. Let f=g=1[0,1]f = g = \mathbf 1_{[0,1]} (indicator of [0,1][0,1]). Compute (fg)(t)(f * g)(t) directly and confirm via the convolution theorem that its transform is f^(ξ)2\hat f(\xi)^2.

Solution

(fg)(t)=1[0,1](τ)1[0,1](tτ)dτ(f*g)(t) = \int \mathbf 1_{[0,1]}(\tau)\mathbf 1_{[0,1]}(t-\tau)\,d\tau = length of the overlap of [0,1][0,1] and [t1,t][t-1,t]. This is the triangle function: 00 for t0t\le 0, rising as tt for 0t10\le t\le 1, falling as 2t2-t for 1t21\le t\le 2, and 00 for t2t\ge 2. For the transform, $\hat f(\xi) = \int_0^1 e^{-i2\pi\xi t}dt = \frac{1-e^{-i2\pi\xi}}{i2\pi\xi} = e^{-i\pi\xi} \operatorname{sinc}(\xi)(with (with \operatorname{sinc}(\xi)=\sin\pi\xi/\pi\xi$). By the convolution theorem fg^=f^2=ei2πξsinc2(ξ)\widehat{f*g} = \hat f^2 = e^{-i2\pi\xi}\operatorname{sinc}^2(\xi), the well-known transform of a triangle (a squared sinc) — consistent with the direct computation.

5. (Hard) Plancherel ⇒ unitarity intuition. Using the convention in this lesson, show that the operator F\mathcal F preserves the L2L^2 inner product f,g=fg\langle f,g\rangle = \int f^{*}g, i.e. Ff,Fg=f,g\langle \mathcal F f, \mathcal F g\rangle = \langle f, g\rangle, and explain in one sentence why this is the continuous analog of "the DFT matrix is unitary."

Solution

Repeat the Parseval derivation with gg in the second slot: expand $\langle f,g\rangle = \int_t f(t)^{}g(t),dt,substitute, substitute g(t) = \int_\xi \hat g(\xi)e^{i2\pi\xi t}d\xi$, swap integrals (Fubini), and recognize $\int_t f(t)^{}e^{i2\pi\xi t}dt = \big(\int_t f(t)e^{-i2\pi\xi t}dt\big)^{} = \hat f(\xi)^{}.Thisleaves. This leaves \int_\xi \hat f(\xi)^{*}\hat g(\xi),d\xi = \langle\hat f,\hat g\rangle$. Preserving the inner product is exactly the defining property of a unitary operator (UU=IU^\dagger U = I); in finite dimensions the same statement is "the normalized DFT matrix UU satisfies UU=IU^\dagger U = I," proved in lesson 3.

6. (Hard) Smoothness ⇒ decay. Argue that if ff is TT-periodic and CkC^k (k continuous derivatives), then its Fourier coefficients satisfy cn=O(nk)c_n = O(|n|^{-k}) as n|n|\to\infty. Connect this to the slow 1/n1/n decay seen for the (discontinuous) square wave.

Solution

Integrate the coefficient formula by parts. Each integration by parts moves a derivative off the exponential and onto ff: $\int_0^T f(t)e^{-i2\pi n t/T}dt = \frac{T}{i2\pi n}\int_0^T f'(t)e^{-i2\pi n t/T}dt(boundarytermsvanishbyperiodicity).Hence (boundary terms vanish by periodicity). Hence c_n = \frac{T}{i2\pi n}\cdot c_n^{(f')},i.e.differentiatingmultipliesthecoefficientby, i.e. differentiating multiplies the coefficient by i2\pi n/T$; equivalently a smooth ff' has bounded coefficients, so cn=O(1/n)c_n = O(1/|n|) for C1C^1. Repeating kk times gives $c_n = O(|n|^{-k})provided provided f^{(k)}\in L^2.Thesquarewaveisnotcontinuous(. The square wave is *not* continuous (k=0$ effectively, with a jump), so its coefficients decay only like 1/n1/n — the slowest case — which is precisely why its truncated series converges slowly and exhibits Gibbs overshoot. Smoothness in time ⇔ rapid decay in frequency, the reciprocity theme again.


Checkpoint

1. State the orthogonality relation for $e_n(t)=e^{i2\pi nt/T}$ on $[0,T]$ and why it matters.

0Temendt=Tδmn\int_0^T e_m^{*}e_n\,dt = T\delta_{mn}. It lets you read off each Fourier coefficient independently by an inner product: cn=1Ten,fc_n = \tfrac1T\langle e_n, f\rangle — projecting ff onto one pure frequency without interference from the others.

2. Write the analysis and synthesis formulas for the continuous Fourier transform (this lesson's convention).

Analysis: f^(ξ)=f(t)ei2πξtdt\hat f(\xi) = \int f(t)e^{-i2\pi\xi t}dt. Synthesis (inverse): $f(t) = \int \hat f(\xi)e^{+i2\pi\xi t}d\xi.The. The \mpsignsandtheabsenceof signs and the absence of 1/2\pi$ factors match the program's DFT/QFT conventions.

3. What does the convolution theorem say, and why is it computationally important?

F[fg]=f^g^\mathcal F[f*g] = \hat f\cdot\hat g: convolution in time is pointwise multiplication in frequency. It turns an O(N2)O(N^2) convolution into "FFT, multiply, inverse-FFT," which is O(NlogN)O(N\log N).

4. State Parseval/Plancherel and interpret it physically.

f2dt=f^2dξ\int|f|^2\,dt = \int|\hat f|^2\,d\xi (and f,g=f^,g^\langle f,g\rangle = \langle\hat f,\hat g\rangle). Total energy is conserved between time and frequency domains; equivalently, F\mathcal F is unitary on L2L^2.

5. Why does a time delay leave the magnitude spectrum unchanged?

Because F[f(tt0)]=ei2πξt0f^(ξ)\mathcal F[f(t-t_0)] = e^{-i2\pi\xi t_0}\hat f(\xi): the delay multiplies by a unit-modulus phase factor, so f^|\hat f| is unchanged and only the phase spectrum tilts.

6. How does this continuous theory foreshadow the quantum Fourier transform?

The Fourier transform is unitary (Plancherel), built from orthogonal complex exponentials, and diagonalizes convolution. Its finite-dimensional version (the DFT, lesson 3) is a unitary matrix, and the quantum version implements that same unitary on amplitudes — see Term 2.4.


Further Reading

  • [NC, §A4] — Fourier analysis appendix; the orthogonality and transform conventions the program uses.
  • [KLM, Ch. 6] — Fourier transform as preparation for the QFT and phase estimation.
  • Appendix E §6 — geometric sums, orthogonality, the QFT kernel.
  • Appendix B §1–2 — complex arrays and inner products used in the code.

← Prev: Complex Numbers & Functions · Up: Term 0 · Next: The Discrete Fourier Transform