Ahhrrr... I looked at the page and though "Wow, I will finally do it... one day" and decided to add it to my Delicious account, only to realize it was already there.
And then it came to me: it was probably posted on HN few months ago, I decided to read it "later" and created that Delicious link :)
float wr, wi, arg, *p1, *p2, temp;
float tr, ti, ur, ui, *p1r, *p1i, *p2r, *p2i;
long i, bitm, j, le, le2, k, logN;
Oh come on, what's with people and variable names like this? It's not like longer names take up more memory.
Especially heinous is when, like this snippet, the variables are not explained anywhere. I dislike de-obfuscating code to understand an algorithm, especially when posted on a page which claims to help you understand it (this is the FFT, not the FT, but still. They might as well have shown LZW/BZ2, would you be able to tell the difference?).
mistake #1 when trying to understand or explain the Fourier Transform is to discuss the breakdown of f(t) into sine/cosine components. it's much easier to understand in terms of the original e^(i * w * t) waveforms, and the effects of integrating [-inf,inf]integ[f(t) * e^(-i * W * t)] for any given W. there's a nice visualization of this that involves considering the "helical" e^(i * w * t) waveforms and the twist that e^(-i * W * t) applies to these. bla bla bla.
5 comments
[ 3.1 ms ] story [ 24.7 ms ] threadAnd then it came to me: it was probably posted on HN few months ago, I decided to read it "later" and created that Delicious link :)
http://news.ycombinator.com/item?id=1360405
Especially heinous is when, like this snippet, the variables are not explained anywhere. I dislike de-obfuscating code to understand an algorithm, especially when posted on a page which claims to help you understand it (this is the FFT, not the FT, but still. They might as well have shown LZW/BZ2, would you be able to tell the difference?).