<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>mikeash.com pyblog/friday-qa-2012-10-12-obtaining-and-interpreting-audio-data.html comments</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-10-12-obtaining-and-interpreting-audio-data.html#comments</link><description>mikeash.com Recent Comments</description><lastBuildDate>Sun, 10 May 2026 06:10:34 GMT</lastBuildDate><generator>PyRSS2Gen-1.0.0</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Andrew Benson - 2019-08-01 17:54:28</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-10-12-obtaining-and-interpreting-audio-data.html#comments</link><description>Great article and still very relevant today.  Thanks Mike!
&lt;br /&gt;
&lt;br /&gt;A few people asked about performing FFTs.  There's a great document from Apple with step-by-step instructions and code for doing exactly that using the Accelerate framework.
&lt;br /&gt;
&lt;br /&gt;&lt;a href="https://developer.apple.com/documentation/accelerate/vdsp/fast_fourier_transforms/finding_the_component_frequencies_in_a_composite_sine_wave"&gt;https://developer.apple.com/documentation/accelerate/vdsp/fast_fourier_transforms/finding_the_component_frequencies_in_a_composite_sine_wave&lt;/a&gt;</description><guid isPermaLink="true">3550f220847a6fb44df44743a1b76428</guid><pubDate>Thu, 01 Aug 2019 17:54:28 GMT</pubDate></item><item><title>dougg3 - 2014-11-02 16:33:29</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-10-12-obtaining-and-interpreting-audio-data.html#comments</link><description>Thanks--your discussion on decibels was really helpful! It's the morning, so I may be full of it right now (correct me if I'm misinterpreting something), but &lt;code&gt;20*log10f(averageAmplitude)&lt;/code&gt; is not equal to &lt;code&gt;10*log10f(averageSquaredAmplitude)&lt;/code&gt; for the same reason that &lt;code&gt;sqrtf(a*a + b*b)&lt;/code&gt; is not equal to &lt;code&gt;a + b&lt;/code&gt;. For example, according to Google:
&lt;br /&gt;
&lt;br /&gt;&lt;code&gt;20*log10((10 + 20 + 30) / 3) = 26.021&lt;/code&gt;
&lt;br /&gt;&lt;code&gt;10*log10((100 + 400 + 900) / 3) = 26.690&lt;/code&gt;</description><guid isPermaLink="true">1a6d07c179e15219e706857cac01a091</guid><pubDate>Sun, 02 Nov 2014 16:33:29 GMT</pubDate></item><item><title>mikeash - 2012-10-21 01:25:55</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-10-12-obtaining-and-interpreting-audio-data.html#comments</link><description>For Nyquist to apply, you need to sample the signal for an infinite amount of time with perfect bandlimiting and unlimited precision. To reconstruct the signal exactly, you have to sum an infinite number of terms. Real-world systems must necessarily only approximate these conditions, and with approximations, the proof no longer applies. It would not surprise me if higher frequencies suffer from distortion under these real-world conditions.</description><guid isPermaLink="true">a6201c7013656758e59ea17d4bc4ca3f</guid><pubDate>Sun, 21 Oct 2012 01:25:55 GMT</pubDate></item><item><title>jamie - 2012-10-19 22:23:30</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-10-12-obtaining-and-interpreting-audio-data.html#comments</link><description>&lt;div class="blogcommentquote"&gt;&lt;div class="blogcommentquoteinner"&gt;When discussing sampling I think it's important to mention that as frequencies approach the Nyquist limit they are represented with more and more distortion. Just so people don't think it's 100% accurate all the way up. &lt;/div&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;Actually this isn't true.  Nyquist-Shannon proves that a band limited signal will be reproduced *exactly*.  Note that a DAC does not output a stepwise function, but each impulse is multiplied by the sinc function ( sin(x) / x ).  See the wiki: &lt;a href="http://en.wikipedia.org/wiki/Nyquist-Shannon_sampling_theorem#Reconstruction"&gt;http://en.wikipedia.org/wiki/Nyquist-Shannon_sampling_theorem#Reconstruction&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;Some other modulations do however pickup distortion at higher frequencies, particularly DSD or Sigma-Delta.</description><guid isPermaLink="true">10383a525701deabca25b3c90c9b1f48</guid><pubDate>Fri, 19 Oct 2012 22:23:30 GMT</pubDate></item><item><title>SSteve - 2012-10-19 00:03:31</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-10-12-obtaining-and-interpreting-audio-data.html#comments</link><description>When discussing sampling I think it's important to mention that as frequencies approach the Nyquist limit they are represented with more and more distortion. Just so people don't think it's 100% accurate all the way up. Personally, it doesn't make a lot of difference for me because I can't hear much above 13kHz. Loud drummer in my junior high school band.</description><guid isPermaLink="true">b744003462c978035e493dc267c30ba6</guid><pubDate>Fri, 19 Oct 2012 00:03:31 GMT</pubDate></item><item><title>Jake - 2012-10-16 22:07:13</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-10-12-obtaining-and-interpreting-audio-data.html#comments</link><description>Can I second that idea?  I'd love to see how to do an FFT on raw audio data. If that's not being greedy :) Great article!</description><guid isPermaLink="true">8d8d79fd53ea46d63f4ff71550db6fbe</guid><pubDate>Tue, 16 Oct 2012 22:07:13 GMT</pubDate></item><item><title>jamie - 2012-10-16 00:40:04</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-10-12-obtaining-and-interpreting-audio-data.html#comments</link><description>You might also do some theory on FFTs, how to window and analyze samples, and then use them for visualization or resynthesis.</description><guid isPermaLink="true">145840ae0e75f83c06795525bd00fc27</guid><pubDate>Tue, 16 Oct 2012 00:40:04 GMT</pubDate></item><item><title>Julian Iaccopucci - 2012-10-15 13:18:45</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-10-12-obtaining-and-interpreting-audio-data.html#comments</link><description>Thanks Mike
&lt;br /&gt;
&lt;br /&gt;Mike conclusion after studying this interesting post is that I have to go to the optician very sooooooon.
&lt;br /&gt;
&lt;br /&gt;Looking forward to your next post,
&lt;br /&gt;
&lt;br /&gt;Julian.</description><guid isPermaLink="true">7b8445d749e9d3ff650c7f00c460b816</guid><pubDate>Mon, 15 Oct 2012 13:18:45 GMT</pubDate></item><item><title>mikeash - 2012-10-15 02:43:26</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-10-12-obtaining-and-interpreting-audio-data.html#comments</link><description>&lt;b&gt;Julian Iaccopucci:&lt;/b&gt; Well, here's the actual function prototype:
&lt;br /&gt;
&lt;br /&gt;&lt;code&gt;OSStatus ExtAudioFileSetProperty (
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ExtAudioFileRef         inExtAudioFile,
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ExtAudioFilePropertyID  inPropertyID,
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;UInt32                  inPropertyDataSize,
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;const void              *inPropertyData
&lt;br /&gt;);&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;No AudioFileID to be found.</description><guid isPermaLink="true">4f789b8da027174ac1f20781e529511b</guid><pubDate>Mon, 15 Oct 2012 02:43:26 GMT</pubDate></item><item><title>Julian Iaccopucci - 2012-10-14 14:16:29</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-10-12-obtaining-and-interpreting-audio-data.html#comments</link><description>I just went trough the entire program trying to understand and learn every "bite" of code. I can be wrong, but I thought that ExtAudioFileSetProperty takes as first parameter an AudioFileID data type.
&lt;br /&gt;
&lt;br /&gt;Thanks Mike,
&lt;br /&gt;
&lt;br /&gt;Julian.
&lt;br /&gt;</description><guid isPermaLink="true">9c909d5c2422ea458916b120a807a2c2</guid><pubDate>Sun, 14 Oct 2012 14:16:29 GMT</pubDate></item><item><title>mikeash - 2012-10-14 13:21:14</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-10-12-obtaining-and-interpreting-audio-data.html#comments</link><description>&lt;b&gt;Julian Iaccopucci:&lt;/b&gt; I'm not sure I understand what you're asking. If I'm using ExtAudioFile for everything, why would AudioFileID or AudioFileOpenURL be involved?</description><guid isPermaLink="true">09f9199ed7ef493f3b2e5e99fbbb580b</guid><pubDate>Sun, 14 Oct 2012 13:21:14 GMT</pubDate></item><item><title>Julian Iaccopucci - 2012-10-13 19:11:01</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-10-12-obtaining-and-interpreting-audio-data.html#comments</link><description>Hi Mike.
&lt;br /&gt;
&lt;br /&gt;In order to set the properties with ExtAudioFileSetProperty shouldn't we need to pass AudioFileID created with AudioFileOpenURL instead of an ExtAudioFileRef created with ExtAudioFileOpenURL?
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;Thanks for the always pleasent read,
&lt;br /&gt;
&lt;br /&gt;Julian.</description><guid isPermaLink="true">34a3ad7bd930f7e2fcb90a87bba1ba2f</guid><pubDate>Sat, 13 Oct 2012 19:11:01 GMT</pubDate></item><item><title>jamie - 2012-10-13 16:39:14</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-10-12-obtaining-and-interpreting-audio-data.html#comments</link><description>Naturally you put this up today, after I spent the week writing &amp;lt;a href="&lt;a href="https://github.com/iluvcapra/JHWaveform"&gt;https://github.com/iluvcapra/JHWaveform&lt;/a&gt;"&amp;gt;MY waveform overview class&amp;lt;/a&amp;gt;.
&lt;br /&gt;
&lt;br /&gt;A subjects that might follow this is a metering NSView class.</description><guid isPermaLink="true">3b649769e67e8c6af76ed686eee06d74</guid><pubDate>Sat, 13 Oct 2012 16:39:14 GMT</pubDate></item></channel></rss>
