Quantization (signal processing)

This is an old revision of this page, as edited by Cat5nap (talk | contribs) at 18:35, 5 May 2005 (Refining compression application description; fixing math formula error; removing oversimplification of focus on zero values). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In digital signal processing, quantization is the process of approximating a continuous range of values (or a very large set of possible discrete values) by a relatively-small set of discrete symbols or integer values. More specifically, a signal can be multi-dimensional and quantization need not be applied to all dimensions. A discrete signal need not necessarily be quantized (a pedantic point, but true nonetheless and can be a point of confusion). See ideal sampler.

File:FloorQuantizer.png
Quantization of x using Q(x) = floor(Lx)/L.

A common use of quantization is in the conversion of a continuous signal into a discrete signal by sampling and then quantizing. Both of these steps are performed in analog-to-digital converters with the quantization level specified by a number of bits. A specific example would be compact disc (CD) audio which is sampled at 44,100 Hz and quantized with 16 bits (2 bytes) which can be one of 65,536 () possible values per sample.

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

where is a real number, is an integer, and and are arbitrary real-valued functions. The integer value is the representation that is typically stored or transmitted, and then the final interpretation is constructed using when the data is later interpreted. The integer value is sometimes referred to as the quantization index.

In computer audio and most other applications, a method known as uniform quantization is the most common. If is a real valued number between -1 and 1, a uniform quantization operator that uses M bits of precision to represent each quantization index can be expressed as

.

In this case the and operators are just multiplying scale factors (one multiplier being the inverse of the other). The value is often referred to as the quantization step size. Using this quantization law and assuming that quantization noise is approximately uniformly distributed over the quantization step size (an assumption typically accurate for rapidly varying or high ) and assuming that the input signal to be quantized is approximately uniformly distributed over the entire interval from -1 to 1, the signal to noise ratio (SNR) of the quantization can be computed as

.

From this equation, it is often said that the SNR is approximately 6 dB per bit.

In digital telephony, two popular quantization schemes are the 'A-law' (dominant in Europe) and 'µ-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 increases 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.

Quantization and Data Compression

Quantization plays a major part in lossy data compression. Indeed, quantization can be viewed as the fundamental element that distinguishes lossy data compression from lossless data compression, and the use of quantization is nearly always motivated by the need to reduce the amount of data needed to represent a signal.

One example of such lossy a compression scheme is JPEG compression. During JPEG encoding, the data representing an image (typically 8-bits for each of three color components per pixel ___location) is processed using a discrete cosine transform and is then quantized and entropy coded. By reducing the precision of the transformed values using quantization, the number of bits needed to represent the image can be reduced substantially. For example, images can often be represented with acceptable quality using JPEG at less than 3 bits per pixel (as opposed the the typical 24 bits per pixel needed prior to JPEG compression). Indeed, even the original representation using 24 bits per pixel requires quantization for its PCM sampling structure.

Compression of other types of data (e.g., audio or video signals) follows very similar principles. For example, MP3 audio coding also involves transformation followed by quantization followed by entropy coding. For video, one additional technique (called motion compensation) is typically employed in addition to the other elements.

In modern compression technology, the entropy of the output of a quantizer matters more than the number of possible values of its output (the number of values being   in the above example).

See also

Paper on mathematical theory and analysis of quantization