32bit output into 24bit capable soundcard. How bitdepth is converted i |
![]() ![]() |
32bit output into 24bit capable soundcard. How bitdepth is converted i |
Feb 6 2013, 18:10
Post
#1
|
|
|
Group: Members Posts: 142 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) |
|
|
|
Feb 6 2013, 19:03
Post
#2
|
|
|
Group: Members Posts: 1315 Joined: 3-January 05 From: Argentina, Bs As 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.
|
|
|
|
Feb 6 2013, 19:03
Post
#3
|
|
|
Group: Members Posts: 3080 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.
|
|
|
|
Feb 6 2013, 19:07
Post
#4
|
|
|
Group: Super Moderator Posts: 4334 Joined: 23-June 06 Member No.: 32180 |
The OP was asking about audio streamed over ASIO, which does not involve conversion to analogue at any point.
|
|
|
|
Feb 6 2013, 19:29
Post
#5
|
|
|
Winamp Developer Group: Developer Posts: 662 Joined: 17-July 05 From: Ashburn, VA Member No.: 23375 |
>> 8
|
|
|
|
Feb 6 2013, 19:57
Post
#6
|
|
|
Group: Members Posts: 3080 Joined: 1-September 05 From: SE Pennsylvania Member No.: 24233 |
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. |
|
|
|
Feb 6 2013, 20:22
Post
#7
|
|
|
Group: Super Moderator Posts: 4334 Joined: 23-June 06 Member No.: 32180 |
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.>> 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.
|
|
|
|
Feb 6 2013, 21:02
Post
#8
|
|
|
Group: Members Posts: 2114 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 |
|
|
|
Feb 6 2013, 21:43
Post
#9
|
|
|
Group: Members Posts: 3080 Joined: 1-September 05 From: SE Pennsylvania Member No.: 24233 |
|
|
|
|
Feb 6 2013, 23:16
Post
#10
|
|
|
Group: Members Posts: 140 Joined: 14-February 12 Member No.: 97162 |
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). |
|
|
|
Feb 6 2013, 23:53
Post
#11
|
|
|
Group: Members Posts: 2114 Joined: 24-August 07 From: Silicon Valley Member No.: 46454 |
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? |
|
|
|
Feb 7 2013, 12:18
Post
#12
|
|
![]() Group: Members Posts: 3212 Joined: 29-October 08 From: USA, 48236 Member No.: 61311 |
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. |
|
|
|
Feb 7 2013, 13:00
Post
#13
|
|
![]() ReplayGain developer Group: Developer Posts: 4586 Joined: 5-November 01 From: Yorkshire, UK Member No.: 409 |
See related thread...
http://www.hydrogenaudio.org/forums/index....c=99259&hl= |
|
|
|
Feb 7 2013, 13:25
Post
#14
|
|
![]() Group: Developer Posts: 295 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. |
|
|
|
Feb 12 2013, 02:57
Post
#15
|
|
|
Group: Members Posts: 142 Joined: 1-January 05 Member No.: 18746 |
Thanks for all the help and information.
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? |
|
|
|
Feb 12 2013, 04:57
Post
#16
|
|
|
Group: Members Posts: 4131 Joined: 2-September 02 Member No.: 3264 |
Thanks for all the help and information. 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. |
|
|
|
Feb 12 2013, 10:16
Post
#17
|
|
|
Group: Members Posts: 140 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
|
|
|
|
Feb 12 2013, 14:28
Post
#18
|
|
|
Group: Members Posts: 142 Joined: 1-January 05 Member No.: 18746 |
Thanks for all the help and information. 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? |
|
|
|
Feb 12 2013, 15:34
Post
#19
|
|
|
Group: Members Posts: 3080 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. |
|
|
|
Feb 12 2013, 15:41
Post
#20
|
|
![]() Group: Members Posts: 3212 Joined: 29-October 08 From: USA, 48236 Member No.: 61311 |
Thanks for all the help and information. 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! |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 20th May 2013 - 14:05 |