Interleave
A compact disc does not write your music in order. It deals it out across the track like a hand of cards, so that a scratch landing in one place cannot land in one codeword. Drag a scratch below and watch the damage come apart.
New to burst errors? Start here
Damage on a disc or a wire is not spread evenly. A scratch, a fingerprint or a moment of interference destroys a run of neighbouring symbols and leaves everything else untouched.
That is the worst case for a code that can fix a few errors anywhere, because the few all land together. So the symbols are written out of order, deliberately, spread far apart. The scratch is unchanged; what changes is that it now damages one symbol from each of many codewords instead of many from one.
Bits come back wrong
A bit written to a disc, sent down a wire or held in memory sometimes comes back as the other one. A scratch, a cosmic ray, a bad connector. You cannot prevent it and you cannot ask the sender, because the sender is a scratched disc or a satellite that has already moved on.
So you send more than the message. The extra part is chosen so that a corrupted message is not a valid one, which is how a machine can notice; and if there is enough of it, chosen so that only one original could have produced what arrived, which is how a machine can repair. The machines here differ in how much extra, and in what they promise back for it.
The machine for this idea on its own is Hamming, if you would rather press it than read about it.
The disc
1 The track, as it is written
No scratch. Drag across the track.
2 De-interleaved, which is how the decoder sees it
3 C1 flags, C2 corrects
4 What reaches the speaker
- Scratch
- 0.00 mm
- Symbols destroyed
- 0
- Worst codeword
- 0 erasures
- Samples exact
- all
- Concealed
- none
- Muted
- none
Undamaged. Every sample arrives exactly as recorded.
And what it sounds like
A 440 Hz tone, 700 ms of it, with the damage above applied at its true length. A frame carries six stereo pairs, so the whole window is 288 samples: 6.53 ms, about three cycles. Nothing here is slowed down or exaggerated.
Why scattering it first is what saves it
Reed-Solomon is good at a few wrong symbols and helpless at many. The C2 codeword on a CD carries 24 data symbols and 4 of parity, and four parity symbols buy you either two errors in unknown positions or four erasures in positions somebody has already flagged.
A scratch does not produce a few wrong symbols. It produces a run of hundreds of consecutive dead ones. Written in order, that run lands inside one or two codewords and takes them out completely, and no amount of parity helps.
So the encoder deals the symbols out. Symbol i of a codeword is delayed by four frames more than symbol i − 1, so the 28 symbols of one codeword end up spread across 109 frames of track. Run that backwards at playback and a burst that was contiguous on the disc arrives at the decoder as single symbols, one per codeword, which is the case Reed-Solomon is good at.
The number that falls out of this is the interesting part. With symbols spaced four frames apart, a scratch F frames wide puts about F/4 symbols into each affected codeword. C2 tolerates four erasures. So the correctable scratch is about 16 frames wide, and the page computes what that is in millimetres from the disc's own constants rather than being told.
It comes out at 2.6 mm. The references say 2.5. Two numbers from the standard, the four-frame spacing and the four parity symbols, land within five percent of a figure that was measured on real discs, and that agreement is the point. They do not land on it exactly, and this page does not round until they do: the disc runs anywhere from 1.2 to 1.4 m/s depending on how far out the track is, so the millimetre value is a range rather than a constant.
Why there are two decoders and not one
C1 runs first, over 32-symbol words, and it is deliberately timid: it corrects one symbol and, when it sees more damage than that, refuses and flags the word instead of guessing. A wrong correction is worse than no correction, because it is silent.
Those flags are the whole point. When C2 sees a symbol that C1 flagged, it does not have to work out where the error is, only what the right value was. Locating an error costs two parity symbols; correcting a known-bad one costs one. That is why the pair together handles four bad symbols where either alone handles two.
The two codes are also read at right angles to each other. C1 runs along the frame and C2 runs across frames, so a failure that looks catastrophic to one is sparse to the other. Cross-interleaving is the name for exactly that arrangement.
And when it fails anyway
Past the correction limit the player stops pretending it has your music and starts covering for the loss. A sample it cannot recover is replaced by the average of its neighbours, which for a waveform sampled 44,100 times a second is usually inaudible. Past that it mutes, briefly, with a ramp rather than a cliff so the silence does not click.
This is the part that makes a CD feel robust rather than digital-brittle. The failure is graded: exact, then plausible, then quiet. A scratch that is far past correction still plays, and mostly still sounds like music.
These ran in this browser when the page loaded. Each claim, whether it held, and the number behind it.
| claim | held | measured |
|---|---|---|
| the correctable scratch is measured at 16 frames, which is 2.61 mm | yes | found by widening a scratch until a codeword exceeds its parity budget, then stepping back. Not typed in anywhere |
| and that is within a third of a millimetre of the Red Book's published 2.5 mm | yes | the scattering is the model; agreeing with the standard is the result, and this page would say so if it stopped agreeing |
| at the limit no codeword loses more than its 4 parity symbols, and one frame wider one does | yes | worst case 4 at the limit and 5 one past it |
| one codeword's 28 symbols are spread over 108 frames, so a scratch meets few of them | yes | a delay of 4 between adjacent symbols is the whole mechanism; without it a scratch would take them consecutively |
| un-interleaved, that same scratch would take 16 symbols of one codeword instead of at most 4 | yes | the parity budget is unchanged; only the arrangement differs |
What is real here, and what is not
The interleave is real; the Reed-Solomon arithmetic is not performed
The mapping is the real one: symbol i of a C2 codeword is delayed by 4i frames, so this page really does compute which frames a codeword's symbols land in and how many of them a given scratch destroys. What it does not do is run a GF(256) syndrome calculation. Correctability is decided by counting erasures against what four parity symbols can cover, which is the criterion a real decoder applies, but the decoding itself is not being carried out. Building an actual decoder is a different piece.
The decoder strategy shown is one of several
C1 correcting a single symbol and flagging anything worse is the conservative strategy, and it is the one most commonly described. Real players differ: some attempt two-symbol C1 correction, some carry flags differently, and manufacturers treated their strategy as a competitive matter. The code sizes are fixed by the standard; how aggressively you decode them is not.
The frame count on screen is a window, not a disc
A CD carries about 7,350 frames per second. The strip above shows a few dozen, enough to see a codeword's symbols spread out. The spacing, the codeword sizes and the arithmetic are to scale; the length of track is not.
Sources disagree about the burst limits, so both are here
The correctable burst is given as 4,000 data bits, about 2.5 mm of track, in some references and as 3,874 bits over the same 2.5 mm in others. Concealment is given as 12,000 bits and 7.5 mm in the first and 13,282 bits and 8.7 mm in the second. The millimetre figure for correction is the one they agree on, which is why the page leads with millimetres. Neither figure appears to be derived from the other and this page does not pick a winner, but the second pair is now the better documented one: it is Sony’s own, from Toshi Doi’s comparison table of 1983.
Millimetres are computed, not typed in
One frame is 588 channel bits, the channel rate is 4.3218 Mbit/s, and the disc passes the pickup at 1.2 m/s at the slow end of its range. That gives 7,350 frames per second and 0.163 mm of track per frame, which is where every millimetre figure on this page comes from. Real players run 1.2 to 1.4 m/s depending on radius, so treat the figure as the conservative end.
What you hear is synthesised, and the concealment is not
This entry used to say the page generated no audio and there was nothing to listen to. That stopped being true when the tone was added and the entry was not updated, so for a while the ledger denied a control sitting a few inches above it. An outside reader found it. What is true now: the 440 Hz tone is synthesised here and the damage is applied to it at its true length, so the two buttons really do play the same signal before and after. The concealment is still counted rather than performed, since a real player interpolates across a lost sample and this mutes it, so what you hear at heavy damage is harsher than a CD player would have sounded.
Sources
- Error Correction Zoo, cross-interleaved RS, which cites the original: L. B. Vries and K. Odaka, “CIRC — the error-correcting code for the compact disc digital audio system”, AES 1st International Conference on Digital Audio, June 1982. That paper is why this entry is dated 1982.
- US Patent 4,413,340, Odaka, Sako, Iwamoto, Doi and Vries, “Error Correctable Data Transmission Method”, 1983. The same people, describing the delay structure.
- Standard ECMA-130, 2nd edition, June 1996. The source for every number this page computes with. Annex C gives the encoders and the delay: C2 makes 28 bytes out of 24 and C1 makes 32 out of 28, four parity bytes at each step, and the second delay section is “a series of 28 delays from 0 to 27 D F1-frame times, where D equals 4”, which is the four-frame spacing. Clause 19 gives 588 Channel bits per frame, and clause 11.4 gives the scanning velocity as 1.20 to 1.40 m/s at a channel bit rate of 4.3218 Mbit/s. ECMA-130 is free to download and says of its own annex C that “This CIRC is the same as that described in IEC 908”, which is the Red Book. That is what lets this page cite a standard instead of a summary of one.
- Xuan Liu, HuiBo Jia and Cheng Ma, Error-Correction codes For Optical Disc Storage, Optical Memory National Engineering Research Center, Tsinghua University, for the first of the two burst figures: “The correct maximum fully correctable burst length of CIRC is up to 4000 bits (2.5mm).”
- K. A. Schouhamer Immink, Reed-Solomon Codes and the Compact Disc, in Wicker and Bhargava (eds.), Reed-Solomon Codes and Their Applications, John Wiley & Sons, 1999, pp. 41–59. Immink designed the modulation for the same system, and this chapter is where the first pair of burst figures traces to. Not read. It is a Wiley book chapter and no copy was reachable; the figures were taken from works that cite it, and this line exists so that the page names the origin rather than passing off a summary as the source.
- T. T. Doi, Error Correction in the Compact Disc System, presented at the 73rd Convention of the Audio Engineering Society, 1983, reprinted in Audio, April 1984, scanned here. Its Table 1 compares EIAJ, DASH and CD, and the CD row reads 3,874 bits correction, 13,282 good concealment, 15,495 marginal. That is the second pair, from an engineer on the system, published the year after it shipped. The table is a scan, not text: the figures are legible in the table image and are not in the transcribed body of the article, so an archive of the page will not contain them and a reader checking this should look at the image.