Spherical Harmonics
Spherical harmonics are the Fourier basis for spheres, expanding any spherical signal in rotation-organized tones for 3-D vision and physics.
Why Does This Exist?
Environment lighting, molecular surfaces, 3-D shapes, and climate fields all live on spheres, where planar Fourier bases distort (poles bunch, seams tear). Spherical harmonics are the sphere's own orthogonal tones: degree sets spatial frequency, order () sets orientation within the band. Rotations mix only within a band (the block), which is exactly the representation theory structure that makes spherical CNNs steerable. Planar spectra are Fourier; symmetry machinery is groups.
The one idea you need first
Orthogonality on the sphere: unless and . Coefficients come from one inner product each, and truncating at degree keeps numbers: smooth signals concentrate there.
Think of It Like This
Vibration modes of a soap bubble
Tap a soap bubble and it wobbles in standing patterns: uniform breathing (), sloshing side to side (, three orientations), rippling quarters (, five orientations). Each pattern rings at its own spatial frequency, and rotating the bubble swaps orientations within a pattern without creating new ones.
Spherical harmonics are those wobble patterns for data on spheres. Lighting engineers keep the breathing plus sloshing ( numbers capture of soft daylight); shape matchers add ripples until descriptors discriminate. Rotation never leaks energy between patterns, only within.
How It Actually Works
combines associated Legendre with : nodal lines total, around the equator. Expansion ; power per degree is rotation-invariant (the descriptor). Wigner D-matrices rotate within bands: . Truncation at ( coefficients) captures smooth lighting within ; sharp shadows need ( coefficients).
Worked example
Lambertian room lit from above: radiance (clamped cosine lobe). Coefficients: (mean), band holds of remaining energy (the up-down gradient), about , tail past under . Keep ( numbers): relative error about ( residual over unit energy). Rotate the room degrees: unchanged (descriptors stable) while the numbers inside permute (orientation tracked, not lost).
Code
import math
def y00() -> float: return 1 / math.sqrt(4 * math.pi) # uniform band: constant 0.282
def band_count(bands: int) -> int: return (bands + 1) ** 2 # total modes through degree L
print(round(y00(), 3)) # -> 0.282print(band_count(2), band_count(3), band_count(8)) # -> 9 16 81Nine modes through hold the lobe within ; eighty-one through resolve sharp shadows.
Watch Out For
Truncating ringy functions and trusting pointwise values
Clamped lobes and hard shadow boundaries ring like Gibbs ( overshoot near the clamp circle at finite ). Relighting with truncated harmonics leaks light past terminators. Clamp in the spatial domain after reconstruction, or raise until ringing sits below the noise floor.
Treating band power as orientation
is invariant (good for matching) but blind to direction (useless for pose): two rooms lit from opposite sides share all . Keep full coefficient vectors when orientation matters; use power spectra only for rotation-proof retrieval.
The Quick Version
- Spherical harmonics are orthogonal tones on the sphere, organized by degree and order.
- Rotations mix within bands only, giving steerable features and invariant power spectra.
- Truncation at keeps numbers: , , for .
- The clamped-cosine lobe fits within at with mean coefficient .
- Sharp shadows need ; truncated clamps ring near terminators.
- Band powers match shapes; full vectors track pose.