From: jas@proteon.com (John A. Shriver)
Newsgroups: rec.audio.high-end
Subject: SPDIF jitter
Date: Wed, 11 Nov 92 10:57:26 EST
Organization: University of Wisconsin - Milwaukee
NNTP-Posting-Host: 129.89.7.4
Originator: tjk@csd4.csd.uwm.edu

A friend asked me for a better explanation of the whole jitter issue
in SPDIF encoding and decoding.  I decided that this is worth further
distribution.

The problem with jitter is in the SPDIF format.  You are transmitting
two things down the wire.  One is the data, the other is the clock.
For SPDIF, this is done with Manchester encoding (to the best of my
knowledge).  In Manchester encoding, at the center of every bit time,
there is a transition.  If that transition is low to high, that bit is
a 1.  If that transition is high to low, that bit is a 0.  At the ends
of the bit cells, there may be transitions to reach the right state
for the next mid-bit transition.

Here's the example from the DEC/intel/Xerox Ethernet spec:

| 1 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 |

  +---+ +-+   +---+   +-+ +-+ +---+
  |   | | |   |   |   | | | | |   |
--+   +-+ +---+   +---+ +-+ +-+   +--

(In the top line, the numbers are at the center of each bit time, the
|'s are the edges of the bit times.)

The data decoder sorts out the Manchester data, and figures out which
transitions are the mid-bit transitions.  These are used to steer a
PLL whose center frequency is the nominal bit rate.  The PLL will lock
onto the mid-bit transitions.  This is the clock that gets recovered
from the data, and it is fed back into the data decoder to do the data
decoding.  (Yes, it's circular.)  This is also the clock that feeds
the D/A chip (after division down to the sample rate).

There are inevitable tradeoffs between how slowly the PLL will change
output frequency, and how much incoming jitter or frequency error is
acceptable.  Some D/A boxes are now very picky about the accuracy of
the SPDIF clock frequency.  This lets then have a more stable PLL.  I
suspect that most of the SPDIF PLL's are not very tight, and may not
even be stable.  PLL's have stability criteria that are quite
comprable to feedabck amplifiers.

The clock in a Manchester data stream is very subject to sytematic
jitter errors due to typical transmission phenomena.  For instance,
typical fiber optic components are notorious for dramatically unequal
rise and fall times.  Since the polarity of the mid-bit clock
transition is data dependent, one will see the clock drift one way
(phase-wise) on continuous 1's, and the other way on continuous 0's.
These rise and fall time phenomena are probably much more severe on
the TOSLINK plastic fiber components than the AT&T ST glass ones.

Multimode fiber links (which both TOSLINK and ST are) also suffer from
dispersion, due to multiple paths in the multimode fiber.  Some
photons go through the middle of the core, others bounce from side to
side and take longer.  However, this is probably truly irrelevant for
the typical one meter interconnect, especially glass ones.  (Plastic
fiber has huge core diameters.)

In coaxial cables, the rise times are typically more equal.  However,
one is still subject to intersymbol interference.  When the rise time
gets to be a real fraction of the bit time, the waveforms aren't as
pretty, and you get a baseline shift.  When a period of high or low
voltage on the cable only lasts half a bit time, you don't get quite
as asymptotically close to the target voltage as you would in a full
bit time.  This means that the following transition does not start
from a consistent voltage.  Thus, the voltage of the next transition
will cross the centerline at a relative time that depends on how long
the signal had been at the previous voltage.  (Draw it.)

Both of these are scenarios that cause data dependent errors in the
timing of the mid-bit transitions that feed the PLL.  Since the SPDIF
data is pretty close to raw audio data (very little subcode or error
correction left), there is little scrambling of the data, and there is
more correlation of the timing errors to the signal.

Note, however, that the signal distortion phenomena are not the same
on fiber and coax.

Things are further abused by stupid design in the digital domain.  I
was looking at a back issue of HFN&RR, a review of an Arcam CD player.
They had applied some wierd inductive peaking to the SPDIF signal to
get a better risetime.  Sure, this makes for nice risetimes, but there
was all sorts of overshoot, and recovery problems during the level
period.  This "improvement" would add all sorts of baseline shift.
(The 'scope photo was of a constant 1's or 0's data stream, so one
didn't see the baseline shift problem.)

However, more typically, the coaxial SPDIF data is driven with weak
line drivers, through less than wideband transformers.  Moreover, it
may be deliberately filtered to eliminate RFI.  All of these will
contribute to a poor risetime, baseline shift, and jitter.

For desiging SPDIF transmitters and transmission facilities, what
should be measured is the uniformity of the timing of the mid-bit
transitions.  This can be done with (expensive) instruments like the
Tektronix CSA 404.

(Manchester encoding is designed for reliably transmitting data in a
self-clocking manner.  It is not designed to preserve the timing
information reliably, only the data.)