# Quantization (signal processing)

﻿
Quantization (signal processing)

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.
Discrete signals (a common mathematical model) need not be quantized, which can be a point of confusion. "See ideal sampler."

A common use of quantization is in the conversion of a discrete signal (a sampled continuous signal) into a digital signal by quantizing.Both of these steps (sampling and quantizing) are performed in analog-to-digital converters with the quantization level specified in 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 (i.e. $2^\left\{16\right\}$) possible values per sample.

In electronics, adaptive quantization is a quantization process that varies the step size based on the changes of the input signal, as a means of efficient compression.Two approaches commonly used are forward adaptive quantization and backward adaptive quantization.

Mathematical description

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

:$Q\left(x\right) = g\left(lfloor f\left(x\right) floor\right)$

where
* $x$ is a real number to be quantized,
* $lfloor cdot floor$ is the floor function, yielding an integer result $i = lfloor f\left(x\right) floor$ that is sometimes referred to as the "quantization index",
* $f\left(x\right)$ and $g\left(i\right)$ are arbitrary real-valued functions.

The integer-valued quantization index $i$ is the representation that is typically stored or transmitted, and then the final interpretation is constructed using $g\left(i\right)$ when the data is later interpreted.

In computer audio and most other applications, a method known as "uniform quantization" is the most common. There are two common variations of uniform quantization, called "mid-rise" and "mid-tread" uniform quantizers.

If $x$ is a real-valued number between -1 and 1, a mid-rise uniform quantization operator that uses "M" bits of precision to represent each quantization index can be expressed as

:$Q\left(x\right) = frac\left\{leftlfloor 2^\left\{M-1\right\}x ight floor+0.5\right\}\left\{2^\left\{M-1$.

In this case the $f\left(x\right)$ and $g\left(i\right)$ operators are just multiplying scale factors (one multiplier being the inverse of the other) along with an offset in "g"("i") function to place the representation value in the middle of the input region for each quantization index. The value $2^\left\{-\left(M-1\right)\right\}$ 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 $x$ or high $M$) and further 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 (SNR) of the quantization can be computed as

:$frac\left\{S\right\}\left\{N_q\right\} approx 20 log_\left\{10\right\}\left(2^M\right)=6.0206 M operatorname\left\{dB\right\}$.

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

For mid-tread uniform quantization, the offset of 0.5 would be added within the floor function instead of outside of it.

Sometimes, mid-rise quantization is used without adding the offset of 0.5. This reduces the signal to noise ratio by approximately 6.02 dB, but may be acceptable for the sake of simplicity when the step size is small.

In digital telephony, two popular quantization schemes are the 'A-law' (dominant in Europe) and '&mu;-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. In many cases, 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. In some compression schemes, like MP3 or Vorbis, compression is also achieved by selectively discarding some data, an action that can be analyzed as a quantization process (e.g., a vector quantization process) or can be considered a different kind of lossy process.

One example of a lossy compression scheme that uses quantization is JPEG image compression.During JPEG encoding, the data representing an image (typically 8-bits for each of three color components per pixel) 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 to the typical 24 bits per pixel needed prior to JPEG compression).Even the original representation using 24 bits per pixel requires quantization for its PCM sampling structure.

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 $2^M$ in the above example).

In order to determine how many bits are necessary to effect a given precision, algorithms are used. Suppose, for example, that it is necessary to record six significant digits, that is to say, millionths. The number of values that can be expressed by N bits is equal to two to the Nth power. To express six decimal digits, the required number of bits is determined by rounding (6 / log 2)where log refers to the base ten, or common, logarithmup to the nearest integer. Since the logarithm of 2, base ten, is approximately 0.30102, the required number of bits is then given by (6 / 0.30102), or 19.932, rounded up to the nearest integer, "viz.", 20 bits.

This type of quantizationwhere a set of binary digits, "e.g.", an arithmetic register in a CPU, are used to represent a quantityis called Vernier quantization. It is also possible, although rather less efficient, to rely upon equally spaced quantization levels. This is only practical when a small range of values is expected to be captured: for example, a set of eight possible values requires eight equally spaced quantization levelswhich is not unreasonable, although obviously less efficient than a mere trio of binary digits (bits)but a set of, say, sixty-four possible values, requiring sixty-four equally spaced quantization levels, can be expressed using only six bits, which is obviously far more efficient.

Relation to quantization in nature

At the most fundamental level, some physical quantities are quantized. This is a result of quantum mechanics (see Quantization (physics)). Signals may be treated as continuous for mathematical simplicity by considering the small quantizations as negligible.

In any practical application, this inherent quantization is irrelevant for two reasons. First, it is overshadowed by signal noise, the intrusion of extraneous phenomena present in the system upon the signal of interest. The second, which appears only in measurement applications, is the inaccuracy of instruments. Thus, although all physical signals are intrinsically quantized, the error introduced by modeling them as continuous is vanishingly small.

ee also

* Analog-to-digital converter, Digital-to-analog converter
* Quantization error, Quantization noise
* Companding
* discrete signal, Digital, Discretization
* Dither
* Information theory
* Rate distortion theory
* Vector quantization

* [http://www.dsprelated.com/comp.dsp/keyword/Quantization.php Quantization threads in Comp.DSP]
* [http://www.dsplog.com/2007/03/19/signal-to-quantization-noise-in-quantized-sinusoidal/ Signal to quantization noise in quantized sinusoidal] - Analysis of quantization error on a sine wave

Wikimedia Foundation. 2010.

### Look at other dictionaries:

• Quantization (sound processing) — In 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. This article describes aspects of… …   Wikipedia

• Signal processing — is an area of systems engineering, electrical engineering and applied mathematics that deals with operations on or analysis of signals, in either discrete or continuous time. Signals of interest can include sound, images, time varying measurement …   Wikipedia

• Sampling (signal processing) — Signal sampling representation. The continuous signal is represented with a green color whereas the discrete samples are in blue. In signal processing, sampling is the reduction of a continuous signal to a discrete signal. A common example is the …   Wikipedia

• Digital signal processing — (DSP) is concerned with the representation of discrete time signals by a sequence of numbers or symbols and the processing of these signals. Digital signal processing and analog signal processing are subfields of signal processing. DSP includes… …   Wikipedia

• Audio signal processing — Audio signal processing, sometimes referred to as audio processing, is the intentional alteration of auditory signals, or sound. As audio signals may be electronically represented in either digital or analog format, signal processing may occur in …   Wikipedia

• Quantization — is the procedure of constraining something from a continuous set of values (such as the real numbers) to a discrete set (such as the integers). Quantization in specific domains is discussed in:* Quantization (signal processing) ** Quantization… …   Wikipedia

• Signal-to-noise ratio — For signal to noise ratio in statistics, see Cohen s d. Signal to noise ratio (often abbreviated SNR or S/N) is a measure used in science and engineering that compares the level of a desired signal to the level of background noise. It is defined… …   Wikipedia

• Quantization error — The difference between the actual analog value and quantized digital value due is called quantization error. This error is due either to rounding or truncation.Many physical quantities are actually quantized by physical entities. Examples of… …   Wikipedia

• Signal (electrical engineering) — In the fields of communications, signal processing, and in electrical engineering more generally, a signal is any time varying or spatial varying quantity. In the physical world, any quantity measurable through time or over space can be taken as… …   Wikipedia

• Digital Signal 1 — (DS1, sometimes DS 1) is a T carrier signaling scheme devised by Bell Labs.[1] DS1 is a widely used standard in telecommunications in North America and Japan to transmit voice and data between devices. E1 is used in place of T1 outside North… …   Wikipedia