[[Image:FloorQuantizer.png|right|frame|Quantization of ''x'' using ''Q(x)'' = floor(''Lx'')/''L''.]]
In [[digital signal processing]], '''quantization''' is the process of approximating a continuous signal (or a very large set of possible discrete values) by a relatively-small set of discrete symbols or integer values;. thatA common application of quantization is, convertingthe conversion of an [[analog]] signal to a [[digital]] one via [[analog-to-digital converter|analog-to-digital conversion]]. The simplest and best-known form of quantization is referred to as ''scalar'' quantization, since it operates on scalar (as opposed to multi-dimensional vector) input data. In general, a scalar quantization operator can be represented as
In general, a quantization operator can be represented as
:<math>Q(x) = g(\operatorname{round}(f(x)))</math>
where ''x'' is a real number, ''Qi'' = round(''f''(''x'')) is an integer, and ''f''(''x'') isand an''g''(''i'') are arbitrary real-valued functionfunctions. The integer value ''i'' = round(''f''(''x'')) is the representation that controlsis typically stored or transmitted, and then the "quantizationfinal law"interpretation ofis constructed using ''g''(''i'') when the particulardata coderis later interpreted. The integer value ''i'' is sometimes referred to as the ''quantization index''.
In computer audio and most other applications, a linearmethod scaleknown as ''uniform quantization'' is the most common. If ''x'' is a real valued number between -1 and 1, thea uniform quantization operator canthat thereforeuses be''M'' alternatelybits of two's complement precision to represent each quantization index can be expressed as,
:<math>Q(x) = \frac{\operatorname{round}(2^{M-1}x)}{2^{M-1}}</math>.
whereIn Mthis iscase the number''f''(''x'') and ''g''(''i'') operators are just multiplying scale factors (one multiplier being the inverse of bitsthe other). The value <math>2^{-(M-1)}</math> is often usedreferred to quantizeas the value''quantization step size''. Using this quantization law and assuming that quantization noise is approximately [[uniform distribution|uniformly distributed]] over the quantization step size (an assumption typically accurate for rapidly varying ''x'' or high ''M'') and assuming that the input signal ''x'' to be quantized is approximately uniformly distributed over the entire interval from -1 to 1, the [[signal to noise ratio]] of the quantization can be approximatedcomputed as
:<math>\frac{S}{N_q} \approx 20 \operatorname{log}_{10}(2^M) = 6.02M0206M + 1.76)\operatorname{dB}</math>.
From this equation, it is often said that the SNR is approximately 6dB6 dB per bit.
In digital [[telephone|telephony]], two popular quantization schemes are the '[[A-law algorithm|A-law]]' (dominant in [[Europe]]) and '[[Mu-law algorithm|µ-law]]' (dominant in [[North America]] and [[Japan]]). These schemes map discrete analog values to an 8 bit scale that is nearly linear for small values and then increaseincreases logarithmically as amplitude grows. Because the human ear's perception of [[loudness]] is roughly logarithmic, this provides a higher signal to noise ratio over the range of audible sound intensities for a given number of bits.
==See also==
|