View Single Post
  #20 (permalink)  
Old May 20th 06, 08:28 AM posted to uk.rec.audio
Jim Lesurf
external usenet poster
 
Posts: 3,051
Default Digital volume control question....

In article , John Phillips
wrote:
On 2006-05-19, Serge Auckland wrote:
Ian Iveson wrote:

The DSP solution would appear to be preferable. However, presumably
there are rounding errors. That is, if I divide every word by a
constant, each result must be rounded to the nearest step, and this
rounding error is not linear wrt the audio signal. I assume there is
a name for this kind of error? How significant is it?


The DSP solutions I'm familiar with operate either floating point or
32 or 48 bit internal which means that when the output is finally
reduced to 16 or 24 bit the errors from the DSP calculations are
minimised. I don't know of a specific name for the errors resulting
from DSP operation.


I have tended to see it called by various terms from "quantisation error"
and "truncation error" to "we''ll ignore this..." :-)

I guess a digital volume control can just be a single fixed-point
multiply.


If you have (for example) a 16-bit coefficient and multiply by the
16-bit audio value you get a 32-bit result.


Yes. In principle you can do that. Indeed, I think that many consumer chips
simply use such 'extended' int values for processing in places like the
digital filtering.

Growth in significant bits is typical of DSP actions such as add and
multiply. If you just truncate the result back to 16 bits you do indeed
find that the quantization error you introduce is correlated with the
signal. It is significant and sounds bad at low levels.


In a good DSP (volume control) the remedy is to keep all significant
bits throughout the entire operation (or at least keep enough) and add
dither noise before you finally truncate back to the desired word size.
The random dither de-correlates the quantization error from the signal.


I assume that's what good DSP volume controls do.


Dither will certainly help avoid such problems. However you can also employ
noise shaping. This essentially 'remembers' the quantisation errors and
redistibutes the information. The result is to provide output signal
pattern details which can be below the LSB, so helping to evade the
problem. Again, I think that many consumer chips do this were appropriate
as it is easy to build into the silicon.

The snag is that the above is all a matter of the details of
implimentation. Whereas a decent analog attenuator simply uses the
properties of the physical materials to do all this for you. No need for
the makers to work out a noise-shaping anf dithering process and ensure
sufficient precision, etc. :-)

Slainte,

Jim

--
Electronics http://www.st-and.ac.uk/~www_pa/Scot...o/electron.htm
Audio Misc http://www.st-and.demon.co.uk/AudioMisc/index.html
Armstrong Audio http://www.st-and.demon.co.uk/Audio/armstrong.html
Barbirolli Soc. http://www.st-and.demon.co.uk/JBSoc/JBSoc.html