What is digital gain, and when should I worry about it?
Apr 16, 2021 at 1:09 PM Post #2 of 7
You should always worry about digital gain if you want to increase it. If you don't know what clipping is and how to avoid it then don't do it. Reducing digital gain can sometimes increase noise and distortion but it's not going to noticable unless you really overdo it (think of like -40~-50dB gain). A properly implemented digital volume control won't increase either noise or distortion even if you decided to apply insane amounts of negative gain for some reason.

I'll spare you from my explanation of how digital gain works, I already tried to do that in an other topic but it ended up being too convoluted. Maybe someone else can do it in a clear and concise way.
 
Apr 16, 2021 at 1:55 PM Post #3 of 7
You should always worry about digital gain if you want to increase it. If you don't know what clipping is and how to avoid it then don't do it. Reducing digital gain can sometimes increase noise and distortion but it's not going to noticable unless you really overdo it (think of like -40~-50dB gain). A properly implemented digital volume control won't increase either noise or distortion even if you decided to apply insane amounts of negative gain for some reason.

I'll spare you from my explanation of how digital gain works, I already tried to do that in an other topic but it ended up being too convoluted. Maybe someone else can do it in a clear and concise way.
Basically, if I wanna convert an audio file format to another, I shouldn't change the volume to avoid digital gain right?
 
Apr 16, 2021 at 2:10 PM Post #4 of 7
Basically, if I wanna convert an audio file format to another, I shouldn't change the volume to avoid digital gain right?
Oh, so that's why you asked. I've heard that some bad encoders can clip the signal if you don't apply a tiny amount of negative gain to the file before the conversion. I have never noticed this problem, with the encoders I use, I never came across clipping. I think your files should convert just fine without any kind of preprocessing like changing the volume if your encoders are up to date.
 
Last edited:
Apr 16, 2021 at 3:03 PM Post #5 of 7
Oh, so that's why you asked. I've heard that some bad encoders can clip the signal if you don't apply a tiny amount of negative gain to the file before the conversion. I have never noticed this problem, with the encoders I use, I never came across clipping. I think your files should convert just fine without any kind of preprocessing like changing the volume if your encoders are up to date.
I don't think there's any preprocessing involved, i.e changing the volume. The option for volume change is there, but I don't think I should tamper with that. Also, what do you mean by "clipping the signal"? I'm a newbie here, so I don't know a lot of audio terms.
 
Apr 16, 2021 at 4:13 PM Post #6 of 7
A bit simplified: a digital signal is a sequence of numbers. For example numbers of 16 bits in a 16 bit PCM signal. A 16 bit (2's compliment to allow negative values) number can have any integer value in the range -32768 .. +32767. Lowering the gain corresponds to multiplying all those numbers in the signal with some positive constant c<1. Raising the gain corresponds to multiplying all those numbers with some constant c>1. Now maybe you see the problem: the outcome of such a multiplication could be a number or numbers outside the allowed range (and at best the max or min value is used, or the extra bit or bits that would have been needed to represent the out of range number is simply ignored and an even less appropiate number is used resulting in a severely distorted waveform). That is (one form) of digital clipping. (In fact there can already be a problem before you get numbers outside the range, intersample clipping I think it is called, but never mind that for now).
 
May 1, 2021 at 10:05 AM Post #7 of 7
I've heard that some bad encoders can clip the signal if you don't apply a tiny amount of negative gain to the file before the conversion.
AFAIK every lossy codec can clip if the decoder outputs integer samples. Lossy codec by definition changes a waveform. Changing the waveform means that some samples will get smaller and some will get bigger. If those samples that get bigger were already near or at 0 dBFS, now they will be above 0 dBFS.
 

Users who are viewing this thread

Back
Top