• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 4. Playlists, Tags, and Skins: M... > Equalization and Sound Quality

4.2. Equalization and Sound Quality

While true audiophiles may never accept lossy compression formats as a home standard just for the convenience factor, most of us do place a very high priority on the many conveniences offered by the MP3 format. So we're left with a question: How do we make sure we're getting the most from our MP3 collections?

4.2.1. Can Quality Be Measured?

Before even thinking about evaluating standards of quality, it's critical to understand that "this way lies madness." Audiophiles have wrestled for decades to achieve "objective" measurements that would fairly represent the quality of a recording. And while there are many objective measurements that can be made for any given signal, it's important to understand that the mathematics of audio measurement and the subjective experience of quality are two different animals. Furthermore, the mechanics of lossy compression (discussed in Chapter 2) more or less nullify the validity of just about any objective criteria. In other words, the only tests that matter for MP3 audio are subjective tests, i.e., real-world listening tests. Your ears don't lie. Even so, it's possible that the file you encode to your own standards today could end up being played on much better equipment tomorrow, so it pays to shoot for quality a little above your own thresholds.

The most important thing to keep in mind when testing for MP3 quality is that your computer probably isn't the best place to do it. How's that? Unless you've invested a fair sum in high-end computer audio equipment, chances are that your home stereo sounds a lot better than your computer. And if you're planning to keep your MP3 collection around for a long time, your home stereo may very well be the ultimate destination for your MP3 files. Because your sound card and computer speakers may mask a whole lot of subtlety, it's important to eliminate those components from the testing chain so that you can tell which limitations are introduced by your hardware and which are introduced by the MP3 encoding itself. In other words, you want to isolate the encoding as much as possible and give it an optimum environment in which to be tested. Conducting listening tests

Since "CD quality" is our benchmark here, you want to get your MP3s onto an audio CD. To run this test, you'll need access either to a CD burner or to a dedicated MP3 playback device. Find a couple of songs with which you're well-familiar, preferably ones that include a wide range of instruments, including those from the brass and strings families. It's often easier to detect limitations in the MP3 codec with non-electronic music, and the brass and string families do an especially good job of putting the codec to the test. However, it's also important that you choose music you enjoy personally. To be well rounded, you might want to choose one each of your favorite jazz, classical, and rock tracks, for example.

If you have a portable or home stereo MP3 player, just patch it into your stereo as described in Chapter 3, and load it up with encodings created as described in the next section. The same principles described in this section apply whether you're working from a test CD or from a dedicated playback device.

Next, you'll need to save a reference track for each song, meaning you should rip uncompressed versions of each track to your hard drive (typically in WAV format, though Mac OS users will want to use AIFF format). See Chapter 5, for details on ripping tracks directly from CD without encoding them. For the actual compression, you'll want to use the highest quality encoder you can find (again, see Chapter 5),[†] and encode each track a number of times, at different bitrates. As you encode, give each file a descriptive name, including its bitrate. For example, you might use the following scheme:

[†] The test described here can also be used to test various encoders against one another. The only difference is that you'll want to encode the reference track at the same bitrate, but with different encoders. In fact, you may want to encode at various bitrates with each encoder in your test, so you can determine whether a given encoder excels at low bitrate encodings but falls down at higher bitrates, for example.


Automating Test Encodings

If the process of encoding the same track over and over again sounds tedious, it is. Here's a script you can use under Unix/Linux or BeOS to automate the process, assuming you have the LAME encoder somewhere in your path. This should be very easy to modify to work with other encoders:


# Start a loop and encode once at each bitrate specified
for i in 64 96 128 160 192 256; do
  echo Creating "$FileName".$i.mp3
  lame -ms -b$i "$FileName".wav "$FileName".$i.mp3

If you're on a DOS/Windows machine, here's a batch file that will achieve the same effect:

Echo off
rem example
set filename=%1

if not exist %filename%.wav goto error
rem The following must go on a single line -
rem We had to wrap it to two lines for this book
for %%B in (64 96 128 160 192 256) do lame -ms -b%%B 
  %filename%.wav %filename%-%%B.mp3
goto exit
  echo File %filename%.wav does not exist
  goto exit

Whether you're running the the bash or the DOS version, save the script as a file in your system's path with a filename like "TestEnc" and then run:

TestEnc filename

assuming your input file is called filename.wav. Of course, these scripts assume that LAME can be found in your system path as well.

Once you've encoded each sample at a variety of bitrates, you'll need to translate them back to WAV format and burn the resulting tracks to an audio CD (although your burning software may take care of this conversion for you; see Chapter 5 for details). Because the filenames won't be present on the audio CD, take care to print out or write down the track numbers and the corresponding bitrates so you'll have a reference sheet later on. Once your audio CD is complete, find the highest quality stereo you can (yours or a friend's), grab your reference sheet, dim the lights, relax, and listen through the CD. While you may want to skip back and forth between the reference tracks (which will sound identical to the original CD audio tracks) and the encoded tracks later on, you should first listen to the disc all the way through. Don't be too quick to flip back and forth between tracks, as that will only lead to schizophrenia and ear fatigue. The idea is to internalize the "flavor" of the tracks relative to one another. Evenings may produce the best listening environment, as you'll likely get less ambient noise and less sensory competition from vision (assuming some darkness). If you've been listening to loud music or noises during the day, save the test for another day—your ears will already be fatigued. Self-run audio tests using your own hearing as a "benchmark" should always attempt to isolate variables and incorporate a best-case scenario, against which everything else should be measured.

If your home stereo or entertainment system includes an on-board digital-to-analog converter which offers settings for surround sound or for various room effects (concert hall, small room, etc.), it's important to disable these options and make sure your system is set on the defaults. If you use an equalizer or other audio "enhancing" device, disable it or run it flat (unless it's a "set-and-forget" processor carefully tuned to neutralize a particular room). You're testing your encodings here, not your equipment. Artificial interferences in signal flow will compromise the integrity of the test.

As you listen, take note of the most subtle sounds in the reference track, and try to determine whether those sounds are still present in the various encodings. Can you hear the clarinetist taking that breath just before his solo? The sound of the guitarist's hands gliding over her strings? What about the sense of space (soundstage expansiveness)? Can you pinpoint the location of various instruments in the recording studio as accurately with files that have gone through the MP3 process as you can with the reference track? What about dynamic range? Are you detecting certain subtleties of the high and low ranges being chopped off or smeared out? Perhaps most importantly, do the MP3 encodings have a sense of "presence?" Can you close your eyes and imagine that the performance is taking place there in your living room? Does a given encoding make the performer sound sort of "mechanical" or "electronic?" Does the performance seem to be more or less intense with any of the encodings? Do any of them do a better job of making you want to tap your foot or sing along or dance, or do any of them make you feel edgy, or bored? Do the MP3 encodings sound "hollow" or "swishy" to you? Chances are, you'll be amazed to discover just how much quality has been lost in the 128 kbps and lower encodings.

The bitrate at which you literally cannot tell the difference between the reference track and the MP3 encoding is the bitrate at which you should start encoding your MP3 tracks, provided you're willing to part with the extra disk space this will consume (of course, if you'll be burning a lot of tracks to writeable CD for permanent storage, this may be less of an issue). To be really safe, and to make sure your tracks will sound great no matter what playback system they end up on one day, encode at a bitrate higher than the one at which you couldn't tell a difference.

If you don't have access to a CD burner, then your next best bet is to connect your sound card's line-out jack to one of your home stereo's inputs, and try similar tests. However, keep in mind that unless you use a fully digital transfer system (i.e., using digital coax or optical cable from the sound card to your digital receiver or external DAC), you'll be hearing the limitations of your sound card's digital-to-analog converter.

Audio Test Checklist

To set up a test like this in a hurry (actually, it's best not to hurry when doing things like this), remember these simple steps:

  1. Choose a reference track from your collection with which you're familiar. Look for a reference track with a wide variety of instruments and not too much density. A wall of guitar distortion is not a good choice, though you'll get mixed results with straight electric guitar under various encoders. Well-recorded acoustic guitar, vocals, strings, and brass will show you more limitations in the MP3 codec than hard rock. Rip the reference track to uncompressed WAV or AIFF format.

  2. Using the best encoder you can find, encode the reference track at a variety of bitrates, using default settings in the encoder. Alternatively, test various encoders at the same bitrate.

  3. Decode the encodings back to WAV or AIFF (see Chapter 5 for details).

  4. Burn the reference track and the decoded encodings to an audio CD. Keep a list on paper of all the tracks going onto the CD.

  5. Find the best stereo you can, relax, close your eyes, and just enjoy the music. Don't start analyzing carefully or paying special attention to subtleties and nuances until after you've relaxed into the music.

4.2.2. Digital to Analog (and Back)

As you know, computers store and manipulate information—including audio information—digitally. But your ears are analog devices, and so are speakers.[‡] Somewhere in the process of getting information out of your computer and into your ears, the signal must be converted from digital to analog. The device that affects this conversion is called the digital-to-analog converter, or DAC, and its role is crucial. The quality of the DAC plays a huge part in the overall quality of the resulting audio pouring from your speakers or headphones.

[‡] Or, at least, most of them are; completely digital PCM speakers are beginning to appear on the market.

In the case of most stock sound cards, the DAC is a part of the card's chipset. However, some higher-end sound cards offer digital outputs, which can be hooked up directly to the digital input of a digitally equipped stereo receiver or pre-amplifier. If your receiver or amplifier doesn't have digital inputs (they'll be clearly marked), you can purchase an external DAC or use the DAC built into a DAT deck, Minidisc player, or DCC, which will then sit between your computer and your receiver/pre-amp. The quality of external DACs is often directly related to their cost; a very high quality DAC can cost $1,000 or more, though you should be able to pick up a suitable model for a few hundred bucks.

In any case, by turning the job of conversion over to a dedicated unit, you can bypass the typically poor quality built-in DAC on most sound cards, and get a far better resulting sound stream out of your system.[§] When purchasing a sound card, make sure it has digital outputs in addition to the standard line out. If you're serious about quality, do some research online to find out which cards have the best on-board DACs. If you're really, really serious, consider a high-end outboard (external) DAC.

[§] Of course, the rest of your system should be of high quality before you go spending money on a DAC. Putting an external DAC in a system with poor speakers, for instance, probably won't result in noticeably better sound.

On the flipside, the reverse process—analog-to-digital conversion (ADC) may also come into play, depending on your needs. If you plan to encode music from analog sources such as tapes, LPs, or microphones, you'll also appreciate the extra input quality you'll get by making sure your source signal is stored in the computer after having passed through a high-quality ADC (either onboard or outboard), rather than the one built into your average sound card.

4.2.3. Equalization

Most GUI MP3 players include some sort of equalization mechanism, typically accessed by clicking a button on the player's interface labeled "EQ." Bringing up the equalizer usually displays a row of sliders (most often 10, though there could theoretically be any number of them). So, what exactly is equalization, and what does it get you? The simplest way to conceptualize equalization is to think of the bass and treble controls on your home stereo, and imagine that you had a separate knob for each of many much finer slices of the frequency spectrum, affording you much tighter control over the resulting output signal. Why equalize?

The point of equalization, of course, is to make the resulting audio sound better. EQ can be applied to compensate either for poorly recorded audio, for limitations in your speaker quality or design, or for the speaker placement or acoustics in the listening room. The ultimate objective of equalization is to obtain a "flat" frequency response (hence the name "equalization")—one in which the signal does not sound "colored" by the signal processing chain, storage media, or playback equipment.[‖] Equalization can also be used to eliminate audio artifacts stored in the original recording. For example, you may be able to partially correct a recording with an annoying 60Hz hum, or to partially remove some of the scratchiness of encodings taken from LPs (though the latter can be pretty tricky, since scratchiness typically crosses many different frequencies, and you don't want to throw the baby out with the bath water).

[‖] Note, however, that many recording studios use equalization to add color, not to remove it—a fact which drives some audiophiles nuts.

Despite these advanced capabilities, many (if not most) people use equalizers not so much to correct for anomalies as to boost the frequencies they like and to diminish the ones they don't. For example, hip-hop fans may want to pump up the bass frequencies, while classical listeners may want to "sweeten" the strings.

Before you go tweaking your equalizer's sliders with wild abandon, consider the equalizer as something to be experimented with gently and systematically. Listen carefully to the resulting sound after each adjustment, and pay attention to how manipulating one sub-band affects your perception of others—diminishing one sub-band can cause others to sound more prominent. Note also that if you find you have to equalize heavily to compensate for room acoustics, poor speakers, or a poor sound card, you should consider addressing these problems directly. Equalization is a band-aid, not a panacea. Be aware of the potential for over-equalization, and of the limitations of EQ principles in general:

  • Without a lot of expensive test equipment, you have no concrete goal to aim for—you're just tweaking until something in the sound "feels" better for one reason or another.

  • EQ bands come in predefined widths and slopes, but your equalization needs don't—they're typically more "fuzzy" than the usual set of EQ bands allows for (it's kind of like trying to apply mascara with a hairbrush... and no mirror).

  • Analog equalizers can introduce distortions, especially phase distortion. Digital equalizers can minimize some of these effects.

It's easy to confuse louder and brighter sound for better sound. Optimum quality is achieved when music sounds as natural as possible—equalize with an ear toward a natural sound atmosphere. Over-equalization can easily degrade sound quality. In other words, the answer to the question, "Why equalize?" is often "You shouldn't, unless the situation demands it." It's easier to ruin the sound than to improve it. Experiment with your EQ, but don't overdo it.

Artificial Audio Enhancers

Every now and then, you'll come across a product that claims to improve the quality of computer audio dramatically. Typically, these products (QSound's iQ, http://www.qsound.com, being an example) work by running a series of proprietary algorithms over the outbound audio stream and applying digital effects to the stream just before it heads for your sound card. Much like the sample effects that come with some sound card drivers, or the presets found in some home theater amplifiers, these products create the illusion that the sound stage extends out beyond the edge of your speakers, generating a 3D sound stage on the fly. These products can also take a monophonic sound stream, such as you'll typically get when listening to SHOUTcast or icecast streams, and "turn them into stereo."

Do these products work? Well, there's no question that the effects are quite dramatic, and you'll most certainly notice a difference over normal playback. But the fact is, these products are creating a signal that isn't present in the source by playing auditory tricks with channel shifting and phase relationships (bouncing sound waves against one another). What these products do is unnatural and unrealistic, and while they may make a cheap computer sound system sound more dramatic, they certainly won't bring you any closer to the artist's vision of how the music was intended to sound.

If you choose to experiment with products like iQ, keep in mind that the signal you'll be hearing is not "true." This may or may not matter to you, depending on your perspective. My position is that effects like these are best reserved for use with games, but should be disabled when listening to music. The Fletcher-Munson curve

While you should, of course, equalize as necessary to hit the sweet spot that works for a given situation, there's one commonly used configuration of which you may want to be aware: The classic "Fletcher-Munson" curve, which takes advantage of the fact that the ear is not as sensitive to low and high frequencies when music is being played at low volumes. Thus, boosting these frequencies somewhat above normal can help music to sound more natural at lower volumes (Figure 4.1).

Interestingly, the function of the loudness button on your receiver is similar; apply an Fletcher-Munson equalization curve to the music makes it sound more natural at lower volumes.

Figure 4-1. Fletcher-Munson curve, for use in low-volume situations

Note that many MP3 equalizers, such as WinAmp's, let you store equalization curves as presets, which can be loaded up again later without painstakingly re-creating them. Depending on your player, it may also be possible to store a prime equalization curve directly in the MP3 file itself, so you can optimize all of your songs' equalization curves independently. This capability is dependent on the fact that the ID3v2 specification allows for a huge array of meta-data storage capabilities in MP3 files; in other words, you must be using an ID3v2-compliant decoder capable of storing EQ presets. At this writing, this capability remained purely theoretical, though it should become a realistic possibility as the ID3v2 spec builds more momentum. See the ID3 section of this chapter for details. Working with EQ presets

Because different tracks may require different equalization curves, WinAmp lets you associate an EQ preset with any given track. Here's how to associate an EQ curve with a track:

  1. Play the track normally, and press AUTO in the EQ interface.

  2. Dial in your EQ curve.

  3. Click the Presets button and navigate to Save → Autoload Preset.

  4. Allow WinAmp to associate the current track's filename with the current EQ curve.

After creating an association between a track and an EQ curve, the association is stored by WinAmp in a file named winamp.q2 in the WinAmp installation directory (the file cannot be edited by hand). Any time AUTO is enabled in the equalizer and that track is played, the preferred EQ curve will snap into action.

Uncooking Bad Transfers

Every so often, you may end up with an MP3 file that's been corrupted during transfer somehow, usually by being transferred in ASCII mode rather than binary. If you should encounter one of these, search the Internet for uncook.exe, Uncook95, or OK Uncook, all of which do essentially the same thing—repair the damage that was done to the file during transfer and make it playable again. Linux and BeOS users may want to keep a copy of mp3asm (http://www.ozemail.com.au/~crn/mp3asm.html) around for the same purpose.

If you're using a recent browser and the web server you're accessing has been set up properly, this should never happen, though it's nice to know there are tools available to correct the situation if it does.

In most cases, the equalizers built into MP3 players will have no effect on the audio stream when playing audio CDs, since CD audio is often routed directly from the CD player to the sound card without moving through software first. In this case, the MP3 player is just used as a convenient interface onto the CD transport's control buttons. However, there are plug-ins available that will "steal" the CD audio signal and route it through the MP3 player (the NullSoft CD/Line Input plug-in for WinAmp, with the "sampling" option enabled, for example). See Section 4.5 in this chapter for details. Once the CD plug-in has been enabled, you should be able to use the equalizer and various visualizers to interact with CD audio.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint