Digital attenuation for i2s - Page 2 - diyAudio
Go Back   Home > Forums > Source & Line > Digital Source

Digital Source Digital Players and Recorders: CD , SACD , Tape, Memory Card, 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 20th September 2002, 10:11 PM   #11
diyAudio Member
 
Join Date: Sep 2002
Location: US
I made two shift registers out of the d flip-lfops (74..174) samling at positive edge:

a 3 stage to delay the word select (W0 is the original, W1 delayed by 1 clock cycle , W2 and W3)

a two stage to delay data (D0, D1 and D2)


The data output is always D2 except:

D0 when (W0=0 and W2=1 and W3=1) or (W0=1 and W2=0 and W3=0 )
D1 when (W0=0 and W2=0 and W3=1) or (W0=1 and W2=1 and W3=0 )

In this way I hold the sign bit for 2 more clock period then output the delayed magnitude bits.

I use a multiplexer (74..151) to make this selection. Working fine and does not alter the jitter crirical Word select.
  Reply With Quote
Old 21st September 2002, 04:36 AM   #12
diyAudio Member
 
Join Date: Oct 2001
Location: .
Don't quite see how you hold the the sign bit in position and delay the other bits relative to it. For instance how many shift registers do you have in total ?

ray
  Reply With Quote
Old 23rd September 2002, 04:09 PM   #13
diyAudio Member
 
Join Date: Sep 2002
Location: US
Quote:
Originally posted by rfbrw
Don't quite see how you hold the the sign bit in position and delay the other bits relative to it. For instance how many shift registers do you have in total ?

ray
WS --> Delay ----->Delay ----->Delay ----->W2
| |
| ----------------->W1
|
----------------------------------------------->W0


Data--> Delay ----->Delay -------------------->D2
| |
| -------------------------------->D1
|
----------------------------------------------->D0

Then I use a mux co combine the signals according to the logic above.


This way the data is:

MSB MSB MSB MSB-1 MSB-2 .... LSB

instead of

MSB MSB-1 MSB-2 .... LSB
  Reply With Quote
Old 21st September 2005, 02:18 PM   #14
Pulse-R is offline Pulse-R  Australia
diyAudio Member
 
Join Date: Mar 2005
Location: Melbourne
does this mean this technique could be used to implement a 'digital volume control'?
if so, would be much easier than what I had planned...

still not quite understanding the logic though
__________________
Digital is only on or off
  Reply With Quote
Old 21st September 2005, 03:35 PM   #15
macboy is offline macboy  Canada
diyAudio Member
 
Join Date: Oct 2003
Location: Ottawa, Canada
Quote:
does this mean this technique could be used to implement a 'digital volume control'?
if so, would be much easier than what I had planned...
Yes, but with coarse 6 dB steps. And the more attenuation you want, the more logic you need to get it. Plus the logic to select 1-of-N attentuation levels. It gets messy fast.

Quote:
still not quite understanding the logic though
You need to understand the 2's complement representation of signed integers. Look it up in Wikipedia if you have to.
In 2's complement, 1 is 1, 0 is 0, etc., but -1 is "all ones", so for a 16 bit number, -1 is b11111111. Since -2 is -1 subtract 1, it is b11111110, and -3 is b11111101, etc. Note that the most significant bit becomes the sign bit (1 for negative, 0 for positive).

Consider the represention of -1 as a 12 bit number. It is b111111111111. So how do you convert an 8-bit -1 to a 12-bit -1? Well, you can't pad it with (12-8= 4) zeros, because then you get b000011111111 which is +255. And you can't just pad it with 4 ones because then a positive number becomes negative. Instead, you need to copy the sign bit 4 more times.

In fcserei's system, each channel uses a 32-bit 2's complement number per sample. The 16 MSbs are used for the 16 bit samples, with the 16 LSbs essentially unused. To attenuate the samples, he shifted the 16 bits some amount toward the LSb side (by delaying the word clock). To maintain proper 2's complement signage, he then needed to duplicate the sign bit and fill it into the 2 new MSb bits prior to the 16 bit data.
  Reply With Quote
Old 26th September 2005, 05:26 AM   #16
Pulse-R is offline Pulse-R  Australia
diyAudio Member
 
Join Date: Mar 2005
Location: Melbourne
ah, ok

yes, 6dB is a bit coarse...
back to my drawing board....
I have made a design schematic for a 16/44 - to - 24/96 converter with variable attenuator, but I am not good at PCB design... that will take longer
__________________
Digital is only on or off
  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 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
use digital attenuation to improve 16-bit CD playback on 24 bit DAC capslock Digital Source 7 8th April 2002 11:18 PM


New To Site? Need Help?

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