Data Compression Primer

Do you listen to MP3s? Did you know that you’re missing out? Take a few minutes and discover the basics about data compression (as used in MP3s): why it exists and what you should know about it.

Data Compression

Digital media such as audio, video, and images can sometimes be large in terms of their file size. It’s not a noticeable problem when you’re working in a studio or on a home computer to fetch these large files from the hard drive. We do it all day long without thinking twice.

But how about when you want to download several large media files? Better yet, what about when you want to download them quickly?

The common solution to this problem is that we compress a file so it contains fewer bits of information, which in essence, reduces its file size.

The question that comes up allot is “if you’re taking data away, what is that doing to the audio quality?”.

So let’s look at how it works.

Data Compression Made Easy

Here is an example to illustrate the idea behind data compression.

MP3 Conversion in iTunes

Let’s say you have an audio file on your computer and in it’s full, uncompressed state your full resolution file, “audio file x” is represented by this string of numbers: 15,999999999999.

The file is way to big to download quickly. So, you compress the data using some software, like iTunes or the MP3 Export Option that is included in the Pro Tools Music Production Toolkit2.

Compressed, the data in the original file is represented like this: 15,12[9].

They both represent the same information: fifteen followed by twelve nines. But the compressed string of data is half as long. If this were an audio file, it would be close to half the file size of the original.

You can get the Pro Tools MP3 option as a stand-alone add-on at the Digistore. Or as part of a collection of feature enhancements and plug-ins in the
Music Production Toolkit 2
at Amazon.

Decode

In order to play back the compressed audio file, software that can decode the compression scheme is required. It needs to support whatever codec was used to create the file. Codec is a blend of “coder-decoder”.

Pro Tools does not play back MP3 files so you have to convert them to the audio file format of your current session using the Import Audio dialog.

When the software decodes the compressed file to play it back, it will decode 15,12[9] back into 15,999,999,999,999 again.

Lossy vs Lossless

So far you’ve seen how a digital file can be compressed; encoded into a smaller more portable file that when decoded recreates the original file accurately.

Unfortunately there’s a catch. In an effort to create smaller and smaller files, most compression schemes (including the ubiquitous MP3 codec) are not capable of reproducing the original data again. At all.

For example, a lossy scheme might encode “audio file x” 15,999999999999

as: 15,9.

Instead of encoding the data using a compression scheme that can faithfully recreate the original data, this lossy codec has simply removed data to make the file smaller.

How does the codec choose what to chop out of your audio? That’s up to the developers of the codec. And that is why not all MP3 codecs are created equal. Some sound terrible. Some sound quite good (considering). (MP3s give me a headache by the way – anyone else experienced this?).

Benefits vs Disadvantages

Lossy Codecs

  • MP3 and AAC can encode very small files
  • Audio quality can suffer because the data compression has actually removed information

Lossless Codecs

  • ALC, FLAC, and Shorten are able to recreate the original data
  • Audio Quality is retained
  • Files are still too large to be practical as quick downloads

Lossless vs. Lossy Data Compression Schemes in iTunes 8
Compression Scheme Lossy Lossless
Original File 10.1MB
MP3 at 256kbs (iTunes Plus) 1.9MB
MP3 at 128kbs 940.5kb (less than 1MB)
Apple Lossless 9.3MB
AAC 128kbs 979.3kb

Comments

  1. Matthew Osepchook says:

    Indeed!!!