The progenitor of widespread digital audio is the compact disc. The CD works by assembling collections of data points on sound waves to replicate their motion—exactly 44,100 samples per second. If you picture a sound wave as it rises and falls, the recorded numbers represent its shape. Two streams of samples (for stereo sound) are written to the metal in winding grooves in the form of microscopic pits, which CD players read by shining a laser along the spiral. When the laser is fired at the reflective surface, the presence of a pit will cause a change in the light that shines, which a sensor in the player detects. This is an example of binary data: ones and zeroes, on and off. Even today, the CD is still used as a distribution method and a standard specification that non-physical distributions use as a basis.
Common digital audio formats, such as MP3 (a longtime mainstay) and AAC (used by iTunes and YouTube; sometimes called "MP4", the name of its container format, or "M4A", one of its common file extensions) take the process of digital audio distribution started by CDs a step further. The data from a CD can be extracted in the form of a wave file containing the information read from the disc. These files are by nature large due to the fact that they contain data at 44,100 Hz. To save space, these formats employ lossy audio compression—they keep only some of the data points to save space, sacrificing the quality of the recording by discarding the other data.
Here are two examples of a spectrogram, a representation of the data found in audio files in a visual format. The first is a song copied directly from a CD without any compression:
The second is the same song after being processed as an MP3 at VBR level 6:
You can see how the upper frequencies (higher pitches) have been discarded by the algorithm that converted the song to an MP3. MP3 and AAC are "smart" formats: they choose which data points to remove in context of humans' biological sound perception. In other words, lossy audio will trim parts of the recording that you may not be able to hear, especially with low-end sound equipment like earphones. Above a certain threshold, the casual listener is not able to detect the damage. However, in my own experience it is noticeable if you pay attention to all the metal components of drum sets: their frequencies shoot high enough to be affected severely by the lossy encoding process, giving them a distinctive crackly timbre. Furthermore, online media distribution websites like YouTube frequently overdrive the audio compression settings so that damage is easily detectable.
Lossy damage is compounded when you encode audio already in a lossy format to another lossy format. This is why I facepalm at all the "YouTube MP3 Converters" which take an already strained audio file and convert it, when you could simply extract the AAC stream from the video and use that if you are so desperate as to want a steeply compressed music file.
My personal format of choice is FLAC: the Free Lossless Audio Codec. Unlike the lossy audio compression found in the MP3 and AAC formats, FLAC attempts to save space without throwing away any data: lossless audio compression. A spectrogram of a FLAC file would be identical to its parent wave file, with the tradeoff of a file size several times larger than an MP3 (but still 50-70% of the uncompressed wave size). Of course, converting music you already have in a lossy format into FLAC does not magically restore the lost data. For an audio file to be truly lossless, it must be acquired from the source without a lossy link in the chain. Strictly legally, that means either using one of the minority internet music sales sites that deal in lossless music, or extracting the data from your own CDs yourself. Acquiring lossless music, especially CD ripping, could be a blog post of its own.
The measures of psychoacoustics that lossy audio formats use are designed to fare well in one-off double blind tests. If you maintain a collection of music that you listen to frequently, over time you can notice the subtle changes made by lossy algorithms. That is one reason why over 90% of my collection is lossless.
The unfortunate thing is that most consumers don't know and/or don't care, so most commonly-available software and hardware do not include support for FLAC. The worst offender is Apple, whose line of iPod/iPhone/iPad hardware at best supports their own inferior lossless format. However, the real shame is that the wildly successful iTunes service only sells lossy audio files. As much as a trendsetter as their rampant popularity would indicate they are, the company (especially Steve Jobs) is not worthy of the idolization that they receive. But that's another blog post of its own.
Because I find deeply entrenched fault with iTunes, I wrote my own computer program to organize my music. For music on the go, I use a Sansa Fuze+, having modified it to use a custom community-developed operating system called Rockbox. Thankfully, Google's Android operating system supports FLAC natively, so in the future when I finally jump on the smartphone bandwagon, I will be well equipped.
No comments:
Post a Comment