Skip to main content

Topic: 32bit output into 24bit capable soundcard. How bitdepth is converted i (Read 4237 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • amiti
  • [*][*][*]
32bit output into 24bit capable soundcard. How bitdepth is converted i
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)

  • IgorC
  • [*][*][*][*][*]
32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #1
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.

  • pdq
  • [*][*][*][*][*]
32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #2
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.

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #3
http://en.wikipedia.org/wiki/Digital-to-analog_converter
The OP was asking about audio streamed over ASIO, which does not involve conversion to analogue at any point.

  • benski
  • [*][*][*][*][*]
  • Developer
32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #4
>> 8

  • pdq
  • [*][*][*][*][*]
32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #5
http://en.wikipedia.org/wiki/Digital-to-analog_converter
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.

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #6
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.

  • DVDdoug
  • [*][*][*][*][*]
32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #7
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.
  • Last Edit: 06 February, 2013, 03:04:11 PM by DVDdoug

  • pdq
  • [*][*][*][*][*]
32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #8
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?

  • phofman
  • [*][*][*][*]
32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #9
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).

  • DVDdoug
  • [*][*][*][*][*]
32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #10
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?


    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"

32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #11
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.

  • 2Bdecided
  • [*][*][*][*][*]
  • Developer
32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #12

  • nu774
  • [*][*][*][*][*]
  • Developer
32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #13
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: [Select]
(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.

  • amiti
  • [*][*][*]
32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #14
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?

  • saratoga
  • [*][*][*][*][*]
32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #15
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.

  • phofman
  • [*][*][*][*]
32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #16
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

  • amiti
  • [*][*][*]
32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #17
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?


  • pdq
  • [*][*][*][*][*]
32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #18
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.

32bit output into 24bit capable soundcard. How bitdepth is converted i
Reply #19
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!