diyAudio

diyAudio (http://www.diyaudio.com/forums/)
-   Digital Line Level (http://www.diyaudio.com/forums/digital-line-level/)
-   -   looking for a Digital Attenuation for I2S (http://www.diyaudio.com/forums/digital-line-level/166719-looking-digital-attenuation-i2s.html)

M-chen 11th May 2010 03:41 PM

looking for a Digital Attenuation for I2S
 
Hi all,

as mentioned I am looking for an easy hardware-based possibility to attenuate a digital I2S signal. A volume decrease of around 2dB is recommended for the application.

And here is why:
Because of the fact, that todays CDs are mostly produced as loud as possible, there is a good chance to have "intersample overs" during the d/a conversion. As far as I know, the most manufacturers of DACs do not even really know what happens then to the signal exactly. For sure it will not be good. For that reason, some newer DACs have the feature to attenuate the digital signal before the conversion (e.g. Wolfson 8741. The function is called anti-clipping here).
So my idea is to do exactly the same with the digital signal before routing it to the DAC. The advantage is, one can use any DAC but gets protection against intersample-overs!
Of course it would be perfect to add the possibility to switch the attenuation off, because it will decrease the resolution of the signal a little bit.

Any ideas are very welcome.

Greets,

Martin

guido 11th May 2010 06:33 PM

Mmm, just had some beers after work, maybe that's why i don't get it.

If a signal clips, the digital stream contains a number of samples after each other with max value. Output of the dac is max current/voltage at one end; a DC signal. After that the analog stuff which handles this in some kind of (bad) way.

So now attenuate all with 2dB. Wouldn't that be a number of samples after each other with max value minues 2dB. So still a DC signal out of the dac, just a bit less current/voltage.

I could only understand this if the signal would be going through a big DSP, which would recontruct the part of the signal which was removed by the clipping. Which is not just a minus 2dB and what is not described in the wolfson datasheet.

:confused:

M-chen 11th May 2010 07:32 PM

Hi Guido,

thanks for the reply.
You do not have to worry, it is not the beers :D and with your thoughts about the reconstruction you are on the right way.

Intersample-Overs are peaks created in the DAC itself during the reconstruction of the signal. Because of the way how the interpolation works, you can have a "more than 0 dB"-signal on the output, even when the digital input is not higher than 0 dB (which is, by the way, not possible here). The problem is, that this peaks create (depending on the used DAC) more or less distortion in the analog signal, because everything above the allowed maximum will not be very linear anymore. Usually they do not exceed 1 dB over or so, but in theory they could rise up to more than 6 dB over!

As a consequence, if you give a digital signal to the the DAC with enough headroom (2 dB should be sufficient), one will never see intersample-overs. An this is the target here.

I hope this was understandable somehow. :cloud9:

Greets,

Martin

macboy 12th May 2010 06:13 PM

1 Attachment(s)
Most of the time, data is transferred in either left-justified or "true" I2S format (which is just like left-justified with an extra 0 bit thrown in before the MSb, and LRCLK inverted). That means that the most significant bit is transferred first and so on, until the least significant. This is followed by enough zero bits to make 32 bits total per channel, or 64 bits per LRCLK/WCLK cycle.

You can create a 6 dB attentuation by shifting the data one bit right, or a delay of one BCLK/SCLK cycle, but there is a complication because you need to account for the sign bit. That is, you need to duplicate the sign bit (MSb) into the new MSb position, rather than just filling with zero or delaying the entire 64 bit stream by one cycle. That makes for some complicated logic, but it has been done. I recall that someone on this forum came up with a design using some 74xx logic chips a few years ago.

If 6 dB is too much, then there is no easy way to do it I am afraid. You will need to re-calculate all new samples attenuated by the desired amount. That means DSP. You can get by with something easy (easier?) to use like the TI TAS3001, TAS3004, or TAS3103. You will need a microcontroller to configure the chip over I2C, but you don't need to write any DSP code, just program some configuration data into the thing.

I stole the attached depiction of the various serial data formats from the TI TAS3103 data sheet.

M-chen 12th May 2010 06:43 PM

These are very interresting thoughts.
Unfortunately 6 dB will be a little to much for this purpose I think.

And to use a DSP for that only is overdoing for sure. If the DSP would be usable for additional functions o.k., but here...

I think I have to forget about the project. What a pitty. :sad:

Thanks a lot.

Greets,

Martin

tritosine 12th May 2010 07:02 PM

???
Most of DAC nowdays have digital volume control you can tap in right there, suppose you need software mode.

tritosine 12th May 2010 07:23 PM

indeed , Wolfson are very good at adding phantom features, like

1.elastic buffer™ (not used in actual spdif receiver implementation)

2. appetizing filter™ ( only works above 88ksps , which defeats its sole purpose)

3. dedicated anti clipping pad ™ :))

...ha!

tritosine 12th May 2010 07:35 PM

By the way this intersample over thing is a few years old now, there are even plugins designed to show if it occurs , can't imagnie they press CD's without checking for it.

M-chen 12th May 2010 07:41 PM

It is not that they still do that, in my opinion they do it more than ever!
Loudness race... :headbash:

tritosine 12th May 2010 07:47 PM

Well , now Im actually thinking about this, the builtin chip attenuation wont work if its not done on the 16bit input directly. Hm . Maybe this feature has something to it afterall. I seem to remember pmd200 filterchip has 1dB attenuation engaged all the time, not to clip incoming squarewave.

Btw Once we are speaking about squarewaves , does it matter?

I have a better idea, load this track up into a wave editor, run a declipper, or draw the samples away by hand.
http://www.solid-state-logic.com/music/X-ISM/
http://recforums.prosoundweb.com/index.php/t/19731/0/

You can run this one simultaneously.


All times are GMT. The time now is 11:03 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio


Content Relevant URLs by vBSEO 3.3.2