R_WARE PORT OF AIRWINDOWS BitShiftGain
WARNING! Output level is increased in steps of 6dB per bit shift! Turning off safety can lead to very high output levels! Handle with care!
AW_BitShiftGain is a port of the Airwindows BitShiftGain. The algorithms have been refined for the VM environment.
TL;DW: The ‘One Weird Trick’ perfect boost/pad, with a catch!
Your waveform is scaled up or down by increments of 6 dB exactly. No 3 db, no 9, no 7 or even 6.001! Only 6 or 12 or 18 and so on, up or down. Select the number of bits you want to shift, and BitShiftGain applies the exact number. And when it does, all the bits shift neatly to the side inside your audio, and whether you lose the smallest and subtlest or gain up and fill it in with a zero… every single sample in your audio is in exactly, EXACTLY the same relative position to the others. Apart from the gain or loss of the smallest bit, there is literally no change to the audio at all: if there was a noise shaping, it would have nothing to work with. Perfection, at exclusively increments of 6 dB. That’s the catch. You probably can’t mix with gain changes that coarse (though it’s tempting to try!) but here’s what you can do: you can take 24-bit dithers, gain down 8 bits in front and 8 bits up after, and have a perfect 16 bit dither. Or a 17 bit, if that pleases you… or shift 16 bits down so you can hear what your dither’s noise floor acts like (we’ll be doing lots of that when I start bringing out the dithers). +-16 bits of gain trim is a very big boost or cut. The overall range of BitShiftGain is huge. But the real magic of BitShiftGain is the sheer simplicity of the concept. Provided your math is truly, rigorously accurate and your implementation’s perfect, gain trim with bit shift is the only way in digital (fixed OR floating point) where you can apply a change, and the word length of your audio doesn’t have to expand, AND every sample which remains in your audio continues to be in exactly the same relation to all the others.
Original: https://www.airwindows.com/bitshiftgain/