Recording to CD: More than Meets the Ear
Page 1, 2, 3, 4, 5

 

EFM Encoding
Didn't your mother always tell you that "an ounce of prevention is worth a pound of cure?" It turns out your mother was right! With compact discs, as in life, the best way to avoid errors is to keep them from happening in the first place.

Because of the extremely small size and close proximity of the pits on a surface of a CD, their placement is very important to the performance of the player. When a CD plays, it uses the string of pits to keep the laser on track. That means that if there were a long stretch where there were no pits (which could happen with a long, continuous string of zeros, for example), the laser would probably get lost! This would cause tracking errors and a whole lot of bits to get missed. On the other hand, too many pits isn't good either. If there are a lot of 1-to-0 and 0-to-1 transitions in the data track, it makes the pits very small, which are hard for the laser to detect. This would make missed bits much more common, and make the parity checker have to work that much harder.

The solution is to arrange the pits in such a way so that there aren't too few, or too many, pits on any given segment of the data track. This is done with an extremely clever technique called EFM, which stands for Eight to Fourteen Modulation. In EFM, every possible 8-bit word (from 0000 0000 to 1111 1111) has a 14-bit equivalent. The 14-bit "substitute words" are chosen such that there are always more than two, but less than ten, consecutive zeros. Every 8-bit byte of data in a CD frame is converted to a 14-bit word using EFM before it is written. This ensures that the data spiral has no pits smaller than 3 bits or larger than 11 bits in length. Not too small, and not too big, but just right. This keeps the tracking mechanism running smoothly and the laser happy!

This works great for manipulating the occurrence of pit-to-land transitions within an 8-bit word. But wait... what about the transitions between EFM words themselves? What happens if you have an EFM word that ends in a "1", and the very next EFM word begins with a "1"? This breaks the "always more than two consecutive zeros" rule, and results in a pit smaller than 3 bits. This is why 3 merge bits are always inserted between EFM encoded words on the CD. These 3 merge bits can be anything, but are chosen to eliminate consecutive "1"s between EFM words and to maintain the minimum pit size of 3 bits.

Subcodes
What the heck are those "PQ" things you keep hearing about all the time? Read on, O Fearless One, and ye shall gain understanding...

Besides parity bits and EFM codes, subcode data are another type of extra information that ride along with your audio whenever a CD gets made. Every frame of CD data has an 8-bit subcode byte attached to it (which of course becomes 14-bits after EFM encoding). There are eight subcodes on a CD -- P, Q, R, S, T, U, V, and W. That means that with the 8 bits that make up a subcode byte, the first one is the P-bit, the second one is the Q-bit, the third is the R-bit, and so on. The Red Book standard only defines the P and Q bits. Subcode bits R-W are undefined under the original Red Book standard, so they're not even worth worrying about for now. (Phillips has recently been advocating a feature called "CD-Text," by which textual information is stored in the normally unused R-channel. The text can be displayed on a properly-equipped player. Most players are not equipped to read CD-Text, and simply ignore the information.)

Now, a P-bit or Q-bit all by its lonesome can't convey much information. After all, it's just one little bit! So what the CD does is to collect 98 consecutive frames together to make a sector. A sector contains 98 bits of related subcode of each type, P through W (collectively referred to as subcode channels) and 2352 bytes of encoded audio data (24 bytes * 98 frames), commonly referred to as a user data block or simply a block. One block represents 1/75 of a second of audio information. You will often see the terms "sector" and "block" used interchangably. To needlessly confuse matters further, some software manuals will refer to an CD-DA block as a PQ frame, a CD frame, or simply a frame.

The P-channel's job is simple -- to indicate where there is program material on the CD, to indicate where individual tracks start and stop, and to tell where the CD ends. All "0"s in the P-channel indicates that the current sector contains audio material. A 2-3 second section of all "1"s in the P-channel means that a track start is coming. The lead-out section at the end of the disc (where no audio is contained) is indicated by sections of all "1"s, then all "0"s, then back again, alternating every half-second.

It's really the Q-channel where most of the exciting (and complicated) stuff happens. The data contained within the 98 bits in each Q-channel will differ somewhat depending on exactly where on the disc the particular sector is located. While a precise accounting of the Q-channel subcode exceeds the scope of this article, let it suffice to say that it is here that information is stored about the number of tracks, the absolute start time of each track, the current track number, track time and length, index locations within tracks, disc catalog and UPC numbers, IRSC track information, copy-prohibit and pre-emphasis, and the like. Q-channel information that appears in the lead-in area is used by the CD player to build the TOC -- a "table of contents" which the player needs to create the familiar display you see when you insert a CD into a player, such as number of tracks, total time, and so on.

Because the documentation in CD mastering software often refers to setting track starts and indices as "PQ editing," it's often mistakenly thought that PQ information only appears at those points. Not true! It's important to understand that subcode information appears throughout the CD from beginning to end, one subcode channel per block, 75 blocks for every second of audio.

Synchronization Words
Back a little ways, during my explanation of frames, you'll recall that I told you that each frame contains a 24-bit sync word. (The actual word used is 1000 0000 0001 0000 0000 0010, in case you're really interested.) The main purpose of this sync word is to identify individual frames, and to feed information to the drive motor control circuitry. By measuring and timing the occurrences of the sync word in the data stream, the player can keep the disc spinning at the proper speed, which is crucial to making sure the rate of data flow remains constant.

Coming in Part II
I've presented a lot of information thus far, and I know it's a lot to absorb in one sitting. Please feel free to go over it a few more times if you need to. My goal here was to simplify what I realize is a rather complex subject while remaining technically accurate, and to present it in a non-intimidating manner. I hope I've succeeded in doing that!

In the next installment, I'll be taking a more nuts-and-bolts approach. We'll depart from the theoretical and delve into the practical aspects of CD recording, including hardware (computer-based and stand-alone), interface options (SCSI, IDE, USB, parallel port) and input-output issues (analog, S/PDIF, AES/EBU, and so on). We'll also get into track-at-once vs. disc-at-once recording methods, enhanced amd mixed-mode CDs, multi-session recording, fixing / finalizing a disc, and a lot more. Hope to see you then!

Back to Page 4; Back to TOP





We invite you to discuss issues or post questions on the Pro Sound World Wide Users Group