S/PDIF

SPDIF is the Sony/Philips Digital Interface.

 

The sender e.g. a transport or a soundcard sends a block pulse to the receiver e.g. a DAC. The DAC locks on the send rate and detects the rise and fall of the signal.
So far nothing different from any other digital bus.


A striking difference with a computer bus is that in case of SPDIF the send rate is the sample rate as well.
Normally the rate of the bus is totally unrelated to the data (the bits) but in case of SPDIF the send rate represents the sample rate.
As this rate is generated by the clock of the sender, any fluctuation in the send rate manifest itself as input jitter at the DAC.

SPDIF is therefore a hybrid signal, the data is digital but the timing is analog.

 

SPDIF is a real time unidirectional stream.
The sender send, the receiver receives and no way the receiver can communicate with the sender.
It is possible for the receiver to detect bit errors but as it is a real time stream, there is no retry. That is inherent to a real time stream, in case of an error one is simply too late.
If bit perfect transmission fails us, it is in general clearly audible because bit flipping manifest itself  in loud clicks and pops. This is rare.

 

Although SPDIF is a stone age protocol, it has an advantage. It is very simple compare with e.g. USB. It most of all simply works. Over the years DAC designers has conjectured up all kind of trick like PLL’s to cope with the input jitter.

Capabilities

SPDIF requires a 32 bit word for each channel. There is a pre-amble and a couple of status bits including a parity bit. The payload is 24 bit max.
At the time SPDIF was developed (80’s) the bit rate was 32/44/48 kHz.
Today you can do up to 2 channel PCM audio with 24 bit and a 192 kHz sample rate over SPDIF.
Other formats supported are DTS, AC3 and MPEG.

Error detection

Due to this parity bit error detection is possible.
SPDIF is a unidirectional real-time protocol.
If the receiver detects an error in cannot ask the sender for a retry because it is unidirectional.
Even if this would be possible, the retry  is of no use as the new sample will arrive to late (real-time).

Wiring

SPDIF requires a cable with 75 Ohm resistance (a coax cable).
Best is to terminate it with true 75 Ohm BNC connectors.
In practice it is often terminated with RCA plugs simple because in the consumer world the receptacle is RCA. In the pro-world it is BNC.

More about wiring.

Biphase Mark Code

We know that are bits are 0 or 1.

But these exist only in our mind.

If a 1 would be 3 volt and a zero 0 volt what would happen if there is a long silence?
All zeros so 0 V on the line.
How could the receiver distinguish this from no signal?
How could the receiver detect the sample rate?
It might even be interpreted as DC!

 

Source: Micah Elizabeth Scott [2]

 

Biphase Mark Code is the trick to generate a signal that changes even if we send a bunch of zero’s. A zero bit is encoded by a transition followed by a non-transition, whereas a one bit turns into two transitions.

Keep your bits alive is the name of this came.
The consequence is that the bit rate doubles.

 

Sample rate 44100 Hz
Word length 32 Bit
Channels 2 Stereo
biphase-mark-code 2 per bit
Frequency 5644800 Hz (SR*Bit*Channel* biphase)

A SPDIF doing 2 channel stereo at 44.1 kHz runs at 5.6 MHz.

Note that is doesn't make difference using 16 or 24 bit audio.

The word length remains 32 bit.

 

A bit more about digital cables.

References

  1. SPDIF - ePanorama.net
  2. S/PDIF Digital Audio on a Microcontroller - Micah Elizabeth Scott
  3. SPDIF - Hardware Book
  4. Is the AES/EBU S/PDIF digital audio interface flawed? - Malcolm Omar Hawksford, Chris Dunn - AES 1992