<p>Spherical harmonics really are the "spherical Fourier transform" you're looking for. The kind of hack you mention in comments, of doing a 2D Fourier transform on a lat-long projection, suffers from all the problems you usually have when you try to project a sphere onto a plane: not all spatial relations in the sphere are well-represented in the plane. If you take stretching at the poles as an example, that clearly results in a frequency shift. High-frequency components in the sphere get shifted down to low frequencies in the plane, and when you do the inverse transform, any inaccuracy shows up as high-frequency components at the pole.</p>

<p>Such a transform is useless for analysing the spectrum of the original signal, because it distorts the frequencies (and distorts them differently in different parts of the sphere). It's also poor for representation, because of the introduction of these high-frequency artefacts.</p>

<p>Spherical harmonics use different basis functions so they can work directly on the lat-long without treating it like a plane. If you plot the response of the spherical harmonics on a plane projection of the sphere, they look kooky (like a map of the earth does), but they look much more natural on a sphere. They don't suffer from artefacts at the poles, and they don't frequency-shift signals. They're also rotation-invariant, so it doesn't even matter where you put the poles. They don't even have poles, in the sense of discontinuities, which is a property you can't achieve from a plane projection however many <em>ad hoc</em> co-ordinate transforms you do. Rotation-invariance is useful for applications like environment maps, where you'd like to rotate the spherical-harmonic transform of the environment (light probe, or whatever) into the local co-ordinate system before feeding it to the shader. There isn't a projection onto the plane that has this property.</p>

CC BY-SA 3.0
2016-10-27T15:49:31.127Z
Would there be much point in mapping the sphere differently to compensate for the poles problem? Maybe something taking the vertical angle as a percent and squaring it, to pull the sample points towards the equator non linearly?
Alan Wolfe
CC BY-SA 3.0
2016-10-27T17:49:50.580Z
The other reason why SH is handy is it's a rotationally invariant representation. Rotating an SH basis function (by any axis and angle) transforms it to a linear combination of other SH basis functions of the same order. So, you can rotate an SH-represented function by [applying an appropriate matrix to the SH coefficients directly](http://www.filmicworlds.com/2014/07/02/simple-and-fast-spherical-harmonic-rotation/). You don't get this if you do a 2D Fourier transform in lat-long parameter space.
Nathan Reed
CC BY-SA 3.0
2016-10-27T22:51:03.530Z
@NathanReed Yes, I was thinking about that, but neglected to include it in the answer. I've updated it now with some more thoughts about that. Thanks for mentioning it.
Dan Hulme
CC BY-SA 3.0
2016-10-27T08:20:01.903Z
2016-10-27T22:49:43.190Z
2016-10-27T22:49:43.190Z
Dan Hulme
<p>I'm curious why spherical harmonics are commonly used in real time graphics instead of a spherical Fourier transform.</p>

<p>I get that spherical harmonics are in a sort of frequency space (like FT is) so you can do convolution very efficiently.</p>

<p>I also get that SH is an approximation of a function on a sphere, using up to an infinite series to perfectly reconstruct the original data, but often using only the first few items in the series.</p>

<p>This sounds a lot like a spherical Fourier transform, but the math uses different functions entirely.</p>

<p>What is the benefit of the SH representation over spherical FT?</p>

CC BY-SA 3.0
2016-10-27T04:24:36.350Z
Can you clarify what you mean by a "spherical Fourier transform"? I googled, but didn't turn up anything that sounds like it would match this question.
Nathan Reed
CC BY-SA 3.0
2016-10-27T04:30:17.043Z
I'm thinking like taking a unit sphere, breaking it into the two angles that parameterize it, so you have a 2d function, then using 2d DFT on that.
Alan Wolfe
CC BY-SA 3.0
2016-10-27T05:39:55.723Z
Related: http://math.stackexchange.com/questions/17479/how-to-perform-a-fourier-transform-in-spherical-coordinates
Alan Wolfe
<lighting><fourier-transform><spherical-harmonics>
Why is spherical harmonics used in low frequency graphics data instead of a spherical Fourier transform?
Alan Wolfe
# Why is spherical harmonics used in low frequency graphics data instead of a spherical Fourier transform?

(Asked by: username_0 on 2016-10-27)

I'm curious why spherical harmonics are commonly used in real time graphics instead of a spherical Fourier transform.

I get that spherical harmonics are in a sort of frequency space (like FT is) so you can do convolution very efficiently.

I also get that SH is an approximation of a function on a sphere, using up to an infinite series to perfectly reconstruct the original data, but often using only the first few items in the series.

This sounds a lot like a spherical Fourier transform, but the math uses different functions entirely.

What is the benefit of the SH representation over spherical FT?

**Tags:** lighting, fourier-transform, spherical-harmonics

> **Comments:**
> **username_1**: Can you clarify what you mean by a "spherical Fourier transform"? I googled, but didn't turn up anything that sounds like it would match this question.  
> **username_0**: I'm thinking like taking a unit sphere, breaking it into the two angles that parameterize it, so you have a 2d function, then using 2d DFT on that.  
> **username_0**: Related: http://math.stackexchange.com/questions/17479/how-to-perform-a-fourier-transform-in-spherical-coordinates  

---

## 1 answers

### Answer by username_2 on 2016-10-27. Score: 10 | Accepted answer

Spherical harmonics really are the "spherical Fourier transform" you're looking for. The kind of hack you mention in comments, of doing a 2D Fourier transform on a lat-long projection, suffers from all the problems you usually have when you try to project a sphere onto a plane: not all spatial relations in the sphere are well-represented in the plane. If you take stretching at the poles as an example, that clearly results in a frequency shift. High-frequency components in the sphere get shifted down to low frequencies in the plane, and when you do the inverse transform, any inaccuracy shows up as high-frequency components at the pole.

Such a transform is useless for analysing the spectrum of the original signal, because it distorts the frequencies (and distorts them differently in different parts of the sphere). It's also poor for representation, because of the introduction of these high-frequency artefacts.

Spherical harmonics use different basis functions so they can work directly on the lat-long without treating it like a plane. If you plot the response of the spherical harmonics on a plane projection of the sphere, they look kooky (like a map of the earth does), but they look much more natural on a sphere. They don't suffer from artefacts at the poles, and they don't frequency-shift signals. They're also rotation-invariant, so it doesn't even matter where you put the poles. They don't even have poles, in the sense of discontinuities, which is a property you can't achieve from a plane projection however many *ad hoc* co-ordinate transforms you do. Rotation-invariance is useful for applications like environment maps, where you'd like to rotate the spherical-harmonic transform of the environment (light probe, or whatever) into the local co-ordinate system before feeding it to the shader. There isn't a projection onto the plane that has this property.

> **Comments:**
> **username_0**: Would there be much point in mapping the sphere differently to compensate for the poles problem? Maybe something taking the vertical angle as a percent and squaring it, to pull the sample points towards the equator non linearly?  
> **username_1**: The other reason why SH is handy is it's a rotationally invariant representation. Rotating an SH basis function (by any axis and angle) transforms it to a linear combination of other SH basis functions of the same order. So, you can rotate an SH-represented function by [applying an appropriate matrix to the SH coefficients directly](http://www.filmicworlds.com/2014/07/02/simple-and-fast-spherical-harmonic-rotation/). You don't get this if you do a 2D Fourier transform in lat-long parameter space.  
> **username_2**: @username_1 Yes, I was thinking about that, but neglected to include it in the answer. I've updated it now with some more thoughts about that. Thanks for mentioning it.  

---

