IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
32bit output into 24bit capable soundcard. How bitdepth is converted i
amiti
post Feb 6 2013, 18:10
Post #1





Group: Members
Posts: 152
Joined: 1-January 05
Member No.: 18746



When streaming an audio data of 32bit to a 24bit capable soundcard via ASIO, how does the hardware/drivers handle it? Are the excess bits truncated or dithered?

(I use ESI Juli@ souncard)
Go to the top of the page
+Quote Post
IgorC
post Feb 6 2013, 19:03
Post #2





Group: Members
Posts: 1564
Joined: 3-January 05
From: ARG/RUS
Member No.: 18803



http://en.wikipedia.org/wiki/Digital-to-analog_converter

QUOTE
Noise is ultimately limited by the thermal noise generated by passive components such as resistors. For audio applications and in room temperatures, such noise is usually a little less than 1 μV (microvolt) of white noise. This limits performance to less than 20~21 bits even in 24-bit DACs.
Go to the top of the page
+Quote Post
pdq
post Feb 6 2013, 19:03
Post #3





Group: Members
Posts: 3394
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



Do you know if the 32 bit data is integer or float? In either case I would suspect that the values are either truncated or rounded, as dither at the 24 bit level is quite unnecessary.
Go to the top of the page
+Quote Post
db1989
post Feb 6 2013, 19:07
Post #4





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



QUOTE (IgorC @ Feb 6 2013, 18:03) *
The OP was asking about audio streamed over ASIO, which does not involve conversion to analogue at any point.
Go to the top of the page
+Quote Post
benski
post Feb 6 2013, 19:29
Post #5


Winamp Developer


Group: Developer
Posts: 670
Joined: 17-July 05
From: Brooklyn, NY
Member No.: 23375



>> 8
Go to the top of the page
+Quote Post
pdq
post Feb 6 2013, 19:57
Post #6





Group: Members
Posts: 3394
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



QUOTE (db1989 @ Feb 6 2013, 13:07) *
QUOTE (IgorC @ Feb 6 2013, 18:03) *
The OP was asking about audio streamed over ASIO, which does not involve conversion to analogue at any point.

I think that IgorC was just trying to point out that it doesn't matter how you get from 32 to 24 bits because the DAC noise will swamp any differences.
Go to the top of the page
+Quote Post
db1989
post Feb 6 2013, 20:22
Post #7





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



QUOTE (pdq @ Feb 6 2013, 18:57) *
I think that IgorC was just trying to point out that it doesn't matter how you get from 32 to 24 bits because the DAC noise will swamp any differences.
OK, but that should be made clear, and anyway, that fact doesn’t negate the original question on a technical level.

QUOTE (benski @ Feb 6 2013, 18:29) *
>> 8
An even more abstract post, which, for readers not privy to the arithmetical operators of C and C++, represents a calculation that shifts an input number 8 bits to the right, discarding each least significant bit that is pushed out.
Go to the top of the page
+Quote Post
DVDdoug
post Feb 6 2013, 21:02
Post #8





Group: Members
Posts: 2568
Joined: 24-August 07
From: Silicon Valley
Member No.: 46454



I suppose the details are up to the programmer, but I'd assume that it's usually the equivalent of truncation. (And, values that go over 0dB are normally clipped.(

32-bit is normaly floating point and 24-bit is normally integer. The waveform is represented/calibrated differently and it's not as simple as truncating "extra bits". With floating point, some bits are used for the mantissa and some bits are used for the exponent.

With 32-bit floating-point, 0dB is "calibrated" as +/-1.0, which means that unless you go over 0dB, the values are always fractional values less than (or equal to) one.

With 24-bit integer, 0dB is +8,388,352 or -8,388,353 and of course integers can never be fractional values.

This post has been edited by DVDdoug: Feb 6 2013, 21:04
Go to the top of the page
+Quote Post
pdq
post Feb 6 2013, 21:43
Post #9





Group: Members
Posts: 3394
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



QUOTE (DVDdoug @ Feb 6 2013, 15:02) *
With 24-bit integer, 0dB is +8,388,352 or -8,388,353 and of course integers can never be fractional values.

Wouldn't that be -8388608 to 8388607?
Go to the top of the page
+Quote Post
phofman
post Feb 6 2013, 23:16
Post #10





Group: Members
Posts: 300
Joined: 14-February 12
Member No.: 97162



QUOTE (amiti @ Feb 6 2013, 19:10) *
When streaming an audio data of 32bit to a 24bit capable soundcard via ASIO, how does the hardware/drivers handle it? Are the excess bits truncated or dithered?

(I use ESI Juli@ souncard)


Juli uses Envy24 which communicates with the PC (DMA to/from RAM) in S32_LE i.e. signed int 32 bits. On the I2S side (codecs) it outputs signed int 24 bits. It just truncates one byte, no dither (which makes perfect sense).
Go to the top of the page
+Quote Post
DVDdoug
post Feb 6 2013, 23:53
Post #11





Group: Members
Posts: 2568
Joined: 24-August 07
From: Silicon Valley
Member No.: 46454



QUOTE (pdq @ Feb 6 2013, 12:43) *
QUOTE (DVDdoug @ Feb 6 2013, 15:02) *
With 24-bit integer, 0dB is +8,388,352 or -8,388,353 and of course integers can never be fractional values.

Wouldn't that be -8388608 to 8388607?


ohmy.gif I guess I goofed-up my calculations... Somewhere around 8 million seemed about right... I forgot to use my usual procedure- "Calculate twice and take an average" biggrin.gif
Go to the top of the page
+Quote Post
Arnold B. Kruege...
post Feb 7 2013, 12:18
Post #12





Group: Members
Posts: 3705
Joined: 29-October 08
From: USA, 48236
Member No.: 61311



QUOTE (amiti @ Feb 6 2013, 12:10) *
When streaming an audio data of 32bit to a 24bit capable soundcard via ASIO, how does the hardware/drivers handle it? Are the excess bits truncated or dithered?

(I use ESI Juli@ souncard)


This question has only intellectual value, because in the real world it all sounds the same whether the conversion is raw truncation, dithered or rounded.

The answer is that how this is done in any particular case is application-dependent. You'd have to read the software source code or have someone do it for you.
Go to the top of the page
+Quote Post
2Bdecided
post Feb 7 2013, 13:00
Post #13


ReplayGain developer


Group: Developer
Posts: 5110
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



See related thread...
http://www.hydrogenaudio.org/forums/index....c=99259&hl=
Go to the top of the page
+Quote Post
nu774
post Feb 7 2013, 13:25
Post #14





Group: Developer
Posts: 525
Joined: 22-November 10
From: Japan
Member No.: 85902



Simple right shift results in tiny negative DC offset, but this can be easily killed by the following (this is equivalent to adding 0.5 on float->int rounding):
CODE
(sample + 128) >> 8

However, as a result of addition, the resulting value can exceed maximum value in the target bits.
Therefore, some kind of saturated arithmetic (clipping) is required.
Go to the top of the page
+Quote Post
amiti
post Feb 12 2013, 02:57
Post #15





Group: Members
Posts: 152
Joined: 1-January 05
Member No.: 18746



Thanks for all the help and information.

QUOTE (IgorC @ Feb 6 2013, 20:03) *
http://en.wikipedia.org/wiki/Digital-to-analog_converter

QUOTE
Noise is ultimately limited by the thermal noise generated by passive components such as resistors. For audio applications and in room temperatures, such noise is usually a little less than 1 μV (microvolt) of white noise. This limits performance to less than 20~21 bits even in 24-bit DACs.


Theoretically then , would it be best to dither audio stream to 20-21 bits , depending on the noise floor of the specific audio hardware?
Go to the top of the page
+Quote Post
saratoga
post Feb 12 2013, 04:57
Post #16





Group: Members
Posts: 4926
Joined: 2-September 02
Member No.: 3264



QUOTE (amiti @ Feb 11 2013, 20:57) *
Thanks for all the help and information.

QUOTE (IgorC @ Feb 6 2013, 20:03) *
http://en.wikipedia.org/wiki/Digital-to-analog_converter

QUOTE
Noise is ultimately limited by the thermal noise generated by passive components such as resistors. For audio applications and in room temperatures, such noise is usually a little less than 1 μV (microvolt) of white noise. This limits performance to less than 20~21 bits even in 24-bit DACs.


Theoretically then , would it be best to dither audio stream to 20-21 bits , depending on the noise floor of the specific audio hardware?


If you are limited by thermal noise, adding more noise doesn't do anything except make the signal more noisy.
Go to the top of the page
+Quote Post
phofman
post Feb 12 2013, 10:16
Post #17





Group: Members
Posts: 300
Joined: 14-February 12
Member No.: 97162



I guess that is why dither is recommended for decimation down to 16 bits, not 24 bits. And that is why envy24 just truncates the 32bit DMA input sample to 24bit for I2S without any shame smile.gif
Go to the top of the page
+Quote Post
amiti
post Feb 12 2013, 14:28
Post #18





Group: Members
Posts: 152
Joined: 1-January 05
Member No.: 18746



QUOTE (saratoga @ Feb 12 2013, 05:57) *
QUOTE (amiti @ Feb 11 2013, 20:57) *
Thanks for all the help and information.

QUOTE (IgorC @ Feb 6 2013, 20:03) *
http://en.wikipedia.org/wiki/Digital-to-analog_converter

QUOTE
Noise is ultimately limited by the thermal noise generated by passive components such as resistors. For audio applications and in room temperatures, such noise is usually a little less than 1 μV (microvolt) of white noise. This limits performance to less than 20~21 bits even in 24-bit DACs.


Theoretically then , would it be best to dither audio stream to 20-21 bits , depending on the noise floor of the specific audio hardware?


If you are limited by thermal noise, adding more noise doesn't do anything except make the signal more noisy.


If thermal noise of hardware masks low level data from , let's say, the 21th bit and higher, digital dither could add noise at 20th bit and rescue some micro-detail before it is masked and lost. Isn't this correct?

Go to the top of the page
+Quote Post
pdq
post Feb 12 2013, 15:34
Post #19





Group: Members
Posts: 3394
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



I'm afraid that you are completely missing the point of dither.

Dither does not improve existing sound. What it does is make the noise that is added by downsampling less objectionable by making it less correlated to the signal.

If you have noise at the 21 bit level and you are going to downsample to 16 bits then you dither. If you are only downsampling to 20 bits then dither is questionable. If you are going to play the 24 bit data intact then the 21 bit noise that is present is already uncorrelated with the signal so adding more uncorrelated noise will only make it noisier.
Go to the top of the page
+Quote Post
Arnold B. Kruege...
post Feb 12 2013, 15:41
Post #20





Group: Members
Posts: 3705
Joined: 29-October 08
From: USA, 48236
Member No.: 61311



QUOTE (amiti @ Feb 12 2013, 08:28) *
QUOTE (saratoga @ Feb 12 2013, 05:57) *
QUOTE (amiti @ Feb 11 2013, 20:57) *
Thanks for all the help and information.

QUOTE (IgorC @ Feb 6 2013, 20:03) *
http://en.wikipedia.org/wiki/Digital-to-analog_converter

QUOTE
Noise is ultimately limited by the thermal noise generated by passive components such as resistors. For audio applications and in room temperatures, such noise is usually a little less than 1 μV (microvolt) of white noise. This limits performance to less than 20~21 bits even in 24-bit DACs.


Theoretically then , would it be best to dither audio stream to 20-21 bits , depending on the noise floor of the specific audio hardware?


If you are limited by thermal noise, adding more noise doesn't do anything except make the signal more noisy.


If thermal noise of hardware masks low level data from , let's say, the 21th bit and higher, digital dither could add noise at 20th bit and rescue some micro-detail before it is masked and lost. Isn't this correct?



This is a moot conversation because AFAIK there are no real-world recordings with a noise floor that is even 16 bits down. Typical is around 12 bits, and SOTA is 14 bits.

Thermal and acoustical noise do a fine job of dithering, they just need to be a bit (figuratively) larger than optimally shaped TPDF dither.

The worst case program material for bit reduction is digital black. You always scale your dither to deal with just that. IOW about 1 LSB at the reduced word length.

There is a line of thought that goes like this - I've got 24 bit data but I'm worried that it is going to be converted to 16 bits without dither so I'll add the right amount of dither to cover that eventuality. This may sound stupid but in the real world it does no harm because the noise floor of the program material is always even worse than that!
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 2nd September 2014 - 20:46