<?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/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>The Studio Files &#187; File Compression</title>
	<atom:link href="http://thestudiofiles.com/?cat=611&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://thestudiofiles.com</link>
	<description>Helping You Make It Happen</description>
	<lastBuildDate>Sat, 07 Feb 2015 17:15:20 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.3</generator>
	<copyright>2006-2007 </copyright>
	<managingEditor>Damon.Sink@notes.udayton.edu (The Studio Files)</managingEditor>
	<webMaster>Damon.Sink@notes.udayton.edu (The Studio Files)</webMaster>
	<image>
		<url>http://thestudiofiles.com/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>The Studio Files</title>
		<link>http://thestudiofiles.com</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle></itunes:subtitle>
	<itunes:summary>Helping You Make It Happen</itunes:summary>
	<itunes:keywords></itunes:keywords>
	<itunes:category text="Society &#38; Culture" />
	<itunes:author>The Studio Files</itunes:author>
	<itunes:owner>
		<itunes:name>The Studio Files</itunes:name>
		<itunes:email>Damon.Sink@notes.udayton.edu</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://thestudiofiles.com/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
	<item>
		<title>Everything about File Compression: Take 6</title>
		<link>http://thestudiofiles.com/?p=525</link>
		<comments>http://thestudiofiles.com/?p=525#comments</comments>
		<pubDate>Sun, 23 Nov 2008 18:01:44 +0000</pubDate>
		<dc:creator><![CDATA[ConnorSmith]]></dc:creator>
				<category><![CDATA[File Compression]]></category>
		<category><![CDATA[aac]]></category>
		<category><![CDATA[double speak]]></category>
		<category><![CDATA[encoders]]></category>
		<category><![CDATA[loss of bandwidth]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[ogg]]></category>
		<category><![CDATA[pre-echo]]></category>
		<category><![CDATA[problems]]></category>
		<category><![CDATA[vorbis]]></category>

		<guid isPermaLink="false">http://thestudiofiles.com/?p=525</guid>
		<description><![CDATA[Problems with lossy (mp3, AAC, Vorbis&#8230;) encoders We&#8217;ve established that there are a lot of good things about these encoders (dramatically reduce file size, allowed the internet to be the new battleground for music, etc&#8230;). But what are some problems that these encoders can introduce?  Why do they sometimes sound wonky? This article will be [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><em>Problems with lossy (mp3, AAC, Vorbis&#8230;) encoders</em></p>
<p>We&#8217;ve established that there are a lot of good things about these encoders (dramatically reduce file size, allowed the internet to be the new battleground for music, etc&#8230;).</p>
<p>But what are some problems that these encoders can introduce?  Why do they sometimes sound wonky?<span id="more-525"></span></p>
<p><a title="File Compression (mp3, AAC, Ogg Vorbis, FLAC, etc)" href="http://thestudiofiles.com/?cat=611">This article will be more relevant if you&#8217;ve read the other articles on file compression.</a></p>
<p>I&#8217;ll just list major problem areas as headings and then describe them.</p>
<p><span style="text-decoration: underline;"><strong>Loss of Bandwidth</strong></span></p>
<p>I talked about this a bit int he previous articles.  Lossy encoders don&#8217;t like encoding high frequency information, as it can take a lot of bits to do so, given the detail of the waveforms.  Given the fact that the encoder is limited by its KBPS (kilo-bits-per-second) setting, it needs to adhere to a specific number of bits, no matter what the source material is.  When the encoder doesn&#8217;t have enough bits to accurately encoder the whole frame, high frequencies are the first to go.  Check out the frequency content of this mp3, encoded at 96 KBPS (again from Steely Dan&#8217;s Hey Nineteen).  Notice how there is nothing above ~12k? (click for full size)</p>
<p style="text-align: left;"><a href="http://thestudiofiles.com/wp-content/uploads/2008/11/96k.gif"><img class="aligncenter size-medium wp-image-526" title="96kbps Steely Dan mp3" src="http://thestudiofiles.com/wp-content/uploads/2008/11/96k.gif" alt="Nothing above 12k! ouch..." width="441" height="318" /></a></p>
<p style="text-align: left;">Now, compare that graph to the following one.  Below is a 256kbps mp3 of the same tune.  Notice how there is more high frequency information present (eyeballing looks like at least 16k or more)</p>
<p style="text-align: center;"><a href="http://thestudiofiles.com/wp-content/uploads/2008/11/256k.gif"><img class="aligncenter size-medium wp-image-527" title="256kbps mp3 " src="http://thestudiofiles.com/wp-content/uploads/2008/11/256k.gif" alt="Little more high frequency!" width="432" height="312" /></a></p>
<p style="text-align: left;">Since the second mp3 has been given more than double the bits per second to encode, it has room for more of the high end goodness.</p>
<p style="text-align: left;"><span style="text-decoration: underline;"><strong>Pre-Echo</strong></span></p>
<p style="text-align: left;">Pre-echo is quite an odd concept.  Its probably easier to understand in picture form (below).  When a quantizer is working, it is looking at a frame at a time (let&#8217;s say maybe 32 milliseconds long, like the picture).  When it encodes the quantization (and other) distortion/noise, it somewhat spreads it across the entire frame.  In a frame like this with a transient attack (its a castanet), there will be an increase in quantization distortion.  But, the transient doesn&#8217;t happen until the middle of the frame!  So, the quantization distortion it induces can actually be encoded <strong>before</strong> the transient even happens.   <em>Unfortunately this is from an AES paper, and is in black and white (when it should be two different colors).  The bottom line is the level of quantization distortion, the top is the rest of the signal (with the castanet transient)</em></p>
<p style="text-align: center;"><a href="http://thestudiofiles.com/wp-content/uploads/2008/11/picture-1.png"><img class="size-medium wp-image-528 aligncenter" title="Pre-Echo" src="http://thestudiofiles.com/wp-content/uploads/2008/11/picture-1.png" alt="" width="415" height="363" /></a></p>
<p style="text-align: center;"><em>Brandenberg, Karlheinz. AES, 17th International AES Conference, Florence, Italy. MP3 and AAC Explained. New York, NY: AES, 1999</em></p>
<p style="text-align: left;">So notice how the noise line increases in amplitude way before the transient occurs.  This will sound almost like a reverb (think back to the Ogg Vorbis audio example), but it will happen before the attack of the source.  Weird=yes.</p>
<p style="text-align: left;"><span style="text-decoration: underline;"><strong>Time Smear/Double Speak</strong></span></p>
<p style="text-align: left;">I&#8217;ll just hit on these briefly, because things start to get really complicated.  <em>(When working on a presentation for the Art of Record Production a few weeks back, I found out what &#8220;brain tears&#8221; were by thinking about this stuff for too long).</em></p>
<p style="text-align: left;">Lossy encoders like to move transients around.  Assuming we are working with stereo audio (2-channel), the encoder is alot happier if the maximum of a given transient occurs at the same time in the L and R channel, rather than having to remember two different positions for the two channels.  Sometimes (especially in lower KBPS settings) the encoder will scoot one channel&#8217;s peak over a bit to line up with the other.  However, sometimes this shifting causes other parts of the signal to no longer line up.  If the encoder doesn&#8217;t correct this, then there will be a delay between the R and L channel at that point (which could cause the &#8220;double&#8221; speak).</p>
<p style="text-align: left;">Without getting close to &#8220;brain tears&#8221;, its just good to know that these encoders are moving things in time.  This is going to introduce more distortion, leave room for smearing/double speak, alter frequency response/phase, etc&#8230;..</p>
<p style="text-align: left;"><strong>In addition to all these^^ problems, more basic problems also occur</strong></p>
<ul>
<li>A compressed file can sound &#8220;harsh&#8221; (also sometimes termed &#8220;rough&#8221;) because the nature of the noise floor is changing constantly (from encoding window to window)</li>
<li>It can be noisy!  (especially when the encoder fails to lower the level of the noise below the masking threshold induced by the level of the &#8220;good&#8221; signal)</li>
<li>Other non-harmonic distortions as a result of all of the above&#8230;</li>
</ul>
<p>This is just an introduction to problems with lossy encoders.  I use the word &#8220;problems&#8221; with caution though.  In no way do I mean to say &#8216;MP3 SUCKS!&#8221; etc&#8230; These lossy encoders are really great tools for our industry, but it is important to understand what they are doing to the audio and why.</p>
<p>As usual, if there are any questions or need for further explanation, please post in the comments</p>
<p>C</p>
<p>The Studio Files</p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://thestudiofiles.com/?feed=rss2&#038;p=525</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Everything about File Compression: Audio Examples</title>
		<link>http://thestudiofiles.com/?p=404</link>
		<comments>http://thestudiofiles.com/?p=404#comments</comments>
		<pubDate>Wed, 19 Nov 2008 21:35:26 +0000</pubDate>
		<dc:creator><![CDATA[ConnorSmith]]></dc:creator>
				<category><![CDATA[Chit Chat]]></category>
		<category><![CDATA[File Compression]]></category>
		<category><![CDATA[Project Studio]]></category>
		<category><![CDATA[codec]]></category>
		<category><![CDATA[compared]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[FLAC]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[ogg]]></category>
		<category><![CDATA[vorbis]]></category>

		<guid isPermaLink="false">http://thestudiofiles.com/?p=404</guid>
		<description><![CDATA[Now that I&#8217;ve told you all about compression formats, let&#8217;s do some listening. This article will make more sense after reading the rest of this series (Take 1, Take 2, Take 3, Take 4, Take 5, and VBR) The following audio files were made by converting a CD quality (44.1/16) version of Steely Dan&#8217;s Hey [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Now that I&#8217;ve told you all about compression formats, let&#8217;s do some listening.<span id="more-404"></span></p>
<p><strong>This article will make more sense after reading the rest of this series (<a title="Perceptual/Psychoacoustic encoders explained" href="http://thestudiofiles.com/?p=344">Take 1</a>, <a title="MP3 encoder explained" href="http://thestudiofiles.com/?p=348">Take 2</a>, <a title="AAC encoder explained" href="http://thestudiofiles.com/?p=355">Take 3</a>, <a title="Ogg Vorbis Explained" href="http://thestudiofiles.com/?p=376">Take 4</a>, <a title="FLAC explained" href="http://thestudiofiles.com/?p=387">Take 5</a><a title="Variable Bit Rate VBR explained" href="http://thestudiofiles.com/?p=357">, and VBR</a>)</strong></p>
<p>The following audio files were made by converting a CD quality (44.1/16) version of Steely Dan&#8217;s <em>Hey Nineteen</em> into compressed formats (MP3, OGG, and FLAC&#8230; still tracking down my AAC file&#8230;).</p>
<p>Once converted, each file was summed to mono, polarity flipped, and summed with the original WAV file.</p>
<p>Now &#8211; this is NOT a representation of what &#8220;MP3 takes out&#8221;.  Its not that simple.  These compression codecs also introduce new distortion, restructure the bit depth, time shift peaks, raise/lower noise floors, etc&#8230; Therefore, this is not all that much of a scientific comparison.  So, then why are we doing it?</p>
<p>In essence, tests like these give you an idea of what the failure mode and distortion (aka, the &#8220;yuck&#8221;) within the compressed formats sounds like.  Also, you can at least get a good idea of how the compression codec is dealing with the high end of the spectrum.  Generally, the more high-end you hear in these examples, the more the codec cut out of the original file when compression down.  There are 2 specific things to notice in these.</p>
<p>1) Compare the mp3 to the Vorbis.  Notice how the Vorbis sounds more analog-like?  (Much more like natural white-noise-esque analog noise, rather than the harder, digital sounding distortion of mp3)  <a title="Referring back to Ogg Vorbis Explained" href="http://thestudiofiles.com/?p=376">If you refer back to the article on Vorbis</a>, you&#8217;ll remember that Vorbis alters the level of the noise floor to mask nasty-sounding distortion.</p>
<p>2) The FLAC summed file may not be what you expect.  Remember&#8230; its lossless (!hint)</p>
<p><em>(haha, its funny to note that the following files are actually .mp3&#8230; This is a great demonstration of why we need these formats&#8230; WAV files are too big!)</em></p>
<p><a href="http://thestudiofiles.com/wp-content/uploads/2008/11/corrected-time-aligned-pcm-256mp3.mp3">256 KBPS MP3 flipped and summed with original</a></p>
<p><a href="http://thestudiofiles.com/wp-content/uploads/2008/11/corrected-time-aligned-pcm-256ogg.mp3">256 KBPS Ogg Vorbis flipped and summed with original</a></p>
<p><a href="http://thestudiofiles.com/wp-content/uploads/2008/11/corrected-time-aligned-pcm-0-flac.mp3">FLAC flipped and summed with original</a></p>
<p>Questions? Disagreements?  Post it in the comments.</p>
<p>C</p>
<p>The Studio Files</p>
]]></content:encoded>
			<wfw:commentRss>http://thestudiofiles.com/?feed=rss2&#038;p=404</wfw:commentRss>
		<slash:comments>2</slash:comments>
			<enclosure url="http://thestudiofiles.com/wp-content/uploads/2008/11/corrected-time-aligned-pcm-256mp3.mp3" length="494044" type="audio/mpeg" />
		<enclosure url="http://thestudiofiles.com/wp-content/uploads/2008/11/corrected-time-aligned-pcm-256ogg.mp3" length="494620" type="audio/mpeg" />
		<enclosure url="http://thestudiofiles.com/wp-content/uploads/2008/11/corrected-time-aligned-pcm-0-flac.mp3" length="483868" type="audio/mpeg" />
	</item>
		<item>
		<title>Everything about File Compression: Take 5</title>
		<link>http://thestudiofiles.com/?p=387</link>
		<comments>http://thestudiofiles.com/?p=387#comments</comments>
		<pubDate>Wed, 19 Nov 2008 06:03:46 +0000</pubDate>
		<dc:creator><![CDATA[ConnorSmith]]></dc:creator>
				<category><![CDATA[Chit Chat]]></category>
		<category><![CDATA[File Compression]]></category>
		<category><![CDATA[Project Studio]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[codec]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[FLAC]]></category>
		<category><![CDATA[Free]]></category>
		<category><![CDATA[lossless]]></category>
		<category><![CDATA[prediction]]></category>

		<guid isPermaLink="false">http://thestudiofiles.com/?p=387</guid>
		<description><![CDATA[FLLLLLLAAAAAAAAAAAAAACCCCCCCCCCC aka FLAC (Free Lossless Audio Codec) Keyword there being: Lossless!  No data is removed from the audio.  Let&#8217;s dive in&#8230; Again, if you haven&#8217;t read Take 1, Take 2, Take 3, Take 4, and VBR, you may want to&#8230; So far, all the compression codecs we&#8217;ve looked at are lossy, meaning they actually remove [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>FLLLLLLAAAAAAAAAAAAAACCCCCCCCCCC</p>
<p>aka FLAC (Free Lossless Audio Codec)</p>
<p>Keyword there being: Lossless!  No data is removed from the audio.  Let&#8217;s dive in&#8230;<span id="more-387"></span></p>
<p>Again, if you haven&#8217;t read <a title="Perceptual/Psychoacoustic encoders explained" href="http://thestudiofiles.com/?p=344">Take 1</a>, <a title="MP3 encoder explained" href="http://thestudiofiles.com/?p=348">Take 2</a>, <a title="AAC encoder explained" href="http://thestudiofiles.com/?p=355">Take 3</a>, <a title="Ogg Vorbis Explained" href="http://thestudiofiles.com/?p=376">Take 4</a>, and <a title="Variable Bit Rate VBR explained" href="http://thestudiofiles.com/?p=357">VBR</a>, you may want to&#8230;</p>
<p>So far, all the compression codecs we&#8217;ve looked at are lossy, meaning they actually remove data from the file (and therefore, you could never accurately convert back from the uncompressed file).  The other encoders work on the principle of masking and psychoacoustic models, looking to &#8220;take out&#8221; ot de-emphasize the things humans won&#8217;t hear.</p>
<p>FLAC doesn&#8217;t.  And while similar in some ways, this is a whole different breed of encoder.  Plus (like Ogg Vorbis, its open source = FREE)</p>
<p>For starters, FLAC (like the lossy encoders) breaks the signal into smaller pieces.  The length of each piece is based on a whole slew of different factors, including dynamic level, spectral content, transients, etc&#8230; Now, this is the point where the lossy encoders would start axing (leaving out) things.</p>
<p>FLAC&#8217;s goal is to formulate its best prediction of how the signal is acting in the frame.  Once it has the best mathematical prediction it can come up with, it compares the prediction to the original, and encodes any differences (called the &#8220;residual&#8221;).  Check out this picture &#8211; its a verrrrrrrrry basic representation of what is going on here:</p>
<p style="text-align: center;"><a href="http://thestudiofiles.com/wp-content/uploads/2008/11/flac-demonstration.png"><img class="size-medium wp-image-391 aligncenter" title="flac-demonstration" src="http://thestudiofiles.com/wp-content/uploads/2008/11/flac-demonstration.png" alt="A simple model of how FLAC works" width="427" height="506" /></a></p>
<p style="text-align: left;">Now, remember that digital audio is a very finite thing.  At every given sample point, there are only so many different positions (within the bit depth) that the sample can be at.  This is essential to understanding how FLAC could be lossless.  If we were dealing with a signal that did not have a finite number of points (aka, analog), this would not work.  It could be close, but not completely lossless.  By having a mathematical representation of a frame (plus the residual encoding), <strong>FLAC can shrink the file size down usually around 30-50% (but more in some circumstances).</strong></p>
<p style="text-align: left;">When I was first delving into FLAC, I thought &#8220;well&#8230; how can a compression format that is lossless have different levels of compression???  It must not be lossless&#8230;&#8221;</p>
<p style="text-align: left;">It has to do with CPU cycles.  When compressing FLAC as much as possible (say you are going for 50% size reduction), the computer will spend much longer trying to predict what the waveform is doing.  By getting a more accurate prediction up front, there will be much less residual data to encode.  So, the trade-off for a smaller file size is a longer encoding time (and be aware that I have not been able to find a FLAC encoder that can access more than one core of a processor).</p>
<p style="text-align: left;">That being said, we are only talking a few seconds here.  Where an mp3 may encode in 5 seconds, a fairly high compression FLAC might take 25 seconds.  <a href="http://thestudiofiles.com/?p=376">If you read Part 4</a>, you will have read the introduction to why open source compression formats aren&#8217;t amazingly popular right now&#8230;  If you google FLAC, you can find a slew of information on encoders, decoders, players, plug-ins&#8230; etc.  With newer iPods, I&#8217;ve heard there&#8217;s even a mod you can do to get FLACs to play (although not on the old ones, the processor requirement is too high) &#8211; careful though, I&#8217;d bet this is not within any limitations of the warranty or user agreement&#8230;</p>
<p style="text-align: left;">So what the heck is FLAC useful for?  My first thought would be for archiving mix/mastering files.  With 50% reductions on the files, all of a sudden you have to buy half as many backup drives.  It&#8217;s also useful for sending high quality audio to clients over the internet with less bandwidth (assuming they also know how to procure a FLAC player)</p>
<p style="text-align: left;">Hopefully we will see FLAC grow in popularity in the near future!  More to come soon on these compression formats&#8230;</p>
<p style="text-align: left;">C</p>
<p style="text-align: left;">The Studio Files</p>
<p style="text-align: left;">
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://thestudiofiles.com/?feed=rss2&#038;p=387</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Everything about File Compression: Take 4</title>
		<link>http://thestudiofiles.com/?p=376</link>
		<comments>http://thestudiofiles.com/?p=376#comments</comments>
		<pubDate>Wed, 19 Nov 2008 02:21:42 +0000</pubDate>
		<dc:creator><![CDATA[ConnorSmith]]></dc:creator>
				<category><![CDATA[Chit Chat]]></category>
		<category><![CDATA[File Compression]]></category>
		<category><![CDATA[Project Studio]]></category>
		<category><![CDATA[codec]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[distortion]]></category>
		<category><![CDATA[encode]]></category>
		<category><![CDATA[ogg]]></category>
		<category><![CDATA[ogg vorbis]]></category>
		<category><![CDATA[quantizer]]></category>
		<category><![CDATA[vorbis]]></category>

		<guid isPermaLink="false">http://thestudiofiles.com/?p=376</guid>
		<description><![CDATA[Ogg Vorbis? Definitely wins the award for the weirdest name among digital audio compression formats.  However, Ogg Vorbis is arguably one of the best sounding and easiest to access of the bunch (it&#8217;s open source, aka FREE) Again, this article assumes you&#8217;ve read Take 1, Take 2, Take 3, and hopefully also VBR. &#8220;Vorbis&#8221; is [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Ogg Vorbis?</p>
<p>Definitely wins the award for the weirdest name among digital audio compression formats.  However, Ogg Vorbis is arguably one of the best sounding and easiest to access of the bunch (it&#8217;s open source, aka FREE)<span id="more-376"></span></p>
<p>Again, this article assumes you&#8217;ve read <a title="Perceptual/Psychoacoustic encoders explained" href="http://thestudiofiles.com/?p=344">Take 1</a>, <a title="MP3 encoder explained" href="http://thestudiofiles.com/?p=348">Take 2</a>, <a title="AAC encoder explained" href="http://thestudiofiles.com/?p=355">Take 3</a>, and hopefully also <a title="Variable Bit Rate VBR explained" href="http://thestudiofiles.com/?p=357">VBR</a>.</p>
<p>&#8220;Vorbis&#8221; is actually the audio compression codec.  It was developed as an open source (lossy) compression codec as a substitute for mp3.  &#8220;Ogg&#8221; is simply the file container in which the Vorbis is held, thus &#8220;Ogg Vorbis&#8221;.  (Its worthy to note that you can hold lots of other things in Ogg containers, including FLAC).</p>
<p>So what&#8217;s different about Vorbis?  For one, its open source.  That means there are no licensing costs associated with using it.  Unfortunately, since people aren&#8217;t making millions of dollars off it, the effort to significantly popularize (or even standardize) the format is a hard sell.  MP3 and AAC are very much market-driven formats (i.e. iTunes uses AAC).  Since companies and individuals have incentive to make large amounts of money off of their codecs, its no wonder that MP3 and AAC are overwhelmingly more widely used than Vorbis.  That being said, it is good to know that Vorbis sounds really good at equivalent bit rates, AND its free.  (So although you&#8217;d be in the minority, if you are using Ogg Vorbis, you have something that sounds better* and costs nothing to license).</p>
<p>It&#8217;s also worth noting that if Vorbis were licensed and AAC open source, we&#8217;d likely be saying the same sort of things the other way &#8217;round&#8230; this is really just an open discussion.</p>
<p>So, other than being free, what&#8217;s good to know about how Ogg Vorbis works?</p>
<p>Vorbis, like AAC, uses an MDCT to begin to break the digital audio into small pieces, and put them through the frequency-analysis process.  Vorbis uses its own psychoacoustic model (which theoretically is better than its predecessors).  Of course, the implication here is that if the psychoacoustic model is &#8220;better&#8221; than AAC and MP3, it will be getting better sounding results at the same bit rates.</p>
<p>Vorbis is different too in that it is always variable bit rate. <a title="Variable Bit Rate VBR explained" href="http://thestudiofiles.com/?p=357">(Click here to revisit the article on VBR encoding) </a>While this will yield more pleasing sonic results for Vorbis, it can make it more difficult to compare MP3 and AAC encoders to Vorbis objectively (as some are not VBR).  Now for the big difference&#8230;. drum roll please&#8230;.</p>
<p>Vorbis is different in its &#8220;failure mode&#8221;.  Here, I am using &#8220;failure&#8221; to describe what happens with the encoder doesn&#8217;t have enough available bits to get the good audio encoded above the distortion.  <em>Remember, the encoder is inevitably going to have to deal with noise from things like quantization distortion, and ideally, all of that will be below the masking threshold (aka, we won&#8217;t hear the bad stuff because the good stuff is loud and covers it up)</em>.  When, let&#8217;s say, and MP3 encoder fails, the distortion gets loud, you may hear metallic swirlies (also called birdies, think &#8220;youtube audio&#8221;), other non harmonic distortion&#8230;</p>
<p><a href="http://thestudiofiles.com/wp-content/uploads/2008/11/birdie.jpg"><img class="aligncenter size-medium wp-image-377" title="birdie" src="http://thestudiofiles.com/wp-content/uploads/2008/11/birdie.jpg" alt="" width="109" height="169" /></a></p>
<p><img src="file:///Users/connorksmith/Desktop/Digital-Audio-Compression/images/birdie.jpg" alt="" /></p>
<p>But! When Ogg Vorbis fails, something entirely different can happen.  When the audio is initially going through the filterbank in Vorbis, the encoder separates the noise floor from the audio.  When the encoder would fail, the noise floor is raised.  This gives a much softer (almost analog-noise-like) distortion, rather than birdies and harsh distortions.  So, between an improved psychoacoustic model, the inherent VBR, and the nicer-sounding failure mode, Ogg Vorbis seems like a great choice.</p>
<p>Again, problems with Ogg Vorbis mainly stem from the fact that it is not a market driven format.  There are many plug-ins and stand alone players that will read and encode/decode Ogg Vorbis files, but they are not nearly as numerous as those of MP3 and AAC files.  Most portable music players won&#8217;t directly play Vorbis files without some software tweaking.</p>
<p>FLAC is next!</p>
<p>Also coming soon are flipped polarity examples of these encoders with the original files (so you can hear the failure modes, and other &#8220;yuck&#8221; left over/added from compression conversion)</p>
<p>C</p>
<p>The Studio Files</p>
]]></content:encoded>
			<wfw:commentRss>http://thestudiofiles.com/?feed=rss2&#038;p=376</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Everything about File Compression: Take 3</title>
		<link>http://thestudiofiles.com/?p=355</link>
		<comments>http://thestudiofiles.com/?p=355#comments</comments>
		<pubDate>Tue, 18 Nov 2008 06:20:36 +0000</pubDate>
		<dc:creator><![CDATA[ConnorSmith]]></dc:creator>
				<category><![CDATA[Chit Chat]]></category>
		<category><![CDATA[File Compression]]></category>
		<category><![CDATA[Project Studio]]></category>
		<category><![CDATA[aac]]></category>
		<category><![CDATA[bits]]></category>
		<category><![CDATA[compress]]></category>
		<category><![CDATA[encode]]></category>
		<category><![CDATA[encoder]]></category>
		<category><![CDATA[kbps]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://thestudiofiles.com/?p=355</guid>
		<description><![CDATA[AAC &#8230;which, although commonly referred to as &#8220;Apple Audio Codec&#8221;, this actually stands for Advanced Audio Coding. (This article assumes you have read Everything About Compression: Take 2) Although originally coming out of MPEG-2 specification, AAC is known as Part 3 of MPEG-4. AAC was designed as a newer, &#8220;better&#8221; sounding alternative to MP3. Generally, [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>AAC</p>
<p>&#8230;which, although commonly referred to as &#8220;Apple Audio Codec&#8221;, this actually stands for Advanced Audio Coding.<span id="more-355"></span></p>
<p>(This article assumes you have read <a title="MP3 Explained" href="http://thestudiofiles.com/?p=348">Everything About Compression: Take 2</a>)</p>
<p>Although originally coming out of MPEG-2 specification, AAC is known as Part 3 of MPEG-4.  AAC was designed as a newer, &#8220;better&#8221; sounding alternative to MP3.  Generally, the AAC encoder follows the same steps as the MP3 encoder, but let&#8217;s take a look at what makes the two formats so different.</p>
<p>First off, the filterbank (used to &#8220;chop up&#8221; the original audio file and determine the frequency content) in the AAC encoder is not a hybrid filter like the mp3 (which uses both an FFT and and an MDCT).  The AAC encoder just uses an MDCT (the most important thing to note here is that an MDCT will typically overlap its bands of analysis, thus reducing any errors that might come at the &#8220;edge&#8221; points between blocks).  AAC&#8217;s MDCT also has greater resolution than MP3&#8242;s (1024 vs. 576). AAC can also switch its block size (the length of the audio pieces it is analyzing).</p>
<p>The AAC also has a superior psychoacoustic model.  The model was developed later (and likely spun from the MP3 original research).  Presumably, the encoder with a more accurate perceptual model will be able to achieve better quality at lower bit-rates (kbps).  The perceptual model is arguably the most important element in an encoder, so AAC&#8217;s improved psychoacoustic model is the most prominent reason why AAC sounds better at identical bit rates to mp3.  <em>(Note: &#8220;better&#8221; is obviously very subjective an open to debate.  This is speaking rather theoretically)</em></p>
<p>Finally, AAC also has some additional tools which can help with efficiency, including Temporal Noise Shaping (TNS) and a Prediction stage.  The inner processes of TNS are a little beyond the scope of this entry&#8230; but basically its a type of noise shaping and prediction that was originally implemented to help improve the sound of speech at lower bit rates.  It helps with the efficiency and quality of the encoding.  The prediction stage is not always used, as it is most useful in signals that are easily predictable (sine tones or tone-like soures).</p>
<p>Phew&#8230; enough of the technical jumble&#8230;</p>
<p>Oh, I should also mention that most AAC encoders will have the option to encode with variable bit-rate (which I went into <a title="Variable Bit Rate Explained" href="http://thestudiofiles.com/?p=357">in the VBR Explained Article</a>).</p>
<p>So that&#8217;s AAC&#8230;</p>
<p>C</p>
<p>The Studio Files</p>
]]></content:encoded>
			<wfw:commentRss>http://thestudiofiles.com/?feed=rss2&#038;p=355</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Variable Bit Rate Explained (a side note)</title>
		<link>http://thestudiofiles.com/?p=357</link>
		<comments>http://thestudiofiles.com/?p=357#comments</comments>
		<pubDate>Tue, 18 Nov 2008 00:28:46 +0000</pubDate>
		<dc:creator><![CDATA[ConnorSmith]]></dc:creator>
				<category><![CDATA[Chit Chat]]></category>
		<category><![CDATA[File Compression]]></category>
		<category><![CDATA[Project Studio]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[encoder]]></category>
		<category><![CDATA[kbps]]></category>
		<category><![CDATA[variable bit rate]]></category>
		<category><![CDATA[vbr]]></category>

		<guid isPermaLink="false">http://thestudiofiles.com/?p=357</guid>
		<description><![CDATA[So, what is variable bit rate (or VBR)? This is a tangent from the compression articles. I thought I should explain VBR. Normally, when encoding a compressed audio files (let&#8217;s say, an MP3), you need to specify a bit rate in KBPS (kilobits per second). This tells the encoder how many bits it has to [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>So, what is variable bit rate (or VBR)?</p>
<p>This is a tangent from the compression articles.  I thought I should explain VBR.<span id="more-357"></span></p>
<p>Normally, when encoding a compressed audio files (let&#8217;s say, an MP3), you need to specify a bit rate in KBPS (kilobits per second).  This tells the encoder how many bits it has to work with over the given time period.  (See <a href="http://thestudiofiles.com/?p=348">Everything About Compression: Take 2</a> for info on what the encoder is doing)</p>
<p>But, what if a REALLY complicated second of audio is followed by a really simple second (say a second of metal mathcore followed by a 1k sine wave).  In this case, the encoder would struggle to fit all the metal into the allocated bits, but would probably have a lot of wiggle room with the sine wave encoding.</p>
<p>Well, a VBR encoder would realize this, and vary the bit rate for that section.  It would allocate more bits to the second of complex signal (the mathcore), leaving less (but more than sufficient) bits available for the sine wave encoding.</p>
<p>To relate it to real life&#8230;  You ate a sandwich (on wheat bread) that had 300 calories.  Now, you have two things on your &#8220;to do&#8221; list:</p>
<p>1) Stand up</p>
<p>2) Do 9007 jumping jacks</p>
<p>If you were not a Variable Bit Rate encoded person, you would allocate 150 calories for standing up and 150 calories for doing 9007 jumping jacks.  What&#8217;s going to happen?  Standing up is no problem, but sometime after you start jumping jacks, you are going to fail.  When the compression encoder &#8220;fails&#8221;, it does things like not giving enough bits to the audio signal to raise it above the (quantization-induced) noise floor, thus audible distortion.</p>
<p>If you were a VBR encoded person, you could allocate 1 calorie to standing up, and 299 to jumping jacks, thus giving yourself almost twice the chance of finishing them.</p>
<p>A rather ridiculous example&#8230; but hopefully it gets the point across.</p>
<p>C</p>
<p>The Studio Files</p>
]]></content:encoded>
			<wfw:commentRss>http://thestudiofiles.com/?feed=rss2&#038;p=357</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Everything about File Compression: Take 2</title>
		<link>http://thestudiofiles.com/?p=348</link>
		<comments>http://thestudiofiles.com/?p=348#comments</comments>
		<pubDate>Mon, 17 Nov 2008 21:56:00 +0000</pubDate>
		<dc:creator><![CDATA[ConnorSmith]]></dc:creator>
				<category><![CDATA[Chit Chat]]></category>
		<category><![CDATA[File Compression]]></category>
		<category><![CDATA[Project Studio]]></category>
		<category><![CDATA[bits]]></category>
		<category><![CDATA[codec]]></category>
		<category><![CDATA[compresion]]></category>
		<category><![CDATA[compress]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[decoder]]></category>
		<category><![CDATA[encode]]></category>
		<category><![CDATA[encoder]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[perceptual]]></category>
		<category><![CDATA[psychoacoustic]]></category>
		<category><![CDATA[quantize]]></category>

		<guid isPermaLink="false">http://thestudiofiles.com/?p=348</guid>
		<description><![CDATA[MP3 Loved by many, despised by some&#8230;  regardless of where you stand, mp3 is hugely important in the proliferation of internet music.  It is the original method of delivering compressed audio (mainly over the internet). What does MP3 stand for? How does it compress?  Why is it &#8220;good&#8221;? Why is it &#8220;bad&#8221;?  Let&#8217;s dive in&#8230; [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>MP3</p>
<p>Loved by many, despised by some&#8230;  regardless of where you stand, mp3 is hugely important in the proliferation of internet music.  It is the original method of delivering compressed audio (mainly over the internet).</p>
<p>What does MP3 stand for? How does it compress?  Why is it &#8220;good&#8221;? Why is it &#8220;bad&#8221;?  Let&#8217;s dive in&#8230;<span id="more-348"></span></p>
<p>MP3 actually stands for &#8220;MPEG-1 Audio Layer 3&#8243;. MPEG-1 was originally developed as a lossy compression standard for audio and video, and layer 3 (of the 5 total) is for audio compression.</p>
<p>So I started hinting at psychoacoustic modeling (aka perceptual modeling) in the last post.  In these encoders, these are essentially digital representations of how our (human) hearing system works.  Through rigorous and complicated testing, this model is formed to predict particularly how the hearing system is going to react to sounds.  What the model is mainly interested in is what parts of any given sound signal are going to be masked, both in the time and frequency domains.</p>
<p>I gave an exaggerated quasi-frequency based masking example in the last article, here&#8217;s a time based:  Suppose Jim is the fastest drummer in the world.  He can play a flam so quickly on his imaginary drum that the transients of the two hits are .00000001 seconds apart.  As humans, we probably aren&#8217;t going to be able to hear this as two separate hits (like a flam, as Jim originally intended to play).  The mp3 encoder might choose to just squish those two transients together.</p>
<p><em>**Note, this is just a rather-ridiculous example.  It assumes that both hits ring out independently, there is no comb filtering as a result of the addition, and that our sampling frequency is high enough to capture the difference in the first place (DSD anyone?), etc&#8230;</em></p>
<p>So here is a basic explanation of what is happening in the encoder.  Let&#8217;s pretend we have a 3 minute rendition of HAPPY BIRTHDAY as a WAV, and you want to compress it to a 128 kbps (kilo-bits per second) :</p>
<p>1) The uncompressed audio is broken up, both in the time and frequency domain, using a combination of FFT and MDCT filterbanks.  Simply put, the encoder breaks the original audio signal into very small blocks and analyzes the frequency content of each block.</p>
<p>2) At the same time, the encoder begins to examine the audio with the psychoacoustic model.  Here it starts to examine which parts of the audio will be masked by our hearing system.  This information is analyzed and fed with the MDCT&#8217;d audio (from step 1) into a quantizer.</p>
<p>3) The quantizer&#8217;s job is essentially to assign bits of data to all the information.  Since we chose 128 KBPS at the start of this process, the quantizer knows it has 128,000 bits available to assign for each second of audio.  With the information from the psychoacoustic model, the quantizer will know to give many less bits to parts of the sound that we can&#8217;t hear, and the majority of the bits to things that we will hear.  However, problems can arise if the encoder runs out of bits (in this case, if it uses up all 128,000 bits in a second and still has data to encode).</p>
<p>When this happens, something needs to happen. One option is to encode things with yet lower bit depths (or the amount of bits used for each sample).  Unfortunately, this may lead to more quantization distortion, inaccurate signal representation, errors in the time domain, other non-harmonic distortion&#8230; more bad things.  Another common thing to do is de-emphasize high frequencies.  If the encoder doesn&#8217;t have to worry about any frequencies, say, above 12 kHz, that frees up a lot of bits (in the process, destroying the high end of the source material).  Drag an mp3 into a DAW and run it through a spectral analyzer.  The lower the KBPS, the lower the cutoff for the high frequencies will be.</p>
<p>Some of this problem can be solved by using variable-bit-rate (or VBR) options in the encoders.  We&#8217;ll get to that in the next article perhaps.</p>
<p>4) Now quantized into a nice array of 1&#8242;s and 0&#8242;s, the encoder attaches metadata and other tags on the frames and assembles it into a nice mp3 package.  Once here, an mp3 decoder could quickly and easily decode an mp3 into audio.</p>
<p>Again, I apologize if that got more technical that necessary.  Here it is in sum:  <em>The encoder breaks the original file into small pieces and analyzes the frequency content.  A perceptual model of how humans hear tells the encoder what parts of the original signal are unnecessary (or less important).  The encoder assigns bits to the data based on the model, giving less bits to things that we shouldn&#8217;t hear.  Then the encoder packs it up, labeling things so that the decoder can recognize and play the file.</em></p>
<p>Soon, we&#8217;ll get into explanations of the other encoders (most of which are fairly similar to mp3), problems with the encoders, etc&#8230;</p>
<p>If anyone is seeking deeper technical explanation of these processes, be sure to let me know in the comments.</p>
<p>C</p>
<p>The Studio Files</p>
]]></content:encoded>
			<wfw:commentRss>http://thestudiofiles.com/?feed=rss2&#038;p=348</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Everything about File Compression: Take 1</title>
		<link>http://thestudiofiles.com/?p=344</link>
		<comments>http://thestudiofiles.com/?p=344#comments</comments>
		<pubDate>Fri, 14 Nov 2008 04:21:17 +0000</pubDate>
		<dc:creator><![CDATA[ConnorSmith]]></dc:creator>
				<category><![CDATA[Chit Chat]]></category>
		<category><![CDATA[File Compression]]></category>
		<category><![CDATA[Project Studio]]></category>
		<category><![CDATA[aac]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[encoder]]></category>
		<category><![CDATA[kbps]]></category>
		<category><![CDATA[lossy]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[ogg]]></category>
		<category><![CDATA[vorbis]]></category>

		<guid isPermaLink="false">http://thestudiofiles.com/?p=344</guid>
		<description><![CDATA[(as a side note, sorry for the lack of my posts lately, grad school is getting the better of my time&#8230;) Ah&#8230;. the internet.  One of the greatest inventions of our time, not only for information technology&#8230; but also for (you guessed it) the audio industry! The internet has allowed us to turn the music [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>(as a side note, sorry for the lack of my posts lately, grad school is getting the better of my time&#8230;)</p>
<p>Ah&#8230;. the internet.  One of the greatest inventions of our time, not only for information technology&#8230; but also for (you guessed it) the audio industry!</p>
<p>The internet has allowed us to turn the music market upside-down.  With CD sales on the fall and internet music on the rise, a substantial need for good-sounding compression formats has arisen.  But how do these compression codecs actually do what they do?  Why do some sound better than others?  Why do some sound like&#8230; well&#8230; bad?  We&#8217;ll explore this over the series of articles.<span id="more-344"></span></p>
<p>Most of the common compression formats you will see online (mp3, AAC&#8230;) are lossy codecs.  That means, once compressed, data has been lost.  Once you convert your uncompressed (WAV, AIFF) file down to mp3, you can never convert it back without loss of bits (and therefore quality).</p>
<p>I will get deeper into these concepts in the articles following this one, but its good to know that many of these lossy encoders are using a psychoacoustic model of human hearing to predict what elements of the signal may be masked by our hearing system <em>(usually the masking occurs as a result of critical bands on the <a href="http://en.wikipedia.org/wiki/Basilar_membrane">basilar membrane&#8230;</a> I guess I should give an introduction to the human hearing system as well&#8230; noted)</em>.  If part of the signal of the original file will likely be masked by our hearing system, then technically, the encoder could lower the volume (speaking in bits) of the masked sound without a difference in the final sound.</p>
<p>Sorry, getting into some wooly passages. I&#8217;ll try to simplify with an exaggerated example:</p>
<p>Imagine you have a tune where a 170&#8242; diameter gong gets smashed by the back end of Paul Bunyan&#8217;s axe (of course, by Paul himself).  Right after the initial attack of the gong, someone lightly clangs some finger cymbals.  Yes, some of the high frequency information from the finger cymbals may get picked up by a mic in the room, but it will be overwhelmingly covered by the sound of the massive gong.  The encoder (based on psychoacoustic modeling) knows this and can lower the number of bits it is using to encode the sound of the finger cymbal.</p>
<p>So, in a simple summation, the goal of the lossy compression encoders is to predict which sounds we won&#8217;t hear, and make them quieter (less bits).</p>
<p>In the next few articles, I&#8217;ll get into mp3, AAC, Ogg Vorbis (maybe a few others)&#8230; and then&#8230; FLAC! (which is a lossless audio compression format)</p>
<p>That&#8217;s all for now&#8230;</p>
<p>C</p>
<p>The Studio Files</p>
]]></content:encoded>
			<wfw:commentRss>http://thestudiofiles.com/?feed=rss2&#038;p=344</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
