<?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 on: FFT Averages</title>
	<atom:link href="http://code.compartmental.net/2007/03/21/fft-averages/feed/" rel="self" type="application/rss+xml" />
	<link>http://code.compartmental.net/2007/03/21/fft-averages/</link>
	<description>Prototypes and Other Bits of Code</description>
	<lastBuildDate>Sun, 14 Mar 2010 02:58:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Discrete Fourier Transform (eeks)&#8230;</title>
		<link>http://code.compartmental.net/2007/03/21/fft-averages/comment-page-1/#comment-1764</link>
		<dc:creator>Discrete Fourier Transform (eeks)&#8230;</dc:creator>
		<pubDate>Fri, 12 Feb 2010 01:28:54 +0000</pubDate>
		<guid isPermaLink="false">http://code.compartmental.net/?p=6#comment-1764</guid>
		<description>[...] (creating sub bands by concatenating and averaging the amplitudes for beat detection as described here), but it would still be nice to know what exactly i can expect. From what i can tell it is [...]</description>
		<content:encoded><![CDATA[<p>[...] (creating sub bands by concatenating and averaging the amplitudes for beat detection as described here), but it would still be nice to know what exactly i can expect. From what i can tell it is [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Beat It!</title>
		<link>http://code.compartmental.net/2007/03/21/fft-averages/comment-page-1/#comment-1761</link>
		<dc:creator>Beat It!</dc:creator>
		<pubDate>Mon, 08 Feb 2010 23:47:39 +0000</pubDate>
		<guid isPermaLink="false">http://code.compartmental.net/?p=6#comment-1761</guid>
		<description>[...] way to do is is to use octaves as explained in this fine blog entry. This way of sub-band layout makes a lot more sense from a musical point of view. The article comes [...]</description>
		<content:encoded><![CDATA[<p>[...] way to do is is to use octaves as explained in this fine blog entry. This way of sub-band layout makes a lot more sense from a musical point of view. The article comes [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Stucki &#187; The Math Behind Flash&#8217;s FFT Results</title>
		<link>http://code.compartmental.net/2007/03/21/fft-averages/comment-page-1/#comment-1253</link>
		<dc:creator>Ben Stucki &#187; The Math Behind Flash&#8217;s FFT Results</dc:creator>
		<pubDate>Mon, 16 Nov 2009 18:32:24 +0000</pubDate>
		<guid isPermaLink="false">http://code.compartmental.net/?p=6#comment-1253</guid>
		<description>[...] of searching on my magic number and a little bit of luck, I came across this amazing blog post: http://code.compartmental.net/2007/03/21/fft-averages/ &#8211; and Eureka! Each point i in the FFT represents a frequency band centered on the frequency [...]</description>
		<content:encoded><![CDATA[<p>[...] of searching on my magic number and a little bit of luck, I came across this amazing blog post: <a href="http://code.compartmental.net/2007/03/21/fft-averages/" rel="nofollow">http://code.compartmental.net/2007/03/21/fft-averages/</a> &#8211; and Eureka! Each point i in the FFT represents a frequency band centered on the frequency [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan</title>
		<link>http://code.compartmental.net/2007/03/21/fft-averages/comment-page-1/#comment-755</link>
		<dc:creator>Jan</dc:creator>
		<pubDate>Sun, 29 Mar 2009 15:29:51 +0000</pubDate>
		<guid isPermaLink="false">http://code.compartmental.net/?p=6#comment-755</guid>
		<description>What I&#039;ve noticed is that the number of bands equals the log2 of N, N being the number of samples in your FFT.
For an FFT with size 1024 this makes log2(1024) = 10.

Now from the second band to the last this is no problem.
You just use the ranges from 2^(bandno-2) to twice this number. So band 2 gives 2^(2-2) = 1 to 2 and band 10 gives 2^(10-2) = 256 to 512. Exactly like in the example given.

But the first band is somewhat of a difficult example. If u use a frequency of N/2 with amplitude 1 you get a nice 1 in your result (at the appropriate frequency sample), but if you use a constant DC with the value 1, you get 2 as a result in the FFT.

So my question is how to use the first band exactly. The page at http://www.dspguide.com/ch8/5.htm shows the first band runs from 0Hz to f0/N Hz where f0 is the sampling rate and N the size of the FFT. When we use the example of 44100 and 1024, we get band 0 running from 0 to 22Hz. Now how do we combine this band with band 1 (running from 22 to 66 with a center of 44Hz) to get our center frequency of 33Hz?

My guess is (0.5*band0 + band1)/2. This so we take into account the double size of band0.

Another idea if you want a nicer output, we hear things not only with a log frequency, but with a log amplitude as well. So when you have the results, take the log10 of those. (but beware log10(0) is undefined).

These are just my 2 cents, any comments would be really appreciated.</description>
		<content:encoded><![CDATA[<p>What I&#8217;ve noticed is that the number of bands equals the log2 of N, N being the number of samples in your FFT.<br />
For an FFT with size 1024 this makes log2(1024) = 10.</p>
<p>Now from the second band to the last this is no problem.<br />
You just use the ranges from 2^(bandno-2) to twice this number. So band 2 gives 2^(2-2) = 1 to 2 and band 10 gives 2^(10-2) = 256 to 512. Exactly like in the example given.</p>
<p>But the first band is somewhat of a difficult example. If u use a frequency of N/2 with amplitude 1 you get a nice 1 in your result (at the appropriate frequency sample), but if you use a constant DC with the value 1, you get 2 as a result in the FFT.</p>
<p>So my question is how to use the first band exactly. The page at <a href="http://www.dspguide.com/ch8/5.htm" rel="nofollow">http://www.dspguide.com/ch8/5.htm</a> shows the first band runs from 0Hz to f0/N Hz where f0 is the sampling rate and N the size of the FFT. When we use the example of 44100 and 1024, we get band 0 running from 0 to 22Hz. Now how do we combine this band with band 1 (running from 22 to 66 with a center of 44Hz) to get our center frequency of 33Hz?</p>
<p>My guess is (0.5*band0 + band1)/2. This so we take into account the double size of band0.</p>
<p>Another idea if you want a nicer output, we hear things not only with a log frequency, but with a log amplitude as well. So when you have the results, take the log10 of those. (but beware log10(0) is undefined).</p>
<p>These are just my 2 cents, any comments would be really appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: balu</title>
		<link>http://code.compartmental.net/2007/03/21/fft-averages/comment-page-1/#comment-751</link>
		<dc:creator>balu</dc:creator>
		<pubDate>Mon, 23 Mar 2009 17:57:22 +0000</pubDate>
		<guid isPermaLink="false">http://code.compartmental.net/?p=6#comment-751</guid>
		<description>hello 

I am using minim: FFT and I am testing Logarithmic Averages.
How can I get the spectrum[j]? please help me.</description>
		<content:encoded><![CDATA[<p>hello </p>
<p>I am using minim: FFT and I am testing Logarithmic Averages.<br />
How can I get the spectrum[j]? please help me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dekoffie</title>
		<link>http://code.compartmental.net/2007/03/21/fft-averages/comment-page-1/#comment-750</link>
		<dc:creator>dekoffie</dc:creator>
		<pubDate>Tue, 17 Mar 2009 00:57:03 +0000</pubDate>
		<guid isPermaLink="false">http://code.compartmental.net/?p=6#comment-750</guid>
		<description>Please erase my last comment, I was being too fast and not taking enough time to think it through. It&#039;s impossible to get more than 10 ranges, because the bandwidth for each frequency bin is 43.0664062Hz (in the files I am using here, with a samplerate of 44100 and an fft on 1024 samples). Range 1 &amp; 2, as in the example, will always return the index 0 because the requested frequency interval is smaller than each bin contains.</description>
		<content:encoded><![CDATA[<p>Please erase my last comment, I was being too fast and not taking enough time to think it through. It&#8217;s impossible to get more than 10 ranges, because the bandwidth for each frequency bin is 43.0664062Hz (in the files I am using here, with a samplerate of 44100 and an fft on 1024 samples). Range 1 &amp; 2, as in the example, will always return the index 0 because the requested frequency interval is smaller than each bin contains.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dekoffie</title>
		<link>http://code.compartmental.net/2007/03/21/fft-averages/comment-page-1/#comment-746</link>
		<dc:creator>dekoffie</dc:creator>
		<pubDate>Thu, 26 Feb 2009 20:17:15 +0000</pubDate>
		<guid isPermaLink="false">http://code.compartmental.net/?p=6#comment-746</guid>
		<description>About the low and hibound being zero;
when I implement your code, I get the following:

range 1=[0; 10], indexes 0-0
range 2=[10; 21], indexes 0-0
range 3=[21; 43], indexes 0-1
range 4=[43; 86], indexes 1-2
range 5=[86; 172], indexes 2-4
range 6=[172; 344], indexes 4-8
range 7=[344; 689], indexes 8-16
range 8=[689; 1378], indexes 16-32
range 9=[1378; 2756], indexes 32-64
range 10=[2756; 5512], indexes 64-128
range 11=[5512; 11025], indexes 128-256
range 12=[11025; 22050], indexes 256-512

So,should I just discard the two first ranges? How should I interpret these two ranges? Thanks for any tips :)</description>
		<content:encoded><![CDATA[<p>About the low and hibound being zero;<br />
when I implement your code, I get the following:</p>
<p>range 1=[0; 10], indexes 0-0<br />
range 2=[10; 21], indexes 0-0<br />
range 3=[21; 43], indexes 0-1<br />
range 4=[43; 86], indexes 1-2<br />
range 5=[86; 172], indexes 2-4<br />
range 6=[172; 344], indexes 4-8<br />
range 7=[344; 689], indexes 8-16<br />
range 8=[689; 1378], indexes 16-32<br />
range 9=[1378; 2756], indexes 32-64<br />
range 10=[2756; 5512], indexes 64-128<br />
range 11=[5512; 11025], indexes 128-256<br />
range 12=[11025; 22050], indexes 256-512</p>
<p>So,should I just discard the two first ranges? How should I interpret these two ranges? Thanks for any tips <img src='http://code.compartmental.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SoundRoom &#187; Blog Archive &#187; Day in GCCIS NML</title>
		<link>http://code.compartmental.net/2007/03/21/fft-averages/comment-page-1/#comment-719</link>
		<dc:creator>SoundRoom &#187; Blog Archive &#187; Day in GCCIS NML</dc:creator>
		<pubDate>Tue, 20 Jan 2009 01:43:55 +0000</pubDate>
		<guid isPermaLink="false">http://code.compartmental.net/?p=6#comment-719</guid>
		<description>[...] http://code.compartmental.net/2007/03/21/fft-averages/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://code.compartmental.net/2007/03/21/fft-averages/" rel="nofollow">http://code.compartmental.net/2007/03/21/fft-averages/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: catchit2000</title>
		<link>http://code.compartmental.net/2007/03/21/fft-averages/comment-page-1/#comment-609</link>
		<dc:creator>catchit2000</dc:creator>
		<pubDate>Thu, 17 Jul 2008 00:00:09 +0000</pubDate>
		<guid isPermaLink="false">http://code.compartmental.net/?p=6#comment-609</guid>
		<description>what about geometric averages or arithmetic squared averages? not sure if it even makes sense.
thanks</description>
		<content:encoded><![CDATA[<p>what about geometric averages or arithmetic squared averages? not sure if it even makes sense.<br />
thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ddf</title>
		<link>http://code.compartmental.net/2007/03/21/fft-averages/comment-page-1/#comment-340</link>
		<dc:creator>ddf</dc:creator>
		<pubDate>Sun, 09 Sep 2007 19:50:13 +0000</pubDate>
		<guid isPermaLink="false">http://code.compartmental.net/?p=6#comment-340</guid>
		<description>Ah, you are correct, I was misremembering how Math.pow() works. I just checked out the code for doing this in Minim and the potential divide by zero line looks like this:

avg /= (hiBound - lowBound + 1);

That probably means I ran into the divide by zero problem while developing the library.  Sorry about that.  I&#039;m going to update this post.</description>
		<content:encoded><![CDATA[<p>Ah, you are correct, I was misremembering how Math.pow() works. I just checked out the code for doing this in Minim and the potential divide by zero line looks like this:</p>
<p>avg /= (hiBound &#8211; lowBound + 1);</p>
<p>That probably means I ran into the divide by zero problem while developing the library.  Sorry about that.  I&#8217;m going to update this post.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
