Spherical Harmonics

Fourier decomposition transforms some function that varies over space or time (f(t)f(t) , f(x,y)f(x, y) , etc) into a sum over a set of orthogonal basis functions. For the Fourier transform, this set of basis functions are sinusoids of various frequencies. So (remembering that eix=cos(x)+isin(x)e^{ix} = \cos(x) + i \sin(x) ) we have,

f^(ξ)=f(x)e2iπxξdx \hat{f}(\xi) = \int_{-\infty}^{\infty} f(x) e^{-2 i \pi x \xi} dx

where ξ\xi is the frequency and f^(ξ)\hat{f}({\xi}) is a measure of the amount of power in that frequency in our function f(x)f(x) . If we do this for every frequency, we can then reconstruct the original function f(x)f(x) by summing over the basis functions, multiplied by the power in each,

f(x)=f^(ξ)e2iπxξdξ f(x) = \int_{-\infty}^{\infty} \hat{f}(\xi) e^{2 i \pi x \xi} d\xi

The core idea here is that we trade in our function defined in space or time, f(x)f(x) , for a function defined in frequency, f(ξ)f(\xi) , that contains the same information (or vice-versa). This allows us to choose the most convenient representation depending on what we want to do.

While the Fourier transform works well for functions defined in Euclidean space, it does not necessarily work for ones defined on a surface (in particular, a sphere). Is it possible to define a set of basis functions (analogous to the sinusoids of the Fourier transform) that allow us to decompose a signal defined over a sphere, f(θ,ϕ)f(\theta, \phi) , into its harmonic components?

It is! One possible set of functions are the spherical harmonics often denoted YlmY_l^m . Here, ll is the degree of the harmonic (analogous to the frequency in a sinusoid – large ll implies high frequency), and mm is the order of the harmonic (which has no direct analog in the Fourier transform). As with the Fourier transform, we can take any function defined over the surface of a sphere and instead define it as a sum over these basis functions,

f(θ,ϕ)=l=0m=llalmYlm(θ,ϕ) f(\theta, \phi) = \sum_{l=0}^{\infty} \sum_{m=-l}^{l} a_{lm} Y_l^m(\theta, \phi)

where alma_{lm} has taken the place of f(ξ)f(\xi) , the coefficient that represents the amount of power in a given harmonic (degree and order).

The basis functions are defined as,

Ylm(θ,ϕ)=ClmPlm(cos(θ))eimϕ Y_l^m(\theta, \phi) = C_l^m P_l^m (\cos(\theta)) e^{im\phi}

where CC is some constant that depends on ll and mm , and PlmP_l^m is an associated Legendre Polynomial. Before digging more into any math, let’s just look at these YlmY_l^m and their two components.

ClmPlm(cos(θ))C_l^m P_l^m (\cos(\theta))

eimϕe^{im\phi}

l:
m:
Negate m

First, let’s address the slightly odd behavior of the θ\theta property. This is not the latitude which would run from π/2\pi/2 in the North to π/2-\pi/2 in the South, but rather the colatitude defined as π/2latitude\pi/2 - \text{latitude} . The longitude, ϕ\phi , runs from π-\pi to π\pi as normal. The effects of varying these two components can fortunately be treated separately with the results multiplied together. This makes understanding the overall behavior far simpler.

The effect of varying longitude is relatively simple - it is a sinusoid with frequency of mm . The imaginary component is a sin\sin function and the real a cos\cos . As sin(x)=sin(x)\sin(x) = -\sin(-x) the imaginary component changes sign when mm does, and as cos(x)=cos(x)\cos(x) = -\cos(x) the real component is unchanged. Note that for m=0m = 0 , the imaginary component is 00 and so Ylm=0Y_l^m = 0 , and the real component is constant and YlmY_l^m consists of bands running from East-West.

The effect of varying the (co)latitude is a bit more complicated. cos(θ)\cos(\theta) varies from 11 to 1-1 as we move from the North pole to the South. We evaluate the associated Legendre polynomial (ALP), PlmP_l^m , at the result of this x=cos(θ)x = \cos(\theta) .

As you might guess from the name, the ALP of degree ll is a polynomial where the largest power of xx is ll 1. Concretely, the first few (with m=0m = 0 for now) are,

P00=1P10=xP20=12(3x21) \begin{align} P_0^0 &= 1 \\ P_1^0 &= x \\ P_2^0 &= \frac{1}{2}(3x^2 - 1) \\ \end{align}

The number of zeros of a non-degenerate polynomial (which all of these are) is equal to its degree. As all of these zeros are between 1-1 and 11 , when moving from North to South Yl0=0Y_l^0 = 0 at ll values of θ\theta .

The zeroth order (m=0m = 0 ) ALP is actually just the Legendre polynomial of the same degree. The ALPs are defined as,

Plm=(1)m(1x2)m/2dmdxm(Plm(x)) P_l^m = (-1)^m (1-x^2)^{m/2} \frac{d^m}{dx^m}(P_l^m(x))

This also shows how we can generate the ALPs of other orders. So for example,

P20=12(3x21)P21=3x(1x2)1/2P22=3(1x2) \begin{align} P_2^0 &= \frac{1}{2}(3x^2 - 1) \\ P_2^1 &= -3x(1 - x^2)^{1/2} \\ P_2^2 &= 3(1 - x^2) \\ \end{align}

Ignoring the 1m-1^m , we now have two components; the derivative of Pl0P_l^0 and (1x2)m/2(1 - x^2)^{m/2} . The first of these has lml - m zeros (as the m’th derivative of a polynomial of degree ll has degree lml - m ). The second term has zeros only at the endpoints. So,

Thus we get the following intuitive explanation for the effect of mm . At fixed ll , increasing mm reduces the number of zeros along the North-South axis by one but increases the number of wavelengths along the East-West axis by 1 (or increases the number of zeros by 2). Thus increasing mm results in a function that varies more from East to West and less from North to South.

Finally, what happens to PlmP_l^m when mm is negative? Without getting into too many details, while PlmPlmP_l^m \ne P_l^{-m} , the ClmC_l^m mostly cancel any difference other than a possible factor of 1-1 ,

PlmClm=(1)mPlmClm P_l^m C_l^m = (-1)^m P_l^{-m} C_l^{-m}

The combination of the East-West and North-South effects of negating mm is therefore for even mm , Re(Ylm)=Re(Ylm)Im(Ylm)=Im(Ylm) Re(Y_l^m) = Re(Y_l^{-m}) \quad Im(Y_l^m) = -Im(Y_l^{-m})

and for odd mm , Re(Ylm)=Re(Ylm)Im(Ylm)=Im(Ylm) Re(Y_l^m) = -Re(Y_l^{-m}) \quad Im(Y_l^m) = Im(Y_l^{-m})

A few other useful resources with different/better/more detailed explanations are,


  1. Though as you will see later, the name is not entirely accurate. For odd values of mm , the ALPs are not actually polynomials.↩︎