How Compression Works



Wave files (.WAV) stored on a hard drive in a format very similar to CD audio. Wave files can have a variety of  sample rates in mono or stereo CD audio is Always 44,100 samples per second stereo. That means there are 88,200 samples recorded

This is just a brief overview of compression technology. The details require a great deal of math and programming information to explain. Not only that, I don't know the details. If you want a lot detail about the workings of Mpeg 1 Layer 3 (MP3), check the official FAQ at Fraunhofer Institute where is was developed. Compression is divided into two types, lossless and lossy. If music is compressed and then uncompressed with lossless compression, the resulting file will be exactly the same. You can test this using the DOS file compare utility or with Audiograbber (shareware version at www.hotfiles.com). I will explain how to do this at the end if you can to try.

Lossless compression can be used with any file regardless of it's content. Winzip (.ZIP) and  Shorten (.SHN) are both lossless. Winzip was designed to compress files based on 8 bit data, this works very well on programs and text files. Shorten compresses based on 16 bit data, which is how most music is recorded. Wave files can be 8 or 16 bit (and now 24 and 32), however, 8 bit is low quality and is not used much for music. Lossless compression basically removes redundant information. For example, if a long word appears many times in a document, it could be replace by a single chararter. A table at the begining of the file is created to restore the file.

Lossy compression cannot be used on programs or data files. Mpeg video (.MPG), Mpeg 1 layer 3 (.MP3) audio, Real audio / Real Video (.RM & .RAM) and Jpeg graphics (.JPG) are all lossy. Most lossy compression system allow you to control compression levels so you can choose how much quality you are willing to trade off. In general, the smaller you make the file, the more quality you will lose. In some cases, a better compression system can deliver better quality in a smaller file.  Lossy compression decides what data would be missed the least and removes it.

In the case of MP3, if there are two sounds happening at the same time, and one is much louder than the other, the quieter sound can be removed. This reduces the amount of data that must be stored. The technique is based on experiments on human hearing. Naturally the more data that has to be removed, the more noticible it becomes. Since higher frequencies require more data, they are affected more in the compression process. MP3 files have no table or header at the begining of the file. That means you can the file into parts, and each part will still play. This is important for streaming live audio.

A bitrate of 128K is considered "Near CD quality", however there is a noticible loss of quality.   The source music and quality of the decoder will have a lot to do with the quality of the compressed files. Higher quality source material can benefit for a higher bitrate. The standard for the Grateful Dead group is 256K, which is on the high end of bitrates. I have seen 320K, but the difference was probably not noticible.

If you want to see the effects of compression, you can compress then uncompress and compare the results. To compare them using Audio Grabber, start the program, click File and select compare two files. You can select the original and the re-constituted files and let it run. DOS file compare is much slower, but if you don't have Audio Grabber, it will do.

You will need to go to a DOS prompt and go to the directory (folder) that your files are in. For this example they are in a directory called mp3:

c:\windows>cd ..
c:\>cd mp3

Then run the compare utility:
c:\mp3>fc/b original.mp3  reconned.mp3

The /b is used for binary files, for text files, leave it off.
This will produce a large amount of data unless the files are very close or the same. If you want to save the data do this:

c:\mp3>fc/b original.mp3  reconned.mp3 > different.doc

Then open different.doc in any text editor.

If the compression is lossless, you should see "No differences encountered" with either compare method. Since this will list every byte that is not exactly the same, even a slight adjustment in volume will result in a huge list of diferences. Try this with a very small file.
 



Last Page   Next Page
 



 


Back Home