The chip sets needed to accomplish this are closely guarded intellectual property. To gain access one must become Dolby digital and DTS licensee which is a multiple $100,000 investment. Unlike S/PDIF which is an open public standard the DD and DTS datastreams specifics are not publically published. One gets the specs after your companies $250,000 check clears. As an aside this 6-figure up front investment is why we only see the largest of high-end audio companies in the multi channel processor business. And after cutting the checks to Dolby and DTS then they get to start the very deep hardware and software engineering to produce a working circuit.
One has two or three options for the DIY project you want to attempt:
1. Go analog and use a high-end &/or modified DVD/SACD player to decode DD/DTS to analog.
2. Hardware hack a DD/DTS processor or receiver to pluck the signals off the DAC inputs after they have been decoded into individual data streams. One would need to reverse engineer to determine what format the DAC chips use to receive samples from the DD/DTS DSP (like IsquaredS) and use that to drive added S/PDIF encoder chips as made by TI and Crystal.
3. Buy one of the few multi channel processors which output S/PDIF like the Meridian's or TACT.
If one chooses to go with option #2 I suggest doing it for personal use only and not sharing it on the web. Dolby and DTS are basically intellectual property companies and the The Digital Millennium Copyright Act of 1998 gave there lawyers a rather large stick to come after you with. For this reason I will have to decline to answer any questions about specific technical details beyond the obvious broad stroke comment above.