In digital signal processing, quantization is the process of approximating a continuous signal by a set of discrete symbols or integer values; that is, converting an analog signal to a digital one. In general, a quantization operator can be represented as
where x is a real number, Q(x) an integer, and f(x) is an arbitrary real-valued function that controls the "quantization law" of the particular coder.
In computer audio, a linear scale is most common. here f(x) = x-0.5. The quantization operator can therefore be alternately expressed as,
where floor() returns the highest integer less than or equal to x. With this quantization law, the signal-noise ratio can be approximated as
where M is the number of bits being used to code the audio. From this equation, it is often said that the SNR is approximately 6dB per bit.
For example, in digital telephony, two popular quantization schemes are the 'A-law' and 'µ-law', each using a logarithmic scale to map an analog signal to an integer value represented by an 8-bit binary number, but each with a different function f.
See also: