# Spherical Harmonics

Spherical Harmonics are a set of orthonormal basis functions defined over a sphere.
${\displaystyle f:(\phi ,\theta )\rightarrow f(\phi ,\theta )\in \mathbb {R} }$

## Background

### Harmonic Function

Wikipedia Reference
A function ${\displaystyle f:\mathbb {R} ^{n}\rightarrow \mathbb {R} }$ is a harmonic function if it satisfies Laplace's equation:

• The Laplacian (or trace of the hessian) is zero.
• ${\displaystyle \Delta f={\frac {\partial ^{2}f}{\partial x_{1}^{2}}}+{\frac {\partial ^{2}f}{\partial x_{2}^{2}}}+\cdots +{\frac {\partial ^{2}f}{\partial x_{n}^{2}}}=0}$

## Definition

Spherical Harmonics are a set of orthonormal basis functions defined on the sphere.
Below are some explicit formulas for Laplace spherical harmonics stolen from [1]
There are ${\displaystyle 2l+1}$ functions for each band.

• ${\displaystyle Y_{l}^{m}(\theta ,\varphi )=K_{l}^{m}e^{im\varphi }P_{l}^{|m|}\cos(\theta )}$ for ${\displaystyle -l\leq m\leq l}$
where ${\displaystyle P_{l}^{m}}$ are the associated Legendre Polynomials
and ${\displaystyle K_{l}^{m}={\sqrt {\frac {(2l+1)(l-|m|)!}{4\pi (l+|m|)!}}}}$
l is the band, m is the function

For a real valued basis,

• ${\displaystyle y_{l}^{m}={\begin{cases}{\sqrt {2}}\operatorname {Re} (Y_{l}^{m})&m>0\\{\sqrt {2}}\operatorname {Im} (Y_{l}^{m})&m<0\\Y_{l}^{0}&m=0\end{cases}}={\begin{cases}{\sqrt {2}}K_{l}^{m}\cos(m\varphi )P_{l}^{m}(\cos \theta )&m>0\\{\sqrt {2}}K_{l}^{m}\sin(|m|\varphi )P_{l}^{|m|}(\cos \theta )&m<0\\K_{l}^{0}P_{l}^{0}(\cos \theta )&m=0\\\end{cases}}}$

### Visualizations

Below are distorted sphere visualizations where the radius corresponds to the value at each point.

## Applications

### Saliency

Ruofei did a project on Saliency using Spherical Harmonics as part of his PhD dissertation.