Music Banter - View Single Post - Lossy Audio Formats (mp3, ogg, m4a, etc), Quality and Comparisons
View Single Post
Old 05-24-2009, 04:51 AM   #1 (permalink)
Guybrush
Juicious Maximus III
 
Guybrush's Avatar
 
Join Date: Nov 2008
Location: Scabb Island
Posts: 6,525
Post Lossy Audio Formats (mp3, ogg, m4a, etc), Quality and Comparisons

Index
  • Introduction
  • Explained : Analog vs. Digital Recordings
  • Explained : Lossy Compression File Formats
  • Explained : Constant and variable bitrates
  • Question : Is one format better than others?
  • Question : What bitrate should I get for the best listening experience?
  • Question : Should I choose Variable Bitrate over Constant Bitrate?
  • Summary


Introduction

Most of us by far have music collections on our computer these days and most of it are in lossy formats like mp3, m4a, ogg, mpc and more. Aside from potential differences between formats, the different formats also typically come in different bitrates representing the sound quality of the file. With all this to keep in mind, some questions may arise :
  • Is one format better than the others?
  • How high bitrate do I need to get if I wanna have the best listening experience?
  • Is constant bitrate favourable over variable bitrate?

And so on. As I'm writing this intro, I don't actually know the answers to any of these questions yet, but I plan to look up sources and find out. I'll post my findings here and summarize them at the end. Before I do, let's just sort out some terms and expressions for those who don't know them.



Explained : Analog vs. Digital Recordings

An old-fashioned recording method like vinyl records sound as changes in a physical medium. Although it is an exaggeration, you can think of these formats as lossless. Conceptually, if you think of a needle scratching a vinyl surface, any sound waves will make that needle reverberate and those vibrations will be recorded in the vinyl medium. Although the representation is not exactly the same as the sound it records, it still allows for a very accurate representation of it. However, computers don't deal with physical mediums like vinyl, they deal with 1s and 0s. The "Yes or no" or "on and off" manner of which digital formats are recorded just doesn't allow for the same kind of representation that physical mediums do, therefore they are considered "lossy", meaning they lose some of the information you want to record.



Here you can see illustrated how the digital format is not able to accurately represent the soundwave that the analogue format represents. However, just like a digital picture format (like jpg) and how it's quality depends on the resolution of the picture, so you can raise the quality of a digitally recorded sound by raising it's resolution. When you look at the digital wave, everytime you see a 90 degrees bend or just a corner in the wave, that's a point where the sound has been recorded or rather - "sampled". If you drew a line between them, they would look like a wave. If you're familiar with maths, it's a bit like trying to calculate the area behind a line in a graph by the use of integration theory (squares basically), like in the graph below.



This is not a digital soundwave, however it illustrates the principle. If you want to accurately represent the area under the red wave, you can try and do so by filling the area with squares. In other words, the quality of representation depends on how many samples (squares) are recorded per time unit. This is known as the sample rate. The idea is that if you sample the sound often enough, you approximate the real "analog" sound. CD quality is 44100 samples per second (44.1KHz) and is regarded a good enough representation for practical use (although many argue still that vinyl is better, which they can be, although noise from dust and imperfect pins etc. may ruin the potential quality gain and who knows if the difference is even perceptible?).

There's also quantisation which basically means how detailed every sample is. In digital audio, quantisation involves representing the entire audible range of sound (20 Hz to 20 KHz) by a range of numbers. For example, audio CDs represent sound using a 16 bit signed number which denotes the numeric range -32768 to +32767. If we were to use a bigger range of numbers (which would require more data), then we would attain an even more precise representation of the original audio. (Thanks Seltzer!)



Explained : Lossy Compression File Formats

You can tell what the quality of your audio file is by looking at it's listed kbps, it's bitrate - or - how much information is processed when you play that file each second. A 128 kbps bitrate recording processes only half the data when played as that of a 256 kbps bitrate version of the same file. Also worth mentioning is that compressed file formats like MP3, OGG Vorbis, MPC and WMA are even more lossy than CD quality because they purposely discard all the information that we can't hear. In other words, a CD records "everything", also information you likely won't hear. Lossy file formats discard a lot of information (supposedly ~90%) to minimize file-size. How they figure out what to discard and how to do it (the "compression method") differs between file formats which means that there will be potentially audible differences between them.

Some lossy compression file formats : AAC, ADPCM, ATRAC, Dolby AC-3, MP2, MP3, Musepack, Ogg Vorbis (open source), WMA



Explained : Constant and variable bitrates

Lossy formats can either have constant bitrate, meaning they have the same quality from start to finish - or they can have variable bitrate which is an attempt to combine the best possible listening experience while preserving disk space. On a variable bitrate, the program that makes the file tries to figure out how much bitrate is needed to accurately represent the different parts of the songs it's recording. The higher frequency sounds there are and the more "complex" the sound is, the higher the bitrate needed to represent that sound becomes.



Okay, hopefully I was able to explain these things so we've got that sorted out. I'll now take a look at some sources and then post my findings below.
__________________
Something Completely Different
Guybrush is offline   Reply With Quote