Skip to main content

9.1 Fourier series

Source: Ideas from Computational Physics (Landau, Páez, Bordeianu), §9.1. Rewritten in original wording — not a paste of textbook figures or listings. Continues 8.7 ODE solver sketches. Next: 9.1b Fourier series labs.

From anharmonic clocks to spectra​

Chapter 8 gave periodic orbits that are not pure sinusoids: soft α\alpha wells and ∣x∣p|x|^p forces produce pyramids, asymmetric swings, and amplitude-dependent periods. Those x(t)x(t) still satisfy x(t+T)=x(t)x(t+T)=x(t) once a true period TT is known. Fourier’s theorem then lets you write any such (nice enough) signal as a sum of harmonics of the fundamental

ω≡ω1=2πT.\omega\equiv\omega_1=\frac{2\pi}{T}.

The computational program of this chapter is: measure or impose TT, project coefficients, and later replace the integrals by a DFT / FFT. Short-time spectra and the quantum Fourier transform appear in later chapters; here we stay classical and continuous-time.

Figure 9.1 — sawtooth waveform and |b_n| stick spectrum.

Series for a known period​

Any single-valued period-TT signal with finitely many jumps admits a real Fourier series in harmonics of ω\omega. Each pair (an,bn)(a_n,b_n) is the amplitude of the pure tone at frequency nωn\omega; intensity scales as an2+bn2a_n^2+b_n^2. Walk the series form, the orthogonality projection for (an,bn)(a_n,b_n), and the odd-sawtooth bnb_n — pick the matching equation each step.

This is the same least-squares projection idea as Chapter 6: the truncated series is the best trigonometric fit of that order. At a jump the partial sums converge to the midpoint of the left and right limits; near a sharp corner they overshoot (Gibbs phenomenon, roughly 9%9\% of the jump).

Symmetry shortcuts​

  • a0=2⟨y⟩a_0=2\langle y\rangle (twice the mean).
  • Odd y(−t)=−y(t)y(-t)=-y(t) ⇒\Rightarrow all an=0a_n=0; integrate sines on half a period if convenient.
  • Even y(−t)=y(t)y(-t)=y(t) ⇒\Rightarrow all bn=0b_n=0; cosine half-range formulas.

Causal signals that vanish for t<0 are rarely perfectly odd/even, so small “forbidden” coefficients can appear numerically.

Why this still helps nonlinear oscillators​

Linear systems enjoy superposition of normal modes. Nonlinear Newton laws do not. Fourier does not claim that each harmonic separately solves the ODE — only that the observed periodic y(t)y(t) can be expanded. Traditional mechanics often finds the fundamental analytically and adds overtones by perturbation; here you start from the full numerical orbit (or an analytic toy signal) and read the spectrum off.

For spectral analysis of driven / dissipative systems, wait until transients die. Strongly nonlinear attractors can jump among configurations; then a single long FFT mixes regimes — motivation for short-time transforms later.

Worked toys: sawtooth and half-wave​

Sawtooth (odd, discontinuous)​

Shifted to be odd on (−T/2,T/2)(-T/2,T/2),

y(t)=tT/2,−T2≤t≤T2,y(t)=\frac{t}{T/2},\qquad -\frac{T}{2}\le t\le\frac{T}{2},

and extended periodically. Only sine terms survive (the bnb_n you picked above), so

y(t)=2π(sin⁡ωt−12sin⁡2ωt+13sin⁡3ωt−⋯ ).y(t)=\frac{2}{\pi}\Bigl(\sin\omega t-\tfrac12\sin 2\omega t+\tfrac13\sin 3\omega t-\cdots\Bigr).

A few terms capture the overall ramp; many terms are needed for the corners. At each jump the series averages to 00; just beside the jump, partial sums overshoot (Gibbs).

Half-wave (continuous, kinked)​

y(t)={sin⁡ωt,0lt;tlt;T/2,0,T/2lt;tlt;T.y(t)=\begin{cases} \sin\omega t,&0<t<T/2,\\ 0,&T/2<t<T. \end{cases}

Projection gives b1=12b_1=\tfrac12, other bn=0b_n=0, and

an={−2π(n2−1),n even or 0,0,n odd,a_n=\begin{cases} \dfrac{-2}{\pi(n^2-1)},&n\text{ even or }0,\\ 0,&n\text{ odd}, \end{cases}

so

y(t)=12sin⁡ωt+1π−23πcos⁡2ωt−215πcos⁡4ωt+⋯ .y(t)=\tfrac12\sin\omega t+\frac{1}{\pi}-\frac{2}{3\pi}\cos 2\omega t-\frac{2}{15\pi}\cos 4\omega t+\cdots.

No corners as harsh as the sawtooth — truncation converges faster.

Quiz

Fourier series

1 / 4

If y(t+T)=y(t), the fundamental frequency is…

Pick an answer to see if you are right.

Takeaway​

Know TT, project (an,bn)(a_n,b_n), watch power an2+bn2a_n^2+b_n^2, and expect midpoint convergence plus Gibbs at jumps. Nonlinear orbits from Chapter 8 are fair game once you extract their period. Labs lock analytic bnb_n and a few partial sums before DFT machinery arrives.

Next: 9.1b Fourier series labs.