RADIFIED
Guide to Ripping & Encoding CD Audio

P
A
G
E

F
I
V
E


O
F

T
E
N

Monkey's Audio Lossless Compressor

Step 3. Let's head over to Matt's site and download Monkey's Audio. This software is subtitled: "A fast and powerful lossless audio compressor." Sure, it's fast: much faster than any lossy codec we'll ever use. But speed isn't why we're here.

Rather, it's that "lossless" part of the subtitle that most interests us. [Note that CPU speed affects/determines the speed of this compressor.]

The term "lossless" implies no loss. But no loss of what? > Audio fidelity.

Lossy codecs [such as MP3 and Musepack] generate smaller files by discarding selected bits contained in the original songs [bits it thinks you won't notice when they're gone].

Lossless codecs, on the other hand, keep *everything* .. all the audio information [bits] contained in the original song(s). Lossless codecs merely shrink the size of the original file/song by >compressing< it [usually by half].

In other words, songs compressed with lossless codecs represent exact digital clones of the originals [with regard to audio fidelity/quality]. Audiophiles should be drooling about now.

If you've ever used WinZip or WinRAR, you understand the concept behind how a lossless codec works. Suppose you compress a Microsoft Word document with WinZip. The document file [file_name.doc] will shrink to roughly half its original size when zipped [file_name.zip].

When you unZip it however, the entire document is there, right? Not a single letter is missing. Every period is present and accounted for. Lossless codecs are Zip compression specifically designed for audio files.

That's the principle behind a lossless codec. They actually operate on a much simpler basis than lossy codecs, which must make many complicated decisions, based on the particular psycho-acoustic model prgrammed into them .. regarding which bits to keep and which to discard.

Lossless codecs do one thing and one thing only: they >>crunch<< files. Lossless codecs which crunch [compress] files faster and smaller are considered better.

Note: the term psycho-acoustics refers to how the mind [psycho] interprets sound/music [acoustics]. Only lossy codecs employ psycho-acoustic models.

Each lossy codec [Fraunhofer, LAME, Audioactive, etc.] has its own idea of how to encode music so a minimum number of bits are used to represent maximum audio fidelity.

Lossless codecs don't use psycho-acoustic models. They are merely crunching machines. They don't have to agonize over which bits to discard, because they don't discard any.

Note that you can configure the EAC ripper to call and launch Monkey's Audio so it compresses CD audio straight to *.ape files directly from the CD.

Lossy Encoders vs Lossless Compressors

I try to keep my terminology straight. In other words, I refer to lossy codecs as encoders, and lossless codecs as compressors. It's a subtle difference, and one you'll see ignored by some people, who use the terms interchangably [encoder & compressor].

But lossless codecs do not "encode" per se. They merely compress [crunch]. Lossy codecs, on the other hand, do more than compress: they encode, which involves discarding selected bits deemed unnecessary.

If this distinction confuses you, forget I mentioned it. It's not important. Encoders and compressors will work no matter what nasty names you call them.

Perhaps you're familiar with digital photography. Files compressed with a lossless codec can be compared to the RAW file format, which also employs lossless compression. MP3's on the other hand can be compared to JPEGs, which offer various degrees of lossy compression.

It's a known fact that the human ear has difficulty detecting a soft note played immediately after a loud one [e.g. a quiet whisper following a loud shout]. The lossy encoder will see this and discard the bits representing soft notes immediately following loud ones.

The goal here is to generate a smaller file with [hopefully] minimal loss of audio fidelity. It's also known that humans have trouble hearing sounds above 16-KHz.

This is why lossy codecs will discard all audio information above the 16-KHz threshold when they're configured to output the smallest possible files [lowest bit-rates]. Some even set the cut off at a more-aggressive 12-KHz.

[The human voice typically falls between 1-KHz and 3-KHz. This band represents the "sweetspot" for most encoders. It shouldn't surprise you that humans hear best in this frequency range.]

Most of the time, lossy encoders makes good decisions regarding which bits of audio information to keep and which bits to discard. But not always. Certain types of music are more difficult to encode than others. [Music that contains a lot of "transients" is particularly difficult to encode.]

Music that is more difficult to encode has a greater chance of 'tricking' the encoder into making poor decisions about which bits keep/discard. This is especially true with lower bit-rate files [<128-kbps], where each bit is crucial to preserving the quality of the music.

Encoders that make better decisions regarding which bits to keep and which bits to discard are considered better [encoders]. Fine tuning an encoder [optimizing it] so it makes the best possible decisions in the greatest number of situations is a painstaking and time-consuming process.

It can take years of tweaking to fine-tune a codec, and involve large numbers of people, who participate in many discriminating listening tests, involving a variety of music types [classical, rock, metal, trance, jazz, etc.], analyzed with many different hardware configurations [different sound cards, different headphones].

This is why the LAME MP3 codec has excelled. Being an Open-Source encoder has allowed many people, from all over the world, to get involved and participate in blind listening tests. [I like to call them "taste tests".] I've participated in a few myself. You can too. All you need are good ears, a decent set of headphones and some quiet time.

The link for the results of this listening test is no longer available [42 people participated]. But they are a lot of fun and very enlightning. The process is interesting. Sophisticated statistics, employing advanced mathematical models are used to analyze the results. [Smart people conduct these tests.] It's fun to join people from all over the world.

P
A
G
E

F
I
V
E


O
F

T
E
N


There are a dozen good lossless audio codecs out there. And there isn't a whole heck of a lot of difference between any two of them. Unlike lossy codecs, lossless codecs don't vary much in their speed or out-putted file size. If they're all so similar, then why did I select Monkey's as my lossless-codec-of-choice?

[Note that songs compressed with Monkey's Audio receive a *.ape file extension: song_name.ape]

Monkey's has been around a while. At the time of this writing, Matt is working on v4.01. Compare that with FLAC [Free Lossless Audio Codec: my second-favorite choice], which is currently at v1.1.2 (released February 2005). I concede that this doesn't necessarily mean Monkey's is better than FLAC, but it's a valid point of comparison.

Sure, Monkey's compares favorably to other lossless codecs, with regard to speed and compression ratios. But what really convinced me to use Monkey's is its front end. Not all other lossless codecs come with their own front-end. The front end is the interface you use to configure the codec in order to compress and decompress your songs. Monkey's also comes with a neat tagger.

Monkey's biggest weakness is that it supports Windows-only. Obviously, this is not a problem if you use nothing but Windows. But if you only use Linux, Monkey's ain't for you. [Everybody ought to install a copy of Linux on their system (multi-boot) and familiarize themself with it. Our resident Linux guru, Magoo, prefers Ubuntu.]

If you need support for Linux, hardware or streaming, I recommend FLAC. The folks who hang out at the Hydrogen Audio forums use FLAC as their lossless codec of choice, because it allows everyone to participate in listening tests, regardless of which operating system they use.

Transparency and Archive Quality

The ideal job of a lossy encoder is what's called transparency. That's when the encoded version sounds no different from the original. Altho I've never seen a formal definition, the term archive quality usually refers to a high-quality file that contains minimal or negligible audible differences from the original file.

Whereas transparency means, "I hear no difference," Archive quality means, "I can hear a difference, but it's not a problem." Are we splitting hairs? Yes. Are we picking nits? You betcha. People get mighty serious about audio quality. Head over to the Hydrogen Audio forums and watch them pick nits. [You'll learn a lot in the process.]

Because some people have better hearing [ears] & better equipment [hardware] than others[I have good equipment, but not the best ears], transparency is defined differently by different people. Factors that affect transparency can include:

  • Ears [hearing ability]
  • Equipment [headphones, sound card, amplifier, speakers, etc.]
  • Type of music [classical, rock, jazz, trance]
  • The individual song
  • The particular encoder
  • Bit-rate

Better ears and better equipment make it more difficult to achieve transparency. The more difficult it is to achieve transparency, the more bits you'll need to use. All things being equal [same encoder, same song, same ears]: more bits = more audio information = higher bitrate = bigger files = better audio fidelity/quality.

In other words, if your hearing sux, and your speakers suk, or your headphones suk, you're not likely to notice a difference in quality between the original song and an MP3 encoded to a low bit-rate with a crappy encoder.

[Altho it's fast, the Xing MP3 encoder is generally considered the world's crappiest by those who have conducted extensive listening tests. I'm talking about the original (old) Xing encoder. The new Xing encoder (with short blocks, found in Helix mp3enc v5.1 Open Source encoder) isn't bad.]

Hearing deteriorates with age, especially the ability to hear the higher frequencies. Good audio equipment, and especially a set of good cans, is the best way to discriminate subtle nuances in audio quality. If you want to participate in some of these listening tests, a good set of headphones is a must.

FYI: I use the Sennheiser HD-580 headphones. They feel like slippers on your ears. I also use the [24-bit] CardDeluxe soundcard [made by Digital Audio Labs]. It is highly-rated at the benchmark comparison test posted here [scroll down].

I also use the baby model VLZ series Mackie mixer. [Wish I would've spent the extra money and got the next-better model: the 1402, which has sliders instead of knobs.] I have some Event studio monitors, but I don't use them to participate in listening tests.

Lossless codecs represent the holy grail of audio archiving, as far as fidelity is concerned. Files produced by a lossless codec are transparent by definition .. because there is no audible difference between a file compressed with a lossles codec and the original.

Update: I found this link where someone tried to define transparency.

Downside of Lossless Codecs

"If lossless codecs are so good," you might be wondering, "why isn't everyone using them? Why do people even bother with MP3s and lossy codecs?" Good question. The bad thing about lossless codecs is that they offer poor file-size reduction .. compared to MP3s and lossy codecs.

In other words, a song compressed with Monkey's Audio or other lossless codecs will consume more hard drive space than the same song encoded with an MP3 or other lossy codec. It will also take longer to send this same file to your friend(s) over the Internet .. which can become a major factor if you still have a dial-up connection.

Lossless codecs typically reduces file sizes to half their original bulk. The exact amount depends on a number of factors, such as the type of music and the specific song. Live music doesn't compress well because of the background noise. Each song will be different.

High-quality MP3's typically require bit-rates of 175- to 225-kbps. Let's use 200-kbps as a happy median for purposes of making a comparison. Wave files from the original CDs are 1411-kbps. This number is calculated like so: 44.1 KHz * 2 channels * 16 bits = 1411.2-kbps [or nearly 10-MBytes/min].

Note that this calculation assumes k=1000-bytes. Most computers assume k=1024 bytes. So if your actual sizes differ slightly from what you calculate, this is why. Also the "b" in kbps = "bits" [not Bytes].

A 200-kbps MP3 file is ~14% the size [about 1/7th] of the original wave file [1411-kbps]. In other words, lossless files [typically 600-900 kbps] will be roughly 3 to 4 times larger than MP3s [consuming 3 to 4 times the hard disk space], but half as large as the original wave file ripped from the CD. You should now have a good feel for the pro's and con's of how lossy codecs compare with lossless compressors.

The Trade Off

Decisions regarding encoding and compression involve balancing 3 factors:

  1. Audio fidelity/quality
  2. File size [affects hard drive space and Internet transfer time]
  3. Time [to encode/compress]

Time-to-encode/compress is typically the least important factor listed. Many audio-quality fanatics "batch-encode" overnight, while they sleep. They wake with a bunch of new MP3 on their hard drive. Overnight batch-encoding eliminates time-to-encode as a factor for consideration.

You will find that most encoding decisions boil down to a trade off between file size and audio quality. Everybody seeks maximum fidelity with minimum file sizes [bit-rate]. You should read that last sentence again, because it represents the crux of the encoding issue.

This guide [and most audio enthusiats] are more concerned with maximizing audio fidelity .. than minimizing files size [bit-rates] .. especially since hard drive space became so cheap. For example, you can purchase a 500-GB drive for ~US$275.

A 120-gig drive will store over 300 CDs encoded with lossless compression. That's ~40-cents per CD. You could even get a 750-GB drive, and prices continue to drop. The popularity of lossless compression has been growing with the hard drive capacities.

An ideal encoder would yield perfect transparency at the tiniest bit-rate possible, and it would encode very quickly. Unfortunately, such an encoder does not [yet] exist. Today, if you want quality audio, you have to pay with bits [requires more hard drive space].

All things being equal, more bits = greater audio fidelity. Only you can decide how much audio quality you want/need, and how much you're willing to pay for this quality in terms of file sizes.

All encoders are not created equal. Better encoders produce files with higher audio fidelity using less bits [lower bit-rates]. Transparency at the lowest possible bit-rate is what everyone is after. As we mentioned before, LAME is the best MP3 encoder at achieving this delicate balance. It yields files with the best audio fidelity at reasonable bit-rates.

Personally, I compress all my favorite songs with Monkey's [~1/3rd], and encode everything else with a lossy codec [~2/3rds]. If you're anything like me, you don't rip *entire* CDs. Rather, you rip only your favorite songs. This means you can typically store the songs from over 600 CDs on a single, 120-GB hard drive. [Some CDs have only a few good songs.]

Monkey's Audio vs Shorten

SatCP of The Coaster Factory has this to say about lossless compression:

As the name implies, lossless compression reduces the size of the files without any corresponding loss in quality. After decoding, you have exactly the same file as you started with.

The drawback is that the compression ratio is not very high [50-60%]. Trading groups that distribute music over the Internet almost always demand lossless compression for file distribution.

Monkey's Audio:

1. Fastest and best compression with the default settings (though compression is only slightly better than Shorten).

2. Support for ID3 tags.

Both Shorten & Monkey's are excellent lossless compressors, but Monkey's definitely wins. On the other hand, Shorten is very popular on trading lists.

When the MP3 wars rage about which encoder & arguments are best, you'll be glad to know that - no matter how good lossy encoders get - they'll never surpass the quality of lossless audio compressors.