I’m trying to figure out how to embed processing applets in wordpress. It’s particularly tricky if they use libraries. Here’s a test applet–one I wrote a while back to illustrate goertzel algorithms. Goertzel algorithms are basically a single-frequency FFT: they tell you how much power is in a signal at a single frequency. An FFT is a much more flexible algorithm, but goertzels are very lightweight algorithms–small and fast enough that they could run on, say, an arduino.
In the applet below, the graphed signal is a sum of three cosines. The frequency of the cosines sweeps up and down across a certain range. I then step across all the frequencies in that range and run a goertzel algorithm at each of those frequencies. The result of the goertzel algorithm is in blue at the bottom of the screen, with lines drawn at the frequency peaks. While the output of the goertzel sweep isn’t completely accurate (the sum of three cosines should look like three deltas in frequency-land), the peaks are at the correct frequencies, and it would be possible to use this algorithm to do basic frequency detection and signal processing on a small microcontroller.
If you use IE or have trouble seeing the applet below, check out this page for a page that will work for you.
Source code is here. Enjoy!
As far as embedding processing applets in wordpress, this is the code I use, as suggested in this forum discussion:
As it turns out, embedding applets in wordpress is a giant pain in the ass. I usually write in the desktop publishing program MarsEdit, but it doesn’t send the html code for an applet correctly. When I write in the online wordpress editor, if I switch back and forth between code view and visual view, it wipes out the applet code. In code view, it also inserts “hidden”
<br/>tags in my code, which wig out my browser and keep it from displaying the applet. I had to manually remove any line breaks in the applet html code, and edit my wordpress post entirely in code view. I know. Pain in the ass!