<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for Nerd Action</title>
	<atom:link href="http://www.nerdaction.net/blog/?feed=comments-rss2" rel="self" type="application/rss+xml" />
	<link>http://www.nerdaction.net/blog</link>
	<description>A place where I geek out.</description>
	<lastBuildDate>Tue, 06 Dec 2011 15:14:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>Comment on Diffusion-Limited Aggregation Simulator by Ha Busacca</title>
		<link>http://www.nerdaction.net/blog/?p=56&#038;cpage=1#comment-38</link>
		<dc:creator>Ha Busacca</dc:creator>
		<pubDate>Tue, 06 Dec 2011 15:14:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.nerdaction.net/blog/?p=56#comment-38</guid>
		<description>This really answered my problem, thank you!</description>
		<content:encoded><![CDATA[<p>This really answered my problem, thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Simplest Fourier Transformation Code Ever. by Matt</title>
		<link>http://www.nerdaction.net/blog/?p=23&#038;cpage=1#comment-34</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Sat, 02 Jul 2011 08:13:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.nerdaction.net/blog/?p=23#comment-34</guid>
		<description>Hello

Can anybody drop some hints on how to get this working?  I have tried testing it on some data (a combination of two sine waves with different frequencies) but I only ever get one &quot;spike&quot; in the output.  And this is always in the zeroth element of the array, which suggests something is a bit wrong?  My attempt at using the script is below:

y=[];output=[];

for(x=0;x&lt;1000;x++)
{
y[x]=2*Math.cos(Math.PI*2*x)+Math.cos(Math.PI*4*x);
}

//alert(y);
 var len = y.length;
 var output = new Array();
 for( var k=0; k &lt; len; k++ ) {
   var real = 0;
   var imag = 0;
   for( var n=0; n &lt; len; n++ ) {
     real += y[n]*Math.cos(-2*Math.PI*k*n/len);
     imag += y[n]*Math.sin(-2*Math.PI*k*n/len);
   }
   
   output.push( [ real, imag ] ) }
 
 alert(output);



Thank you

Matt</description>
		<content:encoded><![CDATA[<p>Hello</p>
<p>Can anybody drop some hints on how to get this working?  I have tried testing it on some data (a combination of two sine waves with different frequencies) but I only ever get one &#8220;spike&#8221; in the output.  And this is always in the zeroth element of the array, which suggests something is a bit wrong?  My attempt at using the script is below:</p>
<p>y=[];output=[];</p>
<p>for(x=0;x&lt;1000;x++)<br />
{<br />
y[x]=2*Math.cos(Math.PI*2*x)+Math.cos(Math.PI*4*x);<br />
}</p>
<p>//alert(y);<br />
 var len = y.length;<br />
 var output = new Array();<br />
 for( var k=0; k &lt; len; k++ ) {<br />
   var real = 0;<br />
   var imag = 0;<br />
   for( var n=0; n &lt; len; n++ ) {<br />
     real += y[n]*Math.cos(-2*Math.PI*k*n/len);<br />
     imag += y[n]*Math.sin(-2*Math.PI*k*n/len);<br />
   }</p>
<p>   output.push( [ real, imag ] ) }</p>
<p> alert(output);</p>
<p>Thank you</p>
<p>Matt</p>
]]></content:encoded>
	</item>
</channel>
</rss>

