A S/PDIF Free Space Digital Audio Optical Link
Sept 19, 2012
The intent of this article is to demonstrate a basic optical LED wireless link for transmission of high definition (HD) S/PDIF digital audio streams. Circuit designs for both the transmitter (optical modulator)
and receiver are presented using inexpensive op-amp designs. Specific components are included but designs are generic enough that substitution of components with
similar specifications should work. Using readily available simple lenses, wireless transmission distances of over 100' are achievable.
HD Audio: S/PDIF, HDMI and DLNA:
S/PDIF (Sony / Philips Digital Interconnect Format) describes a consumer format for transmission of digital audio, either uncompressed stereo or
compressed multi-channel formats. Many consumer audio DVD and Blu-ray players are equipped with either 75 ohm digital coaxial, or digital fibre-optic (TOSLINK) S/PDIF output jacks.
These are wired connections to amplifiers or receivers equipped with digital audio inputs with high-definition audio support up to at least 24bit/96kHz.
DLNA (Digital Living Network Aliance) is a modern and evolving technology
for streaming music, pictures and videos over home networks. Network connections are typically wired ethernet or RF wireless connections via routers and modems.
However DLNA-certified audio players and receivers often don't support high-definition audio (e.g. 24bit /96kHz). Also, older players don't support DLNA.
Most modern digital players and receivers support the evolving wired
HDMI interconnection format which supports combined high-definition video along with an amazing 8 channels of uncompressed
audio at a sampling rate of 192 kHz and 24 bit resolution (corresponding to a maximum audio rate of 38.86 Mbit/sec). However due to the very high bandwidth, wireless connectivity
is not currently possible.
The significantly lower complexity and bandwidth of the S/PDIF format allows for fairly easy assembly of DIY circuits such as those described here.
This article describes a free space analog infrared and visible LED optical transmitter and Si pin photodiode receiver link designed for ranges of 10' - 100', depending on the configuration and lensing, and for the CD and DVD sampling rates of 44.1 and 48 kHz respectively,
or the higher-definition rate of 96 kHz. The circuits here are completely analog, with no digital processing, pulse shaping or level adjustment of the received digital S/PDIF optical stream at the receiver.
Nevertheless, the link will allow noise-free line-of-sight optical transmission of high-definition S/PDIF digital audio streams between digital-audio players such CD, DVD and Blu-ray players, and digital amplifiers,
provided that the output level is within a reasonable range of the standard coaxial S/PDIF voltage level.
Since the circuits are analog, they can also be used, with a few simple modifications, for wireless transmission of analog audio (e.g. the line-out levels of any audio equipment).
However, analog LED links have the disadvantage of nonlinear distortion arising from nonlinearities in the LED light-output versus forward current characteristic
and also have limited signal to noise performance as discussed below.
The S/PDIF digital audio interconnect format is described by a sampling rate of the 64-bit audio data frames. Each 64 bit frame contains a single audio sample for both the left and right channels along with various
status bits. Therefore for the sampling rates of 48kHz and 96 kHz discussed here, the information bit rates are 3.072 and 6.144 Mbit/sec respectively. However since the encoding used in the S/PDIF format is biphase mark code,
a 1 bit would have 2 transitions in the bit interval. This means that the clock rate is twice the information bit rate. The coaxial S/PDIF standard specifies an electrical level of 0.5Vpp at a termination
impedance of 75 ohm.
What receiver bandwidth is required for proper detection of bit streams for 48kHz and 96 kHz?
From basic binary data recovery analysis, it is known that the required bandwidth is HALF the transmission bit rate.
Therefore, the receiver must have a minimum bandwidth of about 3 MHz to properly detect a 48 kHz S/PDIF stream, or 6 MHz for the
96 kHz case. The bit rate or bandwidth is the same for both 16 bit or 24 bit audio sample sizes since the 64 bit S/PDIF frame size accomodates both sample resolutions.
From data communications error theory, we know that a 10E-9 bit-error-rate requires a (peak) digital signal to total noise ratio S/N of 12. However a S/N ratio of 20 is often used to allow for
various system margins. In this simple data link, we will also require a minimum S/N of 20 to ensure error free reception of the S/PDIF optical transmission. We will also require
that the received S/PDIF signal be amplified to a level of about 250mV peak, consistent with the S/PDIF specification. (However, the specification allows for signal levels about half this size).
Also, typical S/PDIF inputs can accept digital signal levels considerably higher than the nominal value without any problem although a maximum value no higher than 500mV peak is recommended.
The setup for the 48 kHz sampling rate is discussed first and the simple modification required for 96 kHz operation is discussed below. Finally the extension to the highest S/PDIF rate of 192 kHz is described.
A simplified view of the schematic diagrams for the transmitter and receiver configuration is shown below. The component values shown are for the 48 kHz case. For the 96 kHz case, the Rf value in the receiver circuit was changed
to 27 kohm with no other modifications:
The Optical Transmitter:
The digital coaxial output of a Toshiba SD-V383SC DVD player, or an OPPO Digital BDP-83 Blu-ray player, is used to drive a Vishay TSFF5210 high-speed (23 MHz BW) and high-radiance 870 nm infrared LED with the simple
transconductance driver circuit shown below:
The S/PDIF coaxial output requires a termination impedance of 75 ohm. The binary signal level across the 75 ohm termination in the driver circuit was measured to be 250 mV peak.
The transconductance circuit biases the LED at 20mA with the input S/PDIF signal AC coupled with a 20mA modulation signal. Therefore the peak LED drive current is 40 mA.
With an average S/PDIF duty-cycle of 50%, the power dissipation of the LED is well within the maximum specifications.
The Optical Receiver:
The optical receiver for the 48 kHz case is a 3.1 MHz transimpedance amplifier. The photodiode is a Vishay BPW24R Si pin, biased at -5V with a capacitance of ~ 4pF. The photodiode
bandwidth is ~ 50 MHz. Therefore the receiver speed is limited by the transimpedance circuit bandwidth. The photo below shows the circuit with a 40mm diameter lens positioned in front:
The Post Amplifier:
A standard low noise op-amp voltage post amplifier configured for a gain of 50 and a bandwidth of 10 MHz was used to raise the output signal level
to the standard S/PDIF coaxial level. The noise contributed by the post-amp is less than 1/10 the output noise of the transimpedance receiver circuit and therefore doesn't contribute significantly to noise.
The photo below shows a typical breadboarded example using an LT1222 op-amp.
A half-wave rectifier circuit using a 1N34a Ge diode in parallel with the output provides a peak detection capability and a
DC output signal for optical alignment using a 10 Mohm multimeter in series with a 10 Mohm resistor. This rectifier provides negligible load on the op-amp output.
The measured DC level is therefore approximately half the peak S/PDIF signal level :
Testing The Link:
With the transmitter and receiver position 10.5' apart. Playback of a DVD with 48 kHz PCM stereo audio content was started.
The output of the post amp was connected to a Creative Technologies X-Fi Elite Pro sound-card module using the S/PDIF coaxial input. Playback was monitored audibly as well as
by observing the status of a S/PDIF monitor program provided with the sound-card.
A 2 MHz USB oscilloscope was used to measure signal levels and to facilitate initial alignment of the transmitter/receiver link.
Without any optical lensing at the receiver, and with the 50x post amplifier connected, the received S/PDIF signal level was measured to be 25mV peak. The noise level was ~ 7mV RMS
in reasonable agreement with the expected noise of the transimpedance circuit, amplifier by the post amp.
The 25mV signal level agrees closely with the expected signal level. That is, at a peak LED current of 40mA, the LED radiant intensity from the specification is 60 mW/steradian. The photodiode active area is
about 12mm^2 so at a distance of 10.5', the solid angle subtended by the photodiode at the LED is 1.2E-6 steradians. Therefore the expected optical power received during a digital 1 bit is 72nW.
To convert this to an output voltage driving the S/PDIF input, multiply by the photodiode responsivity at the LED wavelength of 870 nm (0.6A/W) and the transimpedance gain (Rf=50kohm) and the post amp gain (50). Finally, there is a factor of
1/2 due to the 75 ohm impedance-matching voltage divider at the output of the post-amp.
We obtain an expected peak-to-peak voltage output of 54 mV in reasonable agreement with twice the measured peak value.
This S/PDIF signal level of 24mV peak is too low by a factor of ~ 10 for proper detection by a standard S/PDIF coaxial input. Therefore a peak optical level of ~ 1 µW is required with this circuit
to achieve a suitable output signal level of 250 mV. (For comparison, a typical TOSLINK digital optical fibre carries about -20 dbm of optical power or 10 µW at a visible wavelength of 650 nm). Furthermore, the S/N ratio is < 10 and we therefore require
greater optical signal power. (Greater post-amp gain would not improve the S/N ratio). Therefore a 40mm diameter simple plastic lens was used to collect more light.
Compared to the area of the photodiode alone (12mm^2) the lens provides an "optical gain" of about 100. This is considerably greater than required and during lens-alignment, an output S/PDIF
signal level of ~ 250mV peak, corresponding to an optical gain of 10, was sufficient to provide steady error-free audio playback.
The scope trace below shows the S/PDIF signal at the output of the post amp for a fairly high signal level of 800 mV peak (but not fully focused). The very narrow spikes are 1 bits which are not quite
resolved by the 2 MHz oscilloscope, while the wider pulses (325 ns) correspond to 0 data bits.
The widest feature at the T2 position is used in the format to signal the start of a data frame.
Since this lens provides about 10x more overall gain than actually required, the post-amp gain could be lowered by the same factor to x5. In this way, electronic gain can be traded off for optical gain.
Greater optical gain will improve the S/N ratio however but requires more attention to mechanical setup and focusing stability.
For example a 20mm diameter lens would require a 20x post amp gain. A large 100 mm (4") diameter lens would provide sufficient optical gain that no post amp would be required.
What about S/PDIF at 24bit / 96kHz?:
S/PDIF transmission at 96 kHz has a data bit rate of ~ 6 Mbit/s and requires a receiver bandwidth of ~ 6 MHz. The link described above can be modified to work properly at 96 kHz by simply changing the feedback resistor of
the transimpedance amplifier from 50 kohm to 27 kohm. By keeping the feedback capacitance the same, the transimpedance bandwidth increases to almost 6 MHz. Although the combined bandwidth
of the transimpedance amplifier and the 10 MHz post amp is somewhat less than 6 MHz, the link still works perfectly at a 10' transmission distance for output signal levels of over 200 mV peak
which is easily achieved with the 50x post amp and lens described above. To test the 96 kHz sampling rate, a DVD-Audio disc was authored with uncompressed 24bit/96kHz stereo
test tracks and the disc was played using an OPPO Digital BDP-83 player. The coaxial S/PDIF output of this player was again used to drive the LED transmitter.
The scope trace below shows the output of the post amp and the S/PDIF monitor status of the sound-card S/PDIF input:
Verifying The Bit Error Rate:
As a simple test to confirm negligible bit error rate, a 5 min 24bit/96kHz patterned test PCM wav file (about 165 Mbyte in size) was synthesized and authored to a DVD-Audio disc track and played back
through the S/PDIF link described above. This track duration corresponds to ~ 1.7 Gbits transmitted.
The output of the post amp was connected as previously to the S/PDIF coaxial input of the sound card. The S/PDIF input stream was "bit accurate" recorded
using sound-card software. The recording was started slightly before start of playback of the test pattern audio file.
The header bytes and excess zero head and tail ends of the recorded wav file were removed using a binary editor program. The resultant recorded file which now contains only the raw audio sample data of the
recorded file was then identical in size to the original wav file.
Verification of transmission consists of checking for exact bit-wise agreement of the original sample data with the S/PDIF transmitted and recorded data.
This was achieved by computing a cryptographic SHA-1 hash on both files. The hashs were identical meaning the data were bit-wise identical corresponding to zero bit-errors in 1.7 Gbit of transmitted data.
This is consistent with a bit-error-rate of less than 1E-9 as expected.
Note that this test evaluates the entire transmission chain, including the digital audio player S/PDIF output, the transmitter and receiver electronics which comprise the link discussed here, and the
S/PDIF input circuit of the sound card. Since the sample data agree exactly, all components, including the infrared transmitter/receiver pair, are error free under the test conditions.
What about S/PDIF at 24bit / 192kHz?:
S/PDIF supports a studio mastering maximum sampling rate of 192 kHz which is found on some high-end recording equipment and many modern home receivers although 96 kHz is arguable
the highest useful sampling rate for final digital audio sound tracks. At 192 kHz, the S/PDIF data bit rate is 12.288 Mbit/sec so a bandwidth of ~ 12 MHz is required at the transmitter and receiver.
The transconductance modulator shown above with the parts shown can be used for digital modulation at up to 25 MHz. The Vishay infrared LED can be similarly used up to a comparable bandwidth.
(by comparison, the red LED discussed below has a bandwidth of ~ 6 MHz and will not work properly at 12 MHz). The receiver circuit using the AD8065 op-amp can be modified to work properly at the 192 kHz
rate by changing Rf to 4.7kohm and Cf to 2.2 pF, providing a transimpedance bandwidth of ~ 15 MHz, but an overall gain about 11x lower than above. Also, the supply voltage for the AD8065 must
be at least +/- 9V to ensure sufficient bandwidth.
Also the post amp bandwidth must be increased to ~ 20 MHz.
With the same lensing as above, the link has been tested to work perfectly at a distance of 10'. Since the GBW product of the AD8065 is 65 MHz, the transimpedance bandwidth of the circuit
doesn't allow much "loop gain" in the circuit. Typically a good design calls for an op-amp GBW of at least 10x or higher than the circuit bandwidth. An example of such a circuit is shown to the right
using the LT1222 op-amp with a GBW product of 500 MHz. It is then possible to use a high gain 50 kohm value for Rf, even at the S/PDIF rate of 192 kHz. A Cf value of ~ 0.3 pF will set the transimpedance bandwidth at
~ 13 MHz. This Cf value is a typical stray value for surface mount capacitors and is also the stray capacitance across the protoboard board channel used for testing.
The LT1222 has a minimum required noise-gain of 10 to ensure stability. For this transimpedance circuit, the determining noise-gain value at the intersection with the op-amp open loop gain is ~ Ci/Cf or ~ 20
using the op-amp and photodiode capacitance values. Therefore the circuit will be sufficiently stable.
This circuit was verified to work perfectly at all S/PDIF sampling frequencies from 44.1 to 192 kHz. Note that there is no Cf capacitor added explicitly:
It is possible to use an inexpensive high-radiance red LED instead of the infrared LED used above. Visible LEDs
assist with optical alignment and focusing. Not all visible LEDs however have sufficient bandwidth and most specifications don't include this information.
For example the 08LCHR5 LED with a luminous intensity of 5000 mcd (or ~ 25 mW/sr) at a wavelength of 624 nm works perfectly
at the 96 kHz rate and can be modulated up to ~ 6 MHz.
The S/PDIF free-space link described above, using a 40mm collection lens has been verified to work well at up to distances of ~ 30' but the alignment and mechanical stability require greater attention.
It is possible to achieve even greater transmission distances by colliminating the LED output using another simple lens at the transmitter side. In this case, initial alignment will be more difficult
but stable transmission distances of over 100' are achievable. A stable link at S/PDIF rates of up to 96 kHz with transmitter collimation operating over a distance of 107', using a red LED was verified
with a maximum receiver output level of 450mVpeak. Allowing for non-optimized alignment or drift, an output level of 200mVpeak is easily achievable corresponding to an input optical power of ~ 1.5µW.
This corresponds to a SN ratio of ~ 70, 3.5 times higher than the required minimum value of 20. Therefore, the link distance can be roughly doubled (with the optical signal dropping
by about 1/4) with the SN ratio ~ 18. However in this case, the post-amp gain must be raised by x4 (from 50 to 200 in this case) to achieve the same S/PDIF level.
For a post-amp bandwidth of ~ 10 MHz, the GBW required of the post-amp op-amp would be ~ 2 GHz. Alternately, two cascaded identical voltage amplifiers, each with a gain of 15 and bandwidth
of 16 MHz (GBW > 240 MHz) could be used.
The setup is shown below and uses 3 ordinary mirrors to conveniently extend the path. The mirrors and lenses are inexpensive and readily available from local dollar stores. The mirror mounts are
simple home-made jigs. One of the mirrors will require a reasonably good tilt adjustment, such as the home-made unit used here (click to view a larger image):
It is also possible to use a red diode laser, extracted from an inexpensive laser pointer which may require no lensing and easier alignment.
However lasers are susceptible to degradation due to electrical transients and therefore require extra caution in the modulator circuit.
The link described above for 24bit/96kHz has sufficient bandwidth to transmit analog composite video signals.
However, since the composite video signal is an analog format, the signal level must be carefully adjusted to avoid distortion of the received video signal. The scope trace below shows the output
of the post amp showing a composite video signal showing clear resolution of the horizontal sync pulse with front/back porch and color burst signals followed by part of a horizontal scan line:
Using a S/PDIF Optical to Coax Converter:
Modules are available which, although intended for adapting TOSLINK optical fiber to S/PDIF coax cable inputs, can in fact be used as an entire wireless receiver. For example the
optical input port of the RadioShack 42-8561 optical to coax converter module can receive focused light from an external lens, rather than from a TOSLINK fiber-optic cable. Of course
the optical match between a large external lens and the small internal lensed window of the converter box will not be optimum. However, using the same setup as above with a 10'
distance, it is possible to use this module to receiver a 96 kHz S/PDIF stream, transmitted using the transconductance amplifier and lens above. Since TOSLINK for digital audio
is designed for red light at a wavelength of ~ 650 nm, good performance is achievable with the 624 nm red LED mentioned above. The optical to coax converter module mentioned
above consists of the Toshiba TORX178S TOSLINK receiving module, associated bias circuitry and a output HD74HC04P hex inverter buffer/driver. The TORX178S module contains
the photodiode, amplifier and waveform shaping circuit providing a TTL output level and is specified for a maximum bit rate of 6 Mb/s with a minimum optical power level of -24 dBm (4 uW).
Therefore the module will be useable for S/PDIF up to the 96 kHz sampling rate. The module and lensed optical input port are shown below. Successful reception of a 96 kHz S/PDIF stream
Analog Audio Transmission:
As mentioned above, the transmitter and receiver circuits can be easily modified for reasonable quality analog audio (e.g. line out) transmission. Line level outputs are typically 0.5 - 1.0 Vp
with a bandwidth of ~ 20 kHz.
The transmitter above can be simply modified by changing the voltage divider input to lower the analog signal level (by ~ 1/4). For analog transmission, a receiver bandwidth
of ~ 20 kHz is sufficient. Replacing Rf in the transimpedance circuit above with 2 Mohm will increase the transimpedance gain by x40 which also raises the SN ratio, as required for an analog link.
Keeping Cf = 1.3pF, the transimpedance bandwidth is lowered to 60 kHz.
With the same lensing and a comparable distance of 10', the post amplifier is therefore not required. The output signal level with good lens focusing will be ~ 1Vp. In this
design, the SN ratio will be ~ 74db (assuming a noise bandwidth of 20kHz x 1.57) which is reasonable low noise, but certainly not audiophile quality
(e.g. 16 bit CD quality has a dynamic range of 96 db and a typical good line out SN level is ~ 100 db). The nonlinearity of the light output versus forward current characteristic of a
typical LED will also cause harmonic distortion which will depend strongly on the specific LED.