Skip to main content

9.3 Discrete Fourier transforms

Source: Ideas from Computational Physics (Landau, Páez, Bordeianu), §9.3. Rewritten in original wording — no textbook listings. Continues 9.2b. Next: 9.3b.

Finite samples force a DFT​

In practice y(t)y(t) is known at NN independent times with spacing h=Δth=\Delta t:

yk=y(tk),tk=kh,T=Nh,s=1h=NT.y_k=y(t_k),\quad t_k=kh,\quad T=Nh,\quad s=\frac{1}{h}=\frac{N}{T}.

Choosing a window TT makes the mathematics treat yy as period-TT (y0=yNy_0=y_N). Only NN independent yky_k can determine NN independent YnY_n. The fundamental bin is

ω1=2πT,ωn=nω1=n2πNh,n=0,1,…,N−1,\omega_1=\frac{2\pi}{T},\qquad \omega_n=n\omega_1=n\frac{2\pi}{Nh},\quad n=0,1,\ldots,N-1,

with n=0n=0 the DC (non-oscillating) piece.

Trapezoid → DFT sum and Nyquist​

Restrict the FT integral to [0,T][0,T] and apply the trapezoid rule (endpoint h/2h/2 weights merge because y0=yNy_0=y_N). Sparse sampling also forces a Nyquist ceiling. Pick the DFT sum and the Nyquist frequency among lookalikes.

(Book indexing k=1..Nk=1..N is the same cycle.) Inverting with dω→2π/(Nh)d\omega\to 2\pi/(Nh) reconstitutes y(t)y(t) for any tt; evaluating at the sample grid recovers a period-NN sequence. Both yk+Ny_{k+N} and Yn+NY_{n+N} repeat — NN in, NN independent out.

Longer TT (smaller ω1\omega_1) smooths the frequency axis. Padding trailing zeros lengthens TT artificially and assumes “signal gone afterward.”

Complex Z=e−2πi/NZ=e^{-2\pi i/N} turns the DFT into powers of ZZ (or separate cos/sin real-imag forms). A real yky_k need not produce a purely real YnY_n; leftover Im parts measure windowing / symmetry error, not necessarily a bug.

Naive DFT is an N×NN\times N multiply — O(N2)\mathcal{O}(N^2). The FFT (§9.5) reaches O(Nlog⁡N)\mathcal{O}(N\log N); for N∼102–3N\sim10^{2\text{–}3} that is minutes vs weeks territory.

Figure 9.2 — two sinusoids that alias under coarse sampling.

Aliasing in words​

Unresolved high frequencies can impersonate low ones (aliasing — also the Moiré story in images). If a tone at frequency ff is sampled at rate ss with the Nyquist rule violated, ff and f−2sf-2s can yield the same samples. Filter high-ff first, or raise ss by shrinking hh at fixed TT.

Raising NN at fixed TT improves high-frequency fidelity and moves former “edge” bins inward. Raising TT at fixed hh densifies low-frequency bins (padding is the after-the-fact version).

Assessment menu (do these)​

  1. Even: y=3cos⁡ωt+2cos⁡3ωt+cos⁡5ωty=3\cos\omega t+2\cos 3\omega t+\cos 5\omega t — nearly real YnY_n, amplitudes 3:2:13:2:1 (power 9:4:19:4:1), reconstruct.
  2. Odd: y=sin⁡ωt+2sin⁡3ωt+3sin⁡5ωty=\sin\omega t+2\sin 3\omega t+3\sin 5\omega t — nearly imaginary, ratios 1:2:31:2:3 (power 1:4:91:4:9).
  3. Mixed: 5sin⁡ωt+2cos⁡3ωt+sin⁡5ωt5\sin\omega t+2\cos 3\omega t+\sin 5\omega t — amplitudes 5:2:15:2:1.
  4. Offset / phase: 5+10sin⁡(t+2)5+10\sin(t+2) — peel DC and phase separately.
  5. Aliasing: y=sin⁡(πt/2)+sin⁡(2πt)y=\sin(\pi t/2)+\sin(2\pi t) under coarse vs fine ss; check Nyquist.
  6. Chapter 8 orbits: p=12p=12 and soft-α\alpha trajectories — how many harmonics exceed 10%10\% of ∣b1∣|b_1|? Use the true period, not ω0\omega_0.

Nonperiodic packet (preview)​

A localized electron model ψ(x,0)=e−12((x−5)/σ0)2eik0x\psi(x,0)=e^{-\frac12((x-5)/\sigma_0)^2}e^{ik_0 x} is not a pp-eigenstate. Its momentum content is the FT ψ(p)\psi(p) — same DFT machinery on a long spatial window.

Quiz

DFT and aliasing

1 / 4

With N samples spaced by h, the sampling rate is…

Pick an answer to see if you are right.

Next: 9.3b DFT labs.