Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Digital volume control and bit-perfectness (Read 24590 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Digital volume control and bit-perfectness

I've been scouring the internet for concrete proof and answers on this question of mine, but I can't find anything solid, so I'm asking you guys. Basically, what I have is a laptop connected via USB to a DAC (the DAC itself is 32-bits, but the USB input only supports 24/192), which is then connected to my preamp and power amp. What happens is that when I have everything set up to be bit-perfect (i.e. all digital volumes at maximum, including foobar, Windows, the DAC output), the volume control on my preamp is too sensitive, which leaves me with volumes 1-6 being too quiet, and 7+ being much too loud. Thus, I was thinking of using ReplayGain/negative gain preamp in foobar to normalize things.

However, I wanted to make sure the digital attenuation being applied by foobar would introduce no audible distortion or noise. I read that foobar's internal processing, including volume control, is done with 32-bits. 99% of my music collection is 16-bit, so does this mean that I'd have 16 bits of possible attenuation (which amounts to 96 dB) before I started degrading the source signal? And in the case of 24-bit files, 8-bits (or 48 dB)? Then, the attenuated signal is converted to 24-bits to be output to my DAC? Or, do I have things mixed up in the signal chain? Is the digital volume control done to the 24-bit output signal instead?

If someone could clarify this for me, I'd much appreciate it. I'd love to be able to have a more comfortable listenable range on my music.

Digital volume control and bit-perfectness

Reply #1
I've been scouring the internet for concrete proof and answers on this question of mine, but I can't find anything solid, so I'm asking you guys. Basically, what I have is a laptop connected via USB to a DAC (the DAC itself is 32-bits, but the USB input only supports 24/192), which is then connected to my preamp and power amp. What happens is that when I have everything set up to be bit-perfect (i.e. all digital volumes at maximum, including foobar, Windows, the DAC output), the volume control on my preamp is too sensitive, which leaves me with volumes 1-6 being too quiet, and 7+ being much too loud. Thus, I was thinking of using ReplayGain/negative gain preamp in foobar to normalize things.

However, I wanted to make sure the digital attenuation being applied by foobar would introduce no audible distortion or noise. I read that foobar's internal processing, including volume control, is done with 32-bits. 99% of my music collection is 16-bit, so does this mean that I'd have 16 bits of possible attenuation (which amounts to 96 dB) before I started degrading the source signal? And in the case of 24-bit files, 8-bits (or 48 dB)? Then, the attenuated signal is converted to 24-bits to be output to my DAC? Or, do I have things mixed up in the signal chain? Is the digital volume control done to the 24-bit output signal instead?

If someone could clarify this for me, I'd much appreciate it. I'd love to be able to have a more comfortable listenable range on my music.

In short don't worry.
24 bits is plenty and the connection you describe supports it fine.  Using the foobar2000 volume control (or ReplayGain) on 16 bit material will result in 24 (or 32) bit data going to you DAC which is what you want.

Digital volume control and bit-perfectness

Reply #2
In short don't worry.
24 bits is plenty and the connection you describe supports it fine.  Using the foobar2000 volume control (or ReplayGain) on 16 bit material will result in 24 (or 32) bit data going to you DAC which is what you want.

But how many bits of headroom do I actually have before I start eating into the original audio bits? Is it the difference between foobar's internal calculations (32-bit) and the output value (24-bit), or the difference between the internal calculations and the file's value (16-bits, and rarely 24-bits)?

Digital volume control and bit-perfectness

Reply #3
But how many bits of headroom do I actually have before I start eating into the original audio bits? Is it the difference between foobar's internal calculations (32-bit) and the output value (24-bit), or the difference between the internal calculations and the file's value (16-bits, and rarely 24-bits)?

Well with 24 bits you have 8 bits with a 16 bit input.  8 bits is roughly 48dB.  On the other hand 24 bits is roughly enough to span the loudness from a single molecule hitting the eardrum to standing in a jet engine exhaust: headroom isn't an issue.  Tho higher accuracy is important for DSP, etc. for this operation 32 bit accuracy is irrelevant.  24 is plenty...  Like I said, it's not a real problem.

Digital volume control and bit-perfectness

Reply #4
Quote
But how many bits of headroom do I actually have before I start eating into the original audio bits? Is it the difference between foobar's internal calculations (32-bit) and the output value (24-bit), or the difference between the internal calculations and the file's value (16-bits, and rarely 24-bits)?
It's really no different than using an analog volume control.  If you reduce analog gain you reduce the signal part of your signal-to-noise ratio, loosing useable resolution.

But, none of this matters as long as you don't re-boost the volume...  For example, if you are listening to 16-bits and you reduce the volume digitally to where there is only one or two bits of resolution, guess what...  You can't hear anything anyway!  And even if you are down to where you are loosing serious resolution but you can still hear something, the quantization noise, distortion, and loss of dynamic range caused by the loss of resolution is so far-below the threshold of hearing that you can't hear the "damage".

Quote
(the DAC itself is 32-bits,
Are you sure about that?    From what I understand, 24-bit DACs are only accurate to about 20 bits.  So, a 32-bit DAC accurate to about 20-bits isn't going to have any advantage.

Digital volume control and bit-perfectness

Reply #5
But how many bits of headroom do I actually have before I start eating into the original audio bits? Is it the difference between foobar's internal calculations (32-bit) and the output value (24-bit), or the difference between the internal calculations and the file's value (16-bits, and rarely 24-bits)?

Well with 24 bits you have 8 bits with a 16 bit input.  8 bits is roughly 48dB.  On the other hand 24 bits is roughly enough to span the loudness from a single molecule hitting the eardrum to standing in a jet engine exhaust: headroom isn't an issue.  Tho higher accuracy is important for DSP, etc. for this operation 32 bit accuracy is irrelevant.  24 is plenty...  Like I said, it's not a real problem.


But then what about the things I've heard about foobar's internal processing being performed in 32-bits? Is that not true?

Quote
But how many bits of headroom do I actually have before I start eating into the original audio bits? Is it the difference between foobar's internal calculations (32-bit) and the output value (24-bit), or the difference between the internal calculations and the file's value (16-bits, and rarely 24-bits)?
It's really no different than using an analog volume control.  If you reduce analog gain you reduce the signal part of your signal-to-noise ratio, loosing useable resolution.

But, none of this matters as long as you don't re-boost the volume...  For example, if you are listening to 16-bits and you reduce the volume digitally to where there is only one or two bits of resolution, guess what...  You can't hear anything anyway!  And even if you are down to where you are loosing serious resolution but you can still hear something, the quantization noise, distortion, and loss of dynamic range caused by the loss of resolution is so far-below the threshold of hearing that you can't hear the "damage".

Quote
(the DAC itself is 32-bits,
Are you sure about that?    From what I understand, 24-bit DACs are only accurate to about 20 bits.  So, a 32-bit DAC accurate to about 20-bits isn't going to have any advantage.


It's an ESS Sabre 9018 32-bit chip, so I'm 100% positive the DAC is capable of 32-bit processing, just not on the USB input.

Digital volume control and bit-perfectness

Reply #6
I already answered that.  For DSP work higher precision than 24 bits can be important.  For lowering volume it can't matter.  Foobar2000 is doing a correct thing (as presumably your DAC is.)

Tho your DAC may indeed use 32 bit math for upsampling/filtering, etc. it's output is no where near a 32 bit accurate.  As was already stated 20 bit accurate DACs are the norm and true 24 bit accuracy is extremely hard to do.

Everything is fine

Digital volume control and bit-perfectness

Reply #7
If you feel better about analog signal reduction, you can use an in-line attenuator between the DAC & preamp, or between your preamp & power amp.  That should give you better use of your analog volume control.

Digital volume control and bit-perfectness

Reply #8
After reading the above responses and looking up the numbers on my DAC, it seems my DAC has a real-world DNR of 135 dB. Being generous and saying my interconnects, preamp, etc. causes a DNR of 130 dB, this gives me a good 21-bits of workable output. Given that foobar apparently performs attenuation in 32-bits, and then quantizes to 24-bits, I'll have 21-16 = 5 bits, or 30 dB of "free" attenuation before I start eating into the actual data of each sample.

Thus, I'll keep my ReplayGain and preamp settings, as nothing in my collection requires anything more than say, -14 dB of ReplayGain. If nobody corrects me on this, I'll be happily on my way.

Digital volume control and bit-perfectness

Reply #9
Bump for a request for clarification. I realized nobody actually answered my question - does foobar apply its digital volume control to the original file at 24-bit or 32-bit resolution?

I.e., assuming I start with a 24/192 song, do I have 8-bits of workable digital attenuation before I start degrading the actual signal, or do I have 0-bits? This is before the signal reaches my DAC so the DAC's performance is irrelevant.

Digital volume control and bit-perfectness

Reply #10
foobar2000 uses floating point. Example:
original 24-bit value: 7048704
attenuated: 459906,28
output, 24-bit integer: 459906


Digital volume control and bit-perfectness

Reply #12
foobar2000 uses floating point. Example:
original 24-bit value: 7048704
attenuated: 459906,28
output, 24-bit integer: 459906


So then foobar2000 uses 32-bits to attenuate, and then requantizes and dithers back down to my output (24-bits)?

Just leaving this here: http://xiph.org/~xiphmont/demo/neil-young.html [ 24/192 Music Downloads are Very Silly Indeed ]


I'm well aware of this article and 99% of my collection is 16/44.1. However, in my experience, 24-bit recordings and SACDs in general seem to have much greater care taken to recording and mastering. In any case, my question was simply to find out how many dB of attenuation I can achieve on both a 16-bit and 24-bit file before I'm no longer just cutting zeroes off.

Digital volume control and bit-perfectness

Reply #13
In any case, my question was simply to find out how many dB of attenuation I can achieve on both a 16-bit and 24-bit file before I'm no longer just cutting zeroes off.
Strictly speaking the difference between the input bit depth and the output bit depth. And very strictly speaking you will only cut off zeroes if the attenuation factor is a (negative) power of two (i.e. shifting bits to less significant places), otherwise you will get rounding errors.

[Edit]And very, very strictly speaking even shifting bits is only lossless if the response of the analog part of your signal path (DAC, amplifier, speakers, ...) is perfectly linear.

Digital volume control and bit-perfectness

Reply #14
In any case, my question was simply to find out how many dB of attenuation I can achieve on both a 16-bit and 24-bit file before I'm no longer just cutting zeroes off.
Strictly speaking the difference between the input bit depth and the output bit depth. And very strictly speaking you will only cut off zeroes if the attenuation factor is a (negative) power of two (i.e. shifting bits to less significant places), otherwise you will get rounding errors.

[Edit]And very, very strictly speaking even shifting bits is only lossless if the response of the analog part of your signal path (DAC, amplifier, speakers, ...) is perfectly linear.


I probably wouldn't be able to hear those errors however, right? I should be fine using replaygain without worrying about distorting the sound, unless I'm using 24 bit songs (I wouldn't be using replaygain anyway for these).

Digital volume control and bit-perfectness

Reply #15
Probably not. This is where you have to test for yourself whether you perceive a difference and what sounds good to you. In case of doubt do what you can do with a reasonable effort to improve the playback quality and then stop worrying and just enjoy the music! At least that is my opinion.

Digital volume control and bit-perfectness

Reply #16
In any case, my question was simply to find out how many dB of attenuation I can achieve on both a 16-bit and 24-bit file before I'm no longer just cutting zeroes off.
With a digital volume control you're almost never "just cutting zeros off". You are always adding more noise or distortion (except when doing an exact divide by two without dither, which is "just cutting zeros off"). The additional noise is so far below the original noise floor as to be inaudible and irrelevant.

I would be slightly worried (though probably without good cause) about only using a fraction of my DAC's range, and very worried about having an overall system gain after the DAC which brought the noise floor of the DAC into the range of audibility. As long as any noise or distortion due to your DAC is well below your threshold of hearing, then whatever a competently designed digital volume control does before this is fine. If the DAC's noise is that high, you need an analogue attenuator (or less gain!) after it. If this means you can't get the system loud enough any more, then the DAC isn't good enough to be used with a digital volume control alone - you need (at least) an analogue "high gain / low gain" setting after it.

Whether your recordings are 16-bit, 24-bit etc is irrelevant. A correctly dithered digital volume control isn't throwing away the lower bits completely, it's just adding noise to them - which is exactly what an analogue pre-amp will do as you turn the volume control down. The stuff that's now too quiet to hear is too quiet to hear - preserving it more accurately or with less noise (same thing) makes no audible difference.


In the digital domain, dividing by 2, 4, 8, 16 etc without dither is the only bit-accurate digital volume control operation. With a 16-bit input and 24-bit output, you can divide by 256 without loss (approx -48dB), but no further. Try attenuating something by 48dB in a audio editor to get a feel for how large a change that is.

Whatever you do, don't put a pristine "audiophile" 16-bit recording into the lowest 16-bits of a 24-bit DAC (e.g. digital volume = -48dB), and then turn the analogue volume up by 48dB. I don't think there are any DACs on the planet good enough to withstand this test.

Cheers,
David.

Digital volume control and bit-perfectness

Reply #17
I'm deciding whether to buy a Behringer UCA-202 or something like an ODAC and have a similar question about digital volume control use. I sometimes use the foobar volume control to about -20DB. With this level of attenuation, is there likely to be any audible benefit to buying a 24bit ODAC as opposed to the (cheaper) 16 bit Behringer? I suspect not, but I'm struggling to get my head around digital volume controls. My music is all 16/44.1.

Sorry to bump an old thread, but this seems a related question. I'll start a new thread if preferred.

Digital volume control and bit-perfectness

Reply #18
You only run into "problems" if your system has too much gain.

Let's assume the noise floor of your 16-bit DAC is at around -90 dB (= 15 bit-ish). If your gain is such that full-scale produces 110 dB SPL then the noise will be at 20 dB SPL.
By using digital attenuation with dither all you basically do is push the signal into that noise floor.
"I hear it when I see it."

Digital volume control and bit-perfectness

Reply #19
I'm well aware of this article and 99% of my collection is 16/44.1. However, in my experience, 24-bit recordings and SACDs in general seem to have much greater care taken to recording and mastering.
I recently got hold of a CD version and stereo BD version of the same album. The CD was OK. The BD version was 24 bit, but also was more compressed and had (at least in my short test unnoticable) clipping. I realize that this is a single data point, but I won't be surprised when I find out that finding well mastered "hi-res" releases is just as hit-and-miss as finding well-mastered CDs. People who think that the "hi-res" nonsense will bring any improvement on the production front are naive. The novelty is that you can 24 bits of clipping now, and 8 more bits for some nice and cozy noise.

People in this thread should be aware that the actual SNR of contemporary releases rarely, if ever, hits the 16 bit mark. Stop worrying about volume control and 16 bit audio and just listen to music that's there. If the loudness war continues we will soon have 8bit audio delivered as 24bit audio.
It's only audiophile if it's inconvenient.

Digital volume control and bit-perfectness

Reply #20
You only run into "problems" if your system has too much gain.

Let's assume the noise floor of your 16-bit DAC is at around -90 dB (= 15 bit-ish). If your gain is such that full-scale produces 110 dB SPL then the noise will be at 20 dB SPL.
By using digital attenuation with dither all you basically do is push the signal into that noise floor.


Thanks. There are measurements of the Behringer here, and it seems your assumption about noise floor is about right http://nwavguy.blogspot.co.uk/2011/02/behr...202-review.html Full scale will be a good bit under 110DB (I listen through a headphone amp with the analogue volume control turned low-ish - so it sounds loud-ish at full scale - and then use the digital control for convenience...110DB is way louder than I'd find comfortable).

If I've read this right, then, I don't need to worry about digital volume controls/higher bit rate DACs in my everyday use?

Digital volume control and bit-perfectness

Reply #21
What are you connecting the DAC to? Or a you driving headphones with it?

But yeah, you probably don't need to worry.
"I hear it when I see it."

Digital volume control and bit-perfectness

Reply #22
What are you connecting the DAC to? Or a you driving headphones with it?

But yeah, you probably don't need to worry.


The Behringer (or other DAC) will go into an Epiphany Audio O2 headphone amp - driving Grado headphones - if that makes a difference?

Digital volume control and bit-perfectness

Reply #23
People in this thread should be aware that the actual SNR of contemporary releases rarely, if ever, hits the 16 bit mark. Stop worrying about volume control and 16 bit audio and just listen to music that's there. If the loudness war continues we will soon have 8bit audio delivered as 24bit audio.

This.

If you listen to any contemporary music and care so much about 16bit noise vs. 24 bit noise then you only waist your time. It was said around 8 years ago, while I was still studying, that contemporary music (pop, rock, country, electronic, hip hop, even many jazz releases) has not more than 12 bits of measured/actual sample resolution. Remaining 4 bits are just zeros in most cases or noise. But some time has passed, loudness war continues and I think we have lost another 1 or 2 bits. Just make some ReplayGain scan on music released between year 2000 and 2015 and see how attenuation values increase from around -6 to -15dB... Other nice test - check bitrate of FLAC files made out of the same tracks - it will also increase as the release year increases. Lossless compression ratio is in inverse proportion to loudness of track (louder track = less compression = higher bitrate). Loudness in general is in inverse proportion to SNR of certain track.

What ALWAYS matter the most are transducers. You can change quality of audio by changing headphones/loudspeakers in your listening room or microphones in studio. Not by applying bitperfectness, which is always painful and inconvenient.

"It's only audiophile if it's inconvenient" © Kohlrabi

Digital volume control and bit-perfectness

Reply #24
The Behringer (or other DAC) will go into an Epiphany Audio O2 headphone amp - driving Grado headphones - if that makes a difference?


Not really, but noise can be heard easier with headphones. Still shouldn't be a problem.
"I hear it when I see it."