looking for a Digital Attenuation for I2S - diyAudio
Go Back   Home > Forums > Source & Line > Digital Line Level

Digital Line Level DACs, Digital Crossovers, Equalizers, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 11th May 2010, 03:41 PM   #1
M-chen is offline M-chen  Germany
diyAudio Member
 
Join Date: Nov 2004
Location: the middle of Germany
Question 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
  Reply With Quote
Old 11th May 2010, 06:33 PM   #2
guido is offline guido  Netherlands
diyAudio Member
 
guido's Avatar
 
Join Date: Mar 2002
Location: diepe zuiden
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.

__________________
GuidoB
  Reply With Quote
Old 11th May 2010, 07:32 PM   #3
M-chen is offline M-chen  Germany
diyAudio Member
 
Join Date: Nov 2004
Location: the middle of Germany
Hi Guido,

thanks for the reply.
You do not have to worry, it is not the beers 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.

Greets,

Martin

Last edited by M-chen; 11th May 2010 at 07:35 PM.
  Reply With Quote
Old 12th May 2010, 06:13 PM   #4
macboy is offline macboy  Canada
diyAudio Member
 
Join Date: Oct 2003
Location: Ottawa, Canada
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.
Attached Images
File Type: png I2S.png (39.5 KB, 147 views)

Last edited by macboy; 12th May 2010 at 06:16 PM.
  Reply With Quote
Old 12th May 2010, 06:43 PM   #5
M-chen is offline M-chen  Germany
diyAudio Member
 
Join Date: Nov 2004
Location: the middle of Germany
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.

Thanks a lot.

Greets,

Martin
  Reply With Quote
Old 12th May 2010, 07:02 PM   #6
diyAudio Member
 
Join Date: Aug 2008
???
Most of DAC nowdays have digital volume control you can tap in right there, suppose you need software mode.
  Reply With Quote
Old 12th May 2010, 07:23 PM   #7
diyAudio Member
 
Join Date: Aug 2008
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!
  Reply With Quote
Old 12th May 2010, 07:35 PM   #8
diyAudio Member
 
Join Date: Aug 2008
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.
  Reply With Quote
Old 12th May 2010, 07:41 PM   #9
M-chen is offline M-chen  Germany
diyAudio Member
 
Join Date: Nov 2004
Location: the middle of Germany
It is not that they still do that, in my opinion they do it more than ever!
Loudness race...
  Reply With Quote
Old 12th May 2010, 07:47 PM   #10
diyAudio Member
 
Join Date: Aug 2008
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.

Last edited by tritosine; 12th May 2010 at 07:56 PM.
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Digital Attenuation, how much detrimental? SKK Digital Source 3 4th February 2007 12:22 PM
Question on activating digital attenuation on this dac chip georgehifi Digital Source 2 30th January 2007 09:31 PM
Digital attenuation for i2s fcserei Digital Source 15 26th September 2005 05:26 AM
digital versus analog volume attenuation frdchang Chip Amps 9 31st March 2005 04:46 PM
How does digital attenuation work? kiwi_abroad Digital Source 2 7th September 2002 11:44 PM


New To Site? Need Help?

All times are GMT. The time now is 01:58 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