Stuart Riffle wrote up a great explanation of the Fourier transform. There are a number of great visualizations in his post, but the climax is his explanation of the inverse discrete Fourier transform formula:
What a brilliant representation! My first thought was that more equations should have such elegant explanations that focus on the comprehension of the reader. I’d love to be able to produce such clear explanations in this style, so I did a little experimenting with Octopress and MathJax to see how easy it would be.
It turns out to only require a few minor yak trimmings to get something nice:
To find the energy at a particular frequency, spin your signal around a circle at that frequency, and average a bunch of points along that path.
By using MathJax instead of including a .png we get some nice benefits:
- Accessibility via screen readers
- Scalable renderings that look awesome on Retina displays
- $\LaTeX$ source that is accessible by the audience (right click on the formula)
- Simplified page-build process and source management
There are a bunch of guides on setting up MathJax with Octopress, but I didn’t mess with any of them because the oct2 theme ships with an alternative head.html
that is preconfigured to support it.
The only tweak I made was to load the Color extension for MathJax:
1 2 3 |
|
After adding that, I was able to use the \definecolor
and \color
directives just like I would in a paper:
1 2 3 4 5 6 7 8 9 10 11 |
|
There were a couple issues:
- As mentioned in several of the guides, the default markdown processor for Octopress will interfere with the
_
and^
in your TeX. I had originally worked around this by escaping them. At the end, I wrapped the whole expression in a<div>
to make the font larger, which had the side-effect of eliminating the need for escaping. - MathJax’s
\definecolor
doesn’t seem to support theHTML
color space, which lets you specify colors in hex codes. I ended up manually converting the colors back and forth between decimal and hexidecimal for the prose below the equation:
1 2 3 4 5 6 7 |
|
Now I just need a formula to explain…