<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Amateur Topologist &#187; analysis</title>
	<atom:link href="http://www.amateurtopologist.com/blog/tag/analysis/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.amateurtopologist.com/blog</link>
	<description>Everything but topology.</description>
	<lastBuildDate>Sun, 15 Jan 2012 21:33:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19719</generator>
		<item>
		<title>Discrete Fourier Transforms</title>
		<link>http://www.amateurtopologist.com/blog/2009/11/17/discrete-fourier-transforms/</link>
		<comments>http://www.amateurtopologist.com/blog/2009/11/17/discrete-fourier-transforms/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 10:11:40 +0000</pubDate>
		<dc:creator>Patrick Hurst</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[analysis]]></category>

		<guid isPermaLink="false">http://www.amateurtopologist.com/?p=420</guid>
		<description><![CDATA[This post assumes a basic familiarity with complex numbers, specifically, . What do this image: and this video: have in common? They both involve discrete Fourier transform: taking an input signal (in these cases, music) and determining the frequencies of the sine and cosine waves that make it up, then doing something with those frequencies. [...]]]></description>
			<content:encoded><![CDATA[<p><em>This post assumes a basic familiarity with complex numbers, specifically, <img src="http://www.amateurtopologist.com/blog/wp-content/ql-cache/quicklatex.com-29cb369a12bfc39b99bf79b351e2e157_l3.png?9d7bd4" class="ql-img-inline-formula" alt="&#101;&#94;&#123;&#105;&#92;&#116;&#104;&#101;&#116;&#97;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>. </em></p>
<p>What do this image:<br />
<a href="http://www.amateurtopologist.com/wp-content/uploads/2009/11/Windowlickerspiral.png?9d7bd4"><img class="size-full wp-image-434" src="http://www.amateurtopologist.com/wp-content/uploads/2009/11/Windowlickerspiral.png?9d7bd4" alt="The spectrogram spiral from Aphex Twin's Windowlicker" width="486" height="279" /></a><br />
and this video:</p>
<p>have in common? They both involve discrete Fourier transform: taking an input signal (in these cases, music) and determining the frequencies of the sine and cosine waves that make it up, then doing something with those frequencies.<br />
So the interesting question is: how do you do this? At its core, the discrete Fourier transform is this equation, which transforms the sequence <img src="http://www.amateurtopologist.com/blog/wp-content/ql-cache/quicklatex.com-225d122fd480b68319f1115429d6025d_l3.png?9d7bd4" class="ql-img-inline-formula" alt="&#120;&#95;&#48;&#44;&#120;&#95;&#49;&#44;&#92;&#100;&#111;&#116;&#115;&#44;&#120;&#95;&#123;&#78;&#45;&#49;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> into <img src="http://www.amateurtopologist.com/blog/wp-content/ql-cache/quicklatex.com-cf835c52929d6106f934177ed9529fb4_l3.png?9d7bd4" class="ql-img-inline-formula" alt="&#88;&#95;&#48;&#44;&#88;&#95;&#49;&#44;&#92;&#100;&#111;&#116;&#115;&#92;&#44;&#88;&#95;&#123;&#78;&#45;&#49;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>:</p>
<p><img src="http://www.amateurtopologist.com/blog/wp-content/ql-cache/quicklatex.com-0fc74ffdc640236c6f8079834b759fa9_l3.png?9d7bd4" class="ql-img-inline-formula" alt="&#88;&#95;&#107;&#32;&#61;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#110;&#61;&#48;&#125;&#94;&#123;&#78;&#45;&#49;&#125;&#32;&#120;&#95;&#110;&#32;&#101;&#94;&#123;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#50;&#32;&#92;&#112;&#105;&#32;&#105;&#125;&#123;&#78;&#125;&#32;&#107;&#32;&#110;&#125;&#32;&#92;&#113;&#117;&#97;&#100;&#32;&#92;&#113;&#117;&#97;&#100;&#32;&#107;&#32;&#61;&#32;&#48;&#44;&#32;&#92;&#100;&#111;&#116;&#115;&#44;&#32;&#78;&#45;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/></p>
<p>The obvious question is: if this is only used for signal processing, why are there complex numbers? And the answer lies in the equation <img src="http://www.amateurtopologist.com/blog/wp-content/ql-cache/quicklatex.com-89d9c7b0b739f88256ea237009298ca1_l3.png?9d7bd4" class="ql-img-inline-formula" alt="&#101;&#94;&#123;&#105;&#92;&#116;&#104;&#101;&#116;&#97;&#125;&#61;&#92;&#99;&#111;&#115;&#92;&#116;&#104;&#101;&#116;&#97;&#32;&#43;&#105;&#92;&#115;&#105;&#110;&#92;&#116;&#104;&#101;&#116;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: -1px;"/>. Even though the imaginary part isn&#8217;t physically meaningful, it turns out that adding it makes the mathematics a lot simpler to manipulate, because exponentials are easy to multiply, whereas individual cosines and sines are not.</p>
<p>How does this help you to figure out how to decompose this into sines and cosines? Well, consider the sequence <img src='http://s.wordpress.com/latex.php?latex=x_n%3De%5E%7B%5Cfrac%7B2%5Cpi%20i%20n%20k_0%7D%7BN%7D%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='x_n=e^{\frac{2\pi i n k_0}{N}}' title='x_n=e^{\frac{2\pi i n k_0}{N}}' class='latex' />. This is the sequence that goes through <img src='http://s.wordpress.com/latex.php?latex=k_0&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='k_0' title='k_0' class='latex' /> complete cosine waves from 0 to <img src='http://s.wordpress.com/latex.php?latex=N-1&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='N-1' title='N-1' class='latex' />, with a matching real component. What&#8217;s <img src='http://s.wordpress.com/latex.php?latex=X_k&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='X_k' title='X_k' class='latex' /> for this sequence? It&#8217;s just<br />
<img src="http://www.amateurtopologist.com/blog/wp-content/ql-cache/quicklatex.com-3e3d8ca7f1519542c6369085b1269d05_l3.png?9d7bd4" class="ql-img-inline-formula" alt="&#88;&#95;&#107;&#32;&#61;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#110;&#61;&#48;&#125;&#94;&#123;&#78;&#45;&#49;&#125;&#32;&#101;&#94;&#123;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#50;&#92;&#112;&#105;&#32;&#105;&#125;&#123;&#78;&#125;&#32;&#40;&#107;&#45;&#107;&#95;&#48;&#41;&#32;&#110;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/><br />
Obviously, if <img src='http://s.wordpress.com/latex.php?latex=k%3Dk_0&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='k=k_0' title='k=k_0' class='latex' />, then this is just <img src='http://s.wordpress.com/latex.php?latex=%5Csum_%7Bn%3D0%7D%5E%7BN-1%7D%201%3DN&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\sum_{n=0}^{N-1} 1=N' title='\sum_{n=0}^{N-1} 1=N' class='latex' />. Less obvious, though, is the fact that if <img src='http://s.wordpress.com/latex.php?latex=k-k_0&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='k-k_0' title='k-k_0' class='latex' /> is an integer, then <img src='http://s.wordpress.com/latex.php?latex=X_k%3D0&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='X_k=0' title='X_k=0' class='latex' />. So essentially by transforming the sequence in this fashion, you can &#8216;decompose&#8217; it into cosine waves. (Sine waves will manifest themselves as imaginary components). So if you have a very large <img src='http://s.wordpress.com/latex.php?latex=N&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='N' title='N' class='latex' />, you can get a large number of different frequencies, ranging from 1 hertz all the way up to N hertz. There are various intricacies, such as the fact that signals are not, in general, complex numbers, but the core explanation here is enough.</p>
<p>Back to the original image and video. The image is just a spectrogram of the end of Aphex Twin&#8217;s &#8216;Windowlicker&#8217;; a spectrogram is just a graphic visualization of the discrete Fourier transform, so the curves in the spiral correspond to notes that move around in frequency, merge, and split. If you listen, you can make out the beginning and end with ease; the middle is harder, due to the sheer multiplicity of tones.<br />
<a href="http://www.amateurtopologist.com/wp-content/uploads/2009/11/spiral.mp3">Click here to listen to the &#8216;spiral&#8217; at the end of &#8216;Windowlicker&#8217;.</a><br />
The analysis of which keys to press and for how long was likely done by analyzing the spectrum of each key on the piano, comparing it to the spectrum of a recitation of the Proclamation of the European Environmental Criminal Court, and then seeing how you can best combine the key presses to add up to the spectrum of the reading. Of course, it&#8217;s more complicated than that, but it just illustrates how powerful this sort of technique is.</p>
<p>As a final note, both the MP3 and JPEG formats are based off of variations on the DFT; however, I don&#8217;t understand enough about either of them to be able to explain further. But this does partially explain why JPEGs are so bad at representing sharp edges; due to the so-called &#8216;Gibbs phenomenon&#8217;, the DFT cannot represent a sharp, discontinuous edge well. This is why screenshots of web pages tend to suck as JPEGs; text is all about sharp boundaries, so you&#8217;ll always get JPEG artifacts. This is extra-noticeable since JPEGs also do not store high-frequency data; the magnitude of the Gibbs phenomenon is inversely proportional to the highest frequency that gets stored, so a low-frequency-only compression method will have much more artifacting.<br />
<a href="http://www.amateurtopologist.com/wp-content/uploads/2009/11/jpeg-compression-artifacts.png?9d7bd4"><img class="size-full wp-image-440" src="http://www.amateurtopologist.com/wp-content/uploads/2009/11/jpeg-compression-artifacts.png?9d7bd4" alt="Compression artifacts in a JPEG screenshot" width="401" height="345" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.amateurtopologist.com/blog/2009/11/17/discrete-fourier-transforms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.amateurtopologist.com/wp-content/uploads/2009/11/spiral.mp3" length="83273" type="audio/mpeg" />
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc
Database Caching 1/9 queries in 0.003 seconds using apc
Object Caching 366/375 objects using apc

Served from: www.amateurtopologist.com @ 2012-02-05 21:16:46 -->
