From: jas@proteon.com (John A. Shriver)
Newsgroups: rec.audio.high-end
Subject: Re: SPDIF jitter (and EFM)
Date: Thu, 12 Nov 92 19:57:27 EST
Organization: University of Wisconsin - Milwaukee
NNTP-Posting-Host: 129.89.7.4
Cc: paul@gaitlab1.uwaterloo.ca
Originator: tjk@csd4.csd.uwm.edu

Wrong interface!  Yes, the data ON THE CD is EFM.  However, that is
not what comes out the SPDIF output.  That is what goes into the
decoder chip, for instance a Signetics SAA7210.  

The SPDIF comes out (for example) of the DOBM pin of the SAA7220.
(This output is before the digital filter in the SAA7220.)  To quote
from the data sheet:

**********************************************************************

Digital Audio Output

The digital audio output (DOBM; Pin 14) consistes of 32-bit words
transmitted in biphase-mark code.  That is, two transitions for a
logic 1 and one for a logic 0.  The 32 bit words are arragned in
blocks of 384 words.  Table 1 shows the information contained in each
word.

The sync word is formed by a violation of the biphase rule and
therefore does not contain any data.  Its length is equivalent to 4
data bits.  The three different sync patters (B, M, and W) indicate
the following situations:

* Sync B; start of a block of 384 words, contains a left sample
(11101000)

* Sync M; word contains left sample, but not a block start (11100010)

* Sync W; word contains right sample (11100100)

In the SAA 7220, sync words are always preceded by 0.  Left and right
samples are transmitted alternately.  Audio samples are available for
digital audio output after interpolation, attenuation, and muting, but
before filtering. 

Table 1. Composition of the 32-bit Digital Audio Output Word

BIT NUMBER	DESCRIPTION	INFORMATION
1 to 4		Sync
5 to 8		Auxiliary	Not used (always zero)
9 to 28		Audio sample	Bits 9 to 12 not used (always zero)
				Bits 13 (LSB) to 28 (MSB) two's
				complement
29		Audio valid	Copy of the error flag
30		User data	Used for subcode data
31		Channel status	Indication of control bits and
				category code
32		parity bit	Even parity for all word bits
				excluding sync pattern

[...Information on the Channel Status bit subcode data skipped...]

The 32-bit words are transmitted at the sample frequency of 4.1kHz (2
X 32 X 44.1 kHz = 2.8224Mbits/s data rate).  An internal 5.6446MHz
clock (XSYS/2) is used in the biphase modulator.

**********************************************************************

OK, so I was wrong about Manchester encoding.  It's biphase-mark.   (So
shoot me!)  They are very similar codes, all of the same family.  Both
have the same characteristic of non-constant high and low periods,
allowing baseline shift to become an issue.

Here's an example of biphase encoding:

 * 1 * 1 * 0 * 0 * 1 * 0 * 1 *
-+ +-+ +-+   +---+ +-+   +-+ +-
 | | | | |   |   | | |   | | |
 +-+ +-+ +---+   +-+ +---+ +-+

The bit times are between each *, with the data values in-between.

Biphase-mark always has a clock transition at each bit transition
time.  (Note that the code violations defy this somewhat.  Not too
serious.)

The fiber optic unequal rise and fall time will also affect this
encoding.  The direction of each bit-edge transition is data
dependent.  This rises will be earlier than the falls.

As for the chip specs, only maximum rise and fall times are given for
DOBM.  They are both 20 nanoseconds.  That is about 8% of the total
bit time of 354 nanoseconds.  (Maybe I'll go measure the rise and fall
time of the SPDIF output of my Magnavox CDB 473, into both 75 ohms and
10 megohms load.  I've got a good enough scope for that.)


Interesting to note that the sample word length in SPDIF is 20 bits.
Someone was planning ahead!


Again, as I have noted in many articles on this, I KNOW FULL WELL that
there is an elasticity buffer between the data off the CD and into the
error correcting logic.  Nobody could listen to music at the jitter
levels it comes off the disk.

Note that in your own 1-box CD player, the SPDIF output is unused.
Moreover, the DAC is the clock master.  This source of jitter is
specific to two box systems using pure SPDIF.

Still, there can be sources of jitter on the clock into the DAC (or
the SPDIF coder).  For example ground bounce in the logic.  My
Magnavox CDB 473 uses a two-layer PC card, with a fairly feeble ground
plane.  That's not the way computers are built anymore!  Four layers
minimum.

Moreover, there are so many extremely dynamic servo circuits pumping
in a CD transport (radial servo, velocity servo, focus servo), that
any flaws in the power supplies can cause all sorts of interactions
with the logic generating the SPDIF output.  Remember that the depth
of focus of the lens system in a CD transport is one tenth of the
surface roughness of the disk!  That servo hustles, and hard.

The presence of these very hard-working servos is why one sees so many
power supplies in upmarket CD systems, and a desire to get the analog
circuitry in a seperate box.


Also, as Max Hauser noted in a posting many months ago, DAC's are
picky about the pre-charge times on the parallel digital inputs.  This
probably what JVC's K clock stuff is about, presenting the DAC with
uniform set-up times on the bits.


As for what jitter sounds like, read the interviews with Keith Johnson
in The Absolute Sound.


Jitter is easy to measure with the right equipment.  I just don't have
it.  (A spectrum analyzer on the SPDIF data should prove a tolerable
kludge, if hard to interpret.)  We've built custom equipment here at
work to look at jitter on IEEE 802.5 Token Ring networks, which uses
Differential Manchester encoding.  You want to look at an eye pattern
on a scope.


I'm sure that SPDIF jitter does not result in data errors.  Given the
near total absence of error detection in SPDIF format, data errors
would be ludicrously audible.  (Crack!)  It just results in a wiggly
clock to the the DAC.  A spectrum analyzer on that clock will tell
much. 


Hopefully I have provided enough information by now for anyone who is
willing to and interested in understanding sources of jitter in SPDIF
data/timing streams.