<s>
Quantization	B-Algorithm
,	O
in	O
mathematics	O
and	O
digital	B-General_Concept
signal	I-General_Concept
processing	I-General_Concept
,	O
is	O
the	O
process	O
of	O
mapping	O
input	O
values	O
from	O
a	O
large	O
set	O
(	O
often	O
a	O
continuous	O
set	O
)	O
to	O
output	O
values	O
in	O
a	O
(	O
countable	O
)	O
smaller	O
set	O
,	O
often	O
with	O
a	O
finite	O
number	B-Application
of	I-Application
elements	I-Application
.	O
</s>
<s>
Rounding	B-Algorithm
and	O
truncation	B-Algorithm
are	O
typical	O
examples	O
of	O
quantization	B-Algorithm
processes	O
.	O
</s>
<s>
Quantization	B-Algorithm
is	O
involved	O
to	O
some	O
degree	O
in	O
nearly	O
all	O
digital	B-General_Concept
signal	I-General_Concept
processing	I-General_Concept
,	O
as	O
the	O
process	O
of	O
representing	O
a	O
signal	O
in	O
digital	O
form	O
ordinarily	O
involves	O
rounding	B-Algorithm
.	O
</s>
<s>
Quantization	B-Algorithm
also	O
forms	O
the	O
core	O
of	O
essentially	O
all	O
lossy	B-Algorithm
compression	I-Algorithm
algorithms	O
.	O
</s>
<s>
The	O
difference	O
between	O
an	O
input	O
value	O
and	O
its	O
quantized	O
value	O
(	O
such	O
as	O
round-off	B-Algorithm
error	I-Algorithm
)	O
is	O
referred	O
to	O
as	O
quantization	B-Algorithm
error	O
.	O
</s>
<s>
A	O
device	O
or	O
algorithmic	O
function	O
that	O
performs	O
quantization	B-Algorithm
is	O
called	O
a	O
quantizer	B-Algorithm
.	O
</s>
<s>
An	O
analog-to-digital	O
converter	O
is	O
an	O
example	O
of	O
a	O
quantizer	B-Algorithm
.	O
</s>
<s>
For	O
example	O
,	O
rounding	B-Algorithm
a	O
real	O
number	O
to	O
the	O
nearest	B-Algorithm
integer	I-Algorithm
value	O
forms	O
a	O
very	O
basic	O
type	O
of	O
quantizer	B-Algorithm
–	O
a	O
uniform	O
one	O
.	O
</s>
<s>
The	O
essential	O
property	O
of	O
a	O
quantizer	B-Algorithm
is	O
having	O
a	O
countable-set	O
of	O
possible	O
output-values	O
members	O
smaller	O
than	O
the	O
set	O
of	O
possible	O
input	O
values	O
.	O
</s>
<s>
For	O
simple	O
rounding	B-Algorithm
to	O
the	O
nearest	B-Algorithm
integer	I-Algorithm
,	O
the	O
step	O
size	O
is	O
equal	O
to	O
1	O
.	O
</s>
<s>
With	O
or	O
with	O
equal	O
to	O
any	O
other	O
integer	O
value	O
,	O
this	O
quantizer	B-Algorithm
has	O
real-valued	O
inputs	O
and	O
integer-valued	O
outputs	O
.	O
</s>
<s>
When	O
the	O
quantization	B-Algorithm
step	O
size	O
( Δ	O
)	O
is	O
small	O
relative	O
to	O
the	O
variation	O
in	O
the	O
signal	O
being	O
quantized	O
,	O
it	O
is	O
relatively	O
simple	O
to	O
show	O
that	O
the	O
mean	B-Algorithm
squared	I-Algorithm
error	I-Algorithm
produced	O
by	O
such	O
a	O
rounding	B-Algorithm
operation	O
will	O
be	O
approximately	O
.	O
</s>
<s>
Mean	B-Algorithm
squared	I-Algorithm
error	I-Algorithm
is	O
also	O
called	O
the	O
quantization	B-Algorithm
noise	O
power	O
.	O
</s>
<s>
Adding	O
one	O
bit	O
to	O
the	O
quantizer	B-Algorithm
halves	O
the	O
value	O
of	O
Δ	O
,	O
which	O
reduces	O
the	O
noise	O
power	O
by	O
the	O
factor	O
¼	O
.	O
</s>
<s>
Because	O
the	O
set	O
of	O
possible	O
output	O
values	O
of	O
a	O
quantizer	B-Algorithm
is	O
countable	O
,	O
any	O
quantizer	B-Algorithm
can	O
be	O
decomposed	O
into	O
two	O
distinct	O
stages	O
,	O
which	O
can	O
be	O
referred	O
to	O
as	O
the	O
classification	O
stage	O
(	O
or	O
forward	O
quantization	B-Algorithm
stage	O
)	O
and	O
the	O
reconstruction	O
stage	O
(	O
or	O
inverse	O
quantization	B-Algorithm
stage	O
)	O
,	O
where	O
the	O
classification	O
stage	O
maps	O
the	O
input	O
value	O
to	O
an	O
integer	O
quantization	B-Algorithm
index	O
and	O
the	O
reconstruction	O
stage	O
maps	O
the	O
index	O
to	O
the	O
reconstruction	O
value	O
that	O
is	O
the	O
output	O
approximation	O
of	O
the	O
input	O
value	O
.	O
</s>
<s>
This	O
decomposition	O
is	O
useful	O
for	O
the	O
design	O
and	O
analysis	O
of	O
quantization	B-Algorithm
behavior	O
,	O
and	O
it	O
illustrates	O
how	O
the	O
quantized	O
data	O
can	O
be	O
communicated	O
over	O
a	O
communication	O
channel	O
–	O
a	O
source	O
encoder	O
can	O
perform	O
the	O
forward	O
quantization	B-Algorithm
stage	O
and	O
send	O
the	O
index	O
information	O
through	O
a	O
communication	O
channel	O
,	O
and	O
a	O
decoder	O
can	O
perform	O
the	O
reconstruction	O
stage	O
to	O
produce	O
the	O
output	O
approximation	O
of	O
the	O
original	O
input	O
data	O
.	O
</s>
<s>
In	O
general	O
,	O
the	O
forward	O
quantization	B-Algorithm
stage	O
may	O
use	O
any	O
function	O
that	O
maps	O
the	O
input	O
data	O
to	O
the	O
integer	O
space	O
of	O
the	O
quantization	B-Algorithm
index	O
data	O
,	O
and	O
the	O
inverse	O
quantization	B-Algorithm
stage	O
can	O
conceptually	O
(	O
or	O
literally	O
)	O
be	O
a	O
table	O
look-up	O
operation	O
to	O
map	O
each	O
quantization	B-Algorithm
index	O
to	O
a	O
corresponding	O
reconstruction	O
value	O
.	O
</s>
<s>
This	O
two-stage	O
decomposition	O
applies	O
equally	O
well	O
to	O
vector	B-Algorithm
as	O
well	O
as	O
scalar	O
quantizers	B-Algorithm
.	O
</s>
<s>
Because	O
quantization	B-Algorithm
is	O
a	O
many-to-few	O
mapping	O
,	O
it	O
is	O
an	O
inherently	O
non-linear	O
and	O
irreversible	O
process	O
(	O
i.e.	O
,	O
because	O
the	O
same	O
output	O
value	O
is	O
shared	O
by	O
multiple	O
input	O
values	O
,	O
it	O
is	O
impossible	O
,	O
in	O
general	O
,	O
to	O
recover	O
the	O
exact	O
input	O
value	O
when	O
given	O
only	O
the	O
output	O
value	O
)	O
.	O
</s>
<s>
The	O
input	O
and	O
output	O
sets	O
involved	O
in	O
quantization	B-Algorithm
can	O
be	O
defined	O
in	O
a	O
rather	O
general	O
way	O
.	O
</s>
<s>
For	O
example	O
,	O
vector	B-Algorithm
quantization	I-Algorithm
is	O
the	O
application	O
of	O
quantization	B-Algorithm
to	O
multi-dimensional	O
(	O
vector-valued	O
)	O
input	O
data	O
.	O
</s>
<s>
An	O
analog-to-digital	O
converter	O
(	O
ADC	O
)	O
can	O
be	O
modeled	O
as	O
two	O
processes	O
:	O
sampling	B-Algorithm
and	O
quantization	B-Algorithm
.	O
</s>
<s>
Sampling	B-Algorithm
converts	O
a	O
time-varying	O
voltage	O
signal	O
into	O
a	O
discrete-time	O
signal	O
,	O
a	O
sequence	O
of	O
real	O
numbers	O
.	O
</s>
<s>
Quantization	B-Algorithm
replaces	O
each	O
real	O
number	O
with	O
an	O
approximation	O
from	O
a	O
finite	O
set	O
of	O
discrete	O
values	O
.	O
</s>
<s>
Though	O
any	O
number	O
of	O
quantization	B-Algorithm
levels	O
is	O
possible	O
,	O
common	O
word-lengths	O
are	O
8-bit	O
(	O
256	O
levels	O
)	O
,	O
16-bit	B-Device
(	O
65,536	O
levels	O
)	O
and	O
24-bit	O
(	O
16.8million	O
levels	O
)	O
.	O
</s>
<s>
Quantizing	O
a	O
sequence	O
of	O
numbers	O
produces	O
a	O
sequence	O
of	O
quantization	B-Algorithm
errors	O
which	O
is	O
sometimes	O
modeled	O
as	O
an	O
additive	O
random	O
signal	O
called	O
quantization	B-Algorithm
noise	O
because	O
of	O
its	O
stochastic	O
behavior	O
.	O
</s>
<s>
The	O
more	O
levels	O
a	O
quantizer	B-Algorithm
uses	O
,	O
the	O
lower	O
is	O
its	O
quantization	B-Algorithm
noise	O
power	O
.	O
</s>
<s>
Rate	B-General_Concept
–	I-General_Concept
distortion	I-General_Concept
optimized	I-General_Concept
quantization	B-Algorithm
is	O
encountered	O
in	O
source	B-General_Concept
coding	I-General_Concept
for	O
lossy	B-Algorithm
data	I-Algorithm
compression	I-Algorithm
algorithms	O
,	O
where	O
the	O
purpose	O
is	O
to	O
manage	O
distortion	O
within	O
the	O
limits	O
of	O
the	O
bit	O
rate	O
supported	O
by	O
a	O
communication	O
channel	O
or	O
storage	O
medium	O
.	O
</s>
<s>
The	O
analysis	O
of	O
quantization	B-Algorithm
in	O
this	O
context	O
involves	O
studying	O
the	O
amount	O
of	O
data	O
(	O
typically	O
measured	O
in	O
digits	O
or	O
bits	O
or	O
bit	O
rate	O
)	O
that	O
is	O
used	O
to	O
represent	O
the	O
output	O
of	O
the	O
quantizer	B-Algorithm
,	O
and	O
studying	O
the	O
loss	O
of	O
precision	O
that	O
is	O
introduced	O
by	O
the	O
quantization	B-Algorithm
process	O
(	O
which	O
is	O
referred	O
to	O
as	O
the	O
distortion	O
)	O
.	O
</s>
<s>
Most	O
uniform	O
quantizers	B-Algorithm
for	O
signed	O
input	O
data	O
can	O
be	O
classified	O
as	O
being	O
of	O
one	O
of	O
two	O
types	O
:	O
mid-riser	O
and	O
mid-tread	O
.	O
</s>
<s>
The	O
terminology	O
is	O
based	O
on	O
what	O
happens	O
in	O
the	O
region	O
around	O
the	O
value	O
0	O
,	O
and	O
uses	O
the	O
analogy	O
of	O
viewing	O
the	O
input-output	O
function	O
of	O
the	O
quantizer	B-Algorithm
as	O
a	O
stairway	O
.	O
</s>
<s>
Mid-tread	O
quantizers	B-Algorithm
have	O
a	O
zero-valued	O
reconstruction	O
level	O
(	O
corresponding	O
to	O
a	O
tread	O
of	O
a	O
stairway	O
)	O
,	O
while	O
mid-riser	O
quantizers	B-Algorithm
have	O
a	O
zero-valued	O
classification	O
threshold	O
(	O
corresponding	O
to	O
a	O
riser	O
of	O
a	O
stairway	O
)	O
.	O
</s>
<s>
Mid-tread	O
quantization	B-Algorithm
involves	O
rounding	B-Algorithm
.	O
</s>
<s>
The	O
formulas	O
for	O
mid-tread	O
uniform	O
quantization	B-Algorithm
are	O
provided	O
in	O
the	O
previous	O
section	O
.	O
</s>
<s>
Mid-riser	O
quantization	B-Algorithm
involves	O
truncation	B-Algorithm
.	O
</s>
<s>
The	O
input-output	O
formula	O
for	O
a	O
mid-riser	O
uniform	O
quantizer	B-Algorithm
is	O
given	O
by	O
:	O
</s>
<s>
Note	O
that	O
mid-riser	O
uniform	O
quantizers	B-Algorithm
do	O
not	O
have	O
a	O
zero	O
output	O
value	O
–	O
their	O
minimum	O
output	O
magnitude	O
is	O
half	O
the	O
step	O
size	O
.	O
</s>
<s>
In	O
contrast	O
,	O
mid-tread	O
quantizers	B-Algorithm
do	O
have	O
a	O
zero	O
output	O
level	O
.	O
</s>
<s>
In	O
general	O
,	O
a	O
mid-riser	O
or	O
mid-tread	O
quantizer	B-Algorithm
may	O
not	O
actually	O
be	O
a	O
uniform	O
quantizer	B-Algorithm
–	O
i.e.	O
,	O
the	O
size	O
of	O
the	O
quantizer	B-Algorithm
's	O
classification	O
intervals	O
may	O
not	O
all	O
be	O
the	O
same	O
,	O
or	O
the	O
spacing	O
between	O
its	O
possible	O
output	O
values	O
may	O
not	O
all	O
be	O
the	O
same	O
.	O
</s>
<s>
The	O
distinguishing	O
characteristic	O
of	O
a	O
mid-riser	O
quantizer	B-Algorithm
is	O
that	O
it	O
has	O
a	O
classification	O
threshold	O
value	O
that	O
is	O
exactly	O
zero	O
,	O
and	O
the	O
distinguishing	O
characteristic	O
of	O
a	O
mid-tread	O
quantizer	B-Algorithm
is	O
that	O
is	O
it	O
has	O
a	O
reconstruction	O
value	O
that	O
is	O
exactly	O
zero	O
.	O
</s>
<s>
A	O
dead-zone	O
quantizer	B-Algorithm
is	O
a	O
type	O
of	O
mid-tread	O
quantizer	B-Algorithm
with	O
symmetric	O
behavior	O
around	O
0	O
.	O
</s>
<s>
The	O
region	O
around	O
the	O
zero	O
output	O
value	O
of	O
such	O
a	O
quantizer	B-Algorithm
is	O
referred	O
to	O
as	O
the	O
dead	O
zone	O
or	O
deadband	O
.	O
</s>
<s>
In	O
this	O
case	O
,	O
the	O
dead-zone	O
quantizer	B-Algorithm
is	O
also	O
a	O
uniform	O
quantizer	B-Algorithm
,	O
since	O
the	O
central	O
dead-zone	O
of	O
this	O
quantizer	B-Algorithm
has	O
the	O
same	O
width	O
as	O
all	O
of	O
its	O
other	O
steps	O
,	O
and	O
all	O
of	O
its	O
reconstruction	O
values	O
are	O
equally	O
spaced	O
as	O
well	O
.	O
</s>
<s>
A	O
common	O
assumption	O
for	O
the	O
analysis	O
of	O
quantization	B-Algorithm
error	O
is	O
that	O
it	O
affects	O
a	O
signal	O
processing	O
system	O
in	O
a	O
similar	O
manner	O
to	O
that	O
of	O
additive	O
white	O
noise	O
–	O
having	O
negligible	O
correlation	O
with	O
the	O
signal	O
and	O
an	O
approximately	O
flat	O
power	O
spectral	O
density	O
.	O
</s>
<s>
The	O
additive	O
noise	O
model	O
is	O
commonly	O
used	O
for	O
the	O
analysis	O
of	O
quantization	B-Algorithm
error	O
effects	O
in	O
digital	O
filtering	O
systems	O
,	O
and	O
it	O
can	O
be	O
very	O
useful	O
in	O
such	O
analysis	O
.	O
</s>
<s>
It	O
has	O
been	O
shown	O
to	O
be	O
a	O
valid	O
model	O
in	O
cases	O
of	O
high	O
resolution	O
quantization	B-Algorithm
(	O
small	O
relative	O
to	O
the	O
signal	O
strength	O
)	O
with	O
smooth	O
PDFs	O
.	O
</s>
<s>
Quantization	B-Algorithm
error	O
(	O
for	O
quantizers	B-Algorithm
defined	O
as	O
described	O
here	O
)	O
is	O
deterministically	O
related	O
to	O
the	O
signal	O
and	O
not	O
entirely	O
independent	O
of	O
it	O
.	O
</s>
<s>
Thus	O
,	O
periodic	O
signals	O
can	O
create	O
periodic	O
quantization	B-Algorithm
noise	O
.	O
</s>
<s>
And	O
in	O
some	O
cases	O
it	O
can	O
even	O
cause	O
limit	O
cycles	O
to	O
appear	O
in	O
digital	B-General_Concept
signal	I-General_Concept
processing	I-General_Concept
systems	O
.	O
</s>
<s>
One	O
way	O
to	O
ensure	O
effective	O
independence	O
of	O
the	O
quantization	B-Algorithm
error	O
from	O
the	O
source	O
signal	O
is	O
to	O
perform	O
dithered	O
quantization	B-Algorithm
(	O
sometimes	O
with	O
noise	O
shaping	O
)	O
,	O
which	O
involves	O
adding	O
random	O
(	O
or	O
pseudo-random	B-Error_Name
)	O
noise	O
to	O
the	O
signal	O
prior	O
to	O
quantization	B-Algorithm
.	O
</s>
<s>
When	O
this	O
is	O
the	O
case	O
,	O
the	O
quantization	B-Algorithm
error	O
is	O
not	O
significantly	O
correlated	O
with	O
the	O
signal	O
,	O
and	O
has	O
an	O
approximately	O
uniform	O
distribution	O
.	O
</s>
<s>
When	O
rounding	B-Algorithm
is	O
used	O
to	O
quantize	O
,	O
the	O
quantization	B-Algorithm
error	O
has	O
a	O
mean	O
of	O
zero	O
and	O
the	O
root	B-General_Concept
mean	I-General_Concept
square	I-General_Concept
(	O
RMS	O
)	O
value	O
is	O
the	O
standard	B-General_Concept
deviation	I-General_Concept
of	O
this	O
distribution	O
,	O
given	O
by	O
.	O
</s>
<s>
When	O
truncation	B-Algorithm
is	O
used	O
,	O
the	O
error	O
has	O
a	O
non-zero	O
mean	O
of	O
and	O
the	O
RMS	B-General_Concept
value	I-General_Concept
is	O
.	O
</s>
<s>
Although	O
rounding	B-Algorithm
yields	O
less	O
RMS	O
error	O
than	O
truncation	B-Algorithm
,	O
the	O
difference	O
is	O
only	O
due	O
to	O
the	O
static	O
(	O
DC	O
)	O
term	O
of	O
.	O
</s>
<s>
The	O
RMS	B-General_Concept
values	I-General_Concept
of	O
the	O
AC	O
error	O
are	O
exactly	O
the	O
same	O
in	O
both	O
cases	O
,	O
so	O
there	O
is	O
no	O
special	O
advantage	O
of	O
rounding	B-Algorithm
over	O
truncation	B-Algorithm
in	O
situations	O
where	O
the	O
DC	O
term	O
of	O
the	O
error	O
can	O
be	O
ignored	O
(	O
such	O
as	O
in	O
AC	O
coupled	O
systems	O
)	O
.	O
</s>
<s>
In	O
either	O
case	O
,	O
the	O
standard	B-General_Concept
deviation	I-General_Concept
,	O
as	O
a	O
percentage	O
of	O
the	O
full	O
signal	O
range	O
,	O
changes	O
by	O
a	O
factor	O
of	O
2	O
for	O
each	O
1-bit	O
change	O
in	O
the	O
number	O
of	O
quantization	B-Algorithm
bits	O
.	O
</s>
<s>
The	O
potential	O
signal-to-quantization-noise	O
power	O
ratio	O
therefore	O
changes	O
by	O
4	O
,	O
or	O
,	O
approximately	O
6dB	O
per	O
bit	O
.	O
</s>
<s>
At	O
lower	O
amplitudes	O
the	O
quantization	B-Algorithm
error	O
becomes	O
dependent	O
on	O
the	O
input	O
signal	O
,	O
resulting	O
in	O
distortion	O
.	O
</s>
<s>
In	O
order	O
to	O
make	O
the	O
quantization	B-Algorithm
error	O
independent	O
of	O
the	O
input	O
signal	O
,	O
the	O
signal	O
is	O
dithered	O
by	O
adding	O
noise	O
to	O
the	O
signal	O
.	O
</s>
<s>
Quantization	B-Algorithm
noise	O
is	O
a	O
model	O
of	O
quantization	B-Algorithm
error	O
introduced	O
by	O
quantization	B-Algorithm
in	O
the	O
ADC	O
.	O
</s>
<s>
It	O
is	O
a	O
rounding	B-Algorithm
error	I-Algorithm
between	O
the	O
analog	O
input	O
voltage	O
to	O
the	O
ADC	O
and	O
the	O
output	O
digitized	O
value	O
.	O
</s>
<s>
where	O
Q	O
is	O
the	O
number	O
of	O
quantization	B-Algorithm
bits	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
16-bit	B-Device
ADC	O
has	O
a	O
maximum	O
signal-to-quantization-noise	O
ratio	O
of	O
6.02	O
×	O
16	O
=	O
96.3dB	O
.	O
</s>
<s>
Here	O
,	O
the	O
quantization	B-Algorithm
noise	O
is	O
once	O
again	O
assumed	O
to	O
be	O
uniformly	O
distributed	O
.	O
</s>
<s>
In	O
this	O
case	O
a	O
16-bit	B-Device
ADC	O
has	O
a	O
maximum	O
signal-to-noise	O
ratio	O
of	O
98.09dB	O
.	O
</s>
<s>
For	O
low-resolution	O
ADCs	O
,	O
low-level	O
signals	O
in	O
high-resolution	O
ADCs	O
,	O
and	O
for	O
simple	O
waveforms	O
the	O
quantization	B-Algorithm
noise	O
is	O
not	O
uniformly	O
distributed	O
,	O
making	O
this	O
model	O
inaccurate	O
.	O
</s>
<s>
In	O
these	O
cases	O
the	O
quantization	B-Algorithm
noise	O
distribution	O
is	O
strongly	O
affected	O
by	O
the	O
exact	O
amplitude	O
of	O
the	O
signal	O
.	O
</s>
<s>
For	O
smaller	O
signals	O
,	O
the	O
relative	O
quantization	B-Algorithm
distortion	O
can	O
be	O
very	O
large	O
.	O
</s>
<s>
To	O
circumvent	O
this	O
issue	O
,	O
analog	O
companding	B-Algorithm
can	O
be	O
used	O
,	O
but	O
this	O
can	O
introduce	O
distortion	O
.	O
</s>
<s>
Often	O
the	O
design	O
of	O
a	O
quantizer	B-Algorithm
involves	O
supporting	O
only	O
a	O
limited	O
range	O
of	O
possible	O
output	O
values	O
and	O
performing	O
clipping	O
to	O
limit	O
the	O
output	O
to	O
this	O
range	O
whenever	O
the	O
input	O
exceeds	O
the	O
supported	O
range	O
.	O
</s>
<s>
Within	O
the	O
extreme	O
limits	O
of	O
the	O
supported	O
range	O
,	O
the	O
amount	O
of	O
spacing	O
between	O
the	O
selectable	O
output	O
values	O
of	O
a	O
quantizer	B-Algorithm
is	O
referred	O
to	O
as	O
its	O
granularity	O
,	O
and	O
the	O
error	O
introduced	O
by	O
this	O
spacing	O
is	O
referred	O
to	O
as	O
granular	O
distortion	O
.	O
</s>
<s>
It	O
is	O
common	O
for	O
the	O
design	O
of	O
a	O
quantizer	B-Algorithm
to	O
involve	O
determining	O
the	O
proper	O
balance	O
between	O
granular	O
distortion	O
and	O
overload	O
distortion	O
.	O
</s>
<s>
A	O
technique	O
for	O
controlling	O
the	O
amplitude	O
of	O
the	O
signal	O
(	O
or	O
,	O
equivalently	O
,	O
the	O
quantization	B-Algorithm
step	O
size	O
)	O
to	O
achieve	O
the	O
appropriate	O
balance	O
is	O
the	O
use	O
of	O
automatic	O
gain	O
control	O
(	O
AGC	O
)	O
.	O
</s>
<s>
However	O
,	O
in	O
some	O
quantizer	B-Algorithm
designs	O
,	O
the	O
concepts	O
of	O
granular	O
error	O
and	O
overload	O
error	O
may	O
not	O
apply	O
(	O
e.g.	O
,	O
for	O
a	O
quantizer	B-Algorithm
with	O
a	O
limited	O
range	O
of	O
input	O
data	O
or	O
with	O
a	O
countably	O
infinite	O
set	O
of	O
selectable	O
output	O
values	O
)	O
.	O
</s>
<s>
A	O
scalar	O
quantizer	B-Algorithm
,	O
which	O
performs	O
a	O
quantization	B-Algorithm
operation	O
,	O
can	O
ordinarily	O
be	O
decomposed	O
into	O
two	O
stages	O
:	O
</s>
<s>
All	O
the	O
inputs	O
that	O
fall	O
in	O
a	O
given	O
interval	O
range	O
are	O
associated	O
with	O
the	O
same	O
quantization	B-Algorithm
index	O
.	O
</s>
<s>
Entropy	B-Algorithm
coding	I-Algorithm
techniques	O
can	O
be	O
applied	O
to	O
communicate	O
the	O
quantization	B-Algorithm
indices	O
from	O
a	O
source	O
encoder	O
that	O
performs	O
the	O
classification	O
stage	O
to	O
a	O
decoder	O
that	O
performs	O
the	O
reconstruction	O
stage	O
.	O
</s>
<s>
One	O
way	O
to	O
do	O
this	O
is	O
to	O
associate	O
each	O
quantization	B-Algorithm
index	O
with	O
a	O
binary	O
codeword	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
the	O
design	O
of	O
an	O
-level	O
quantizer	B-Algorithm
and	O
an	O
associated	O
set	O
of	O
codewords	O
for	O
communicating	O
its	O
index	O
values	O
requires	O
finding	O
the	O
values	O
of	O
,	O
and	O
which	O
optimally	O
satisfy	O
a	O
selected	O
set	O
of	O
design	O
constraints	O
such	O
as	O
the	O
bit	O
rate	O
and	O
distortion	O
.	O
</s>
<s>
Assuming	O
that	O
an	O
information	O
source	O
produces	O
random	O
variables	O
with	O
an	O
associated	O
PDF	O
,	O
the	O
probability	O
that	O
the	O
random	O
variable	O
falls	O
within	O
a	O
particular	O
quantization	B-Algorithm
interval	O
is	O
given	O
by	O
:	O
</s>
<s>
The	O
resulting	O
bit	O
rate	O
,	O
in	O
units	O
of	O
average	O
bits	O
per	O
quantized	O
value	O
,	O
for	O
this	O
quantizer	B-Algorithm
can	O
be	O
derived	O
as	O
follows	O
:	O
</s>
<s>
If	O
it	O
is	O
assumed	O
that	O
distortion	O
is	O
measured	O
by	O
mean	B-Algorithm
squared	I-Algorithm
error	I-Algorithm
,	O
the	O
distortion	O
D	O
,	O
is	O
given	O
by	O
:	O
</s>
<s>
After	O
defining	O
these	O
two	O
performance	O
metrics	O
for	O
the	O
quantizer	B-Algorithm
,	O
a	O
typical	O
rate	O
–	O
distortion	O
formulation	O
for	O
a	O
quantizer	B-Algorithm
design	O
problem	O
can	O
be	O
expressed	O
in	O
one	O
of	O
two	O
ways	O
:	O
</s>
<s>
The	O
use	O
of	O
this	O
approximation	O
can	O
allow	O
the	O
entropy	B-Algorithm
coding	I-Algorithm
design	O
problem	O
to	O
be	O
separated	O
from	O
the	O
design	O
of	O
the	O
quantizer	B-Algorithm
itself	O
.	O
</s>
<s>
Modern	O
entropy	B-Algorithm
coding	I-Algorithm
techniques	O
such	O
as	O
arithmetic	B-Algorithm
coding	I-Algorithm
can	O
achieve	O
bit	O
rates	O
that	O
are	O
very	O
close	O
to	O
the	O
true	O
entropy	O
of	O
a	O
source	O
,	O
given	O
a	O
set	O
of	O
known	O
(	O
or	O
adaptively	O
estimated	O
)	O
probabilities	O
.	O
</s>
<s>
In	O
some	O
designs	O
,	O
rather	O
than	O
optimizing	O
for	O
a	O
particular	O
number	O
of	O
classification	O
regions	O
,	O
the	O
quantizer	B-Algorithm
design	O
problem	O
may	O
include	O
optimization	O
of	O
the	O
value	O
of	O
as	O
well	O
.	O
</s>
<s>
In	O
the	O
above	O
formulation	O
,	O
if	O
the	O
bit	O
rate	O
constraint	O
is	O
neglected	O
by	O
setting	O
equal	O
to	O
0	O
,	O
or	O
equivalently	O
if	O
it	O
is	O
assumed	O
that	O
a	O
fixed-length	O
code	O
(	O
FLC	O
)	O
will	O
be	O
used	O
to	O
represent	O
the	O
quantized	O
data	O
instead	O
of	O
a	O
variable-length	B-Algorithm
code	I-Algorithm
(	O
or	O
some	O
other	O
entropy	B-Algorithm
coding	I-Algorithm
technology	O
such	O
as	O
arithmetic	B-Algorithm
coding	I-Algorithm
that	O
is	O
better	O
than	O
an	O
FLC	O
in	O
the	O
rate	O
–	O
distortion	O
sense	O
)	O
,	O
the	O
optimization	O
problem	O
reduces	O
to	O
minimization	O
of	O
distortion	O
alone	O
.	O
</s>
<s>
The	O
indices	O
produced	O
by	O
an	O
-level	O
quantizer	B-Algorithm
can	O
be	O
coded	O
using	O
a	O
fixed-length	O
code	O
using	O
bits/symbol	O
.	O
</s>
<s>
For	O
this	O
reason	O
,	O
such	O
a	O
quantizer	B-Algorithm
has	O
sometimes	O
been	O
called	O
an	O
8-bit	O
quantizer	B-Algorithm
.	O
</s>
<s>
However	O
using	O
an	O
FLC	O
eliminates	O
the	O
compression	O
improvement	O
that	O
can	O
be	O
obtained	O
by	O
use	O
of	O
better	O
entropy	B-Algorithm
coding	I-Algorithm
.	O
</s>
<s>
Finding	O
an	O
optimal	O
solution	O
to	O
the	O
above	O
problem	O
results	O
in	O
a	O
quantizer	B-Algorithm
sometimes	O
called	O
a	O
MMSQE	O
(	O
minimum	O
mean-square	O
quantization	B-Algorithm
error	O
)	O
solution	O
,	O
and	O
the	O
resulting	O
PDF-optimized	O
(	O
non-uniform	O
)	O
quantizer	B-Algorithm
is	O
referred	O
to	O
as	O
a	O
Lloyd	O
–	O
Max	O
quantizer	B-Algorithm
,	O
named	O
after	O
two	O
people	O
who	O
independently	O
developed	O
iterative	O
methods	O
to	O
solve	O
the	O
two	O
sets	O
of	O
simultaneous	O
equations	O
resulting	O
from	O
and	O
,	O
as	O
follows	O
:	O
</s>
<s>
Lloyd	B-Algorithm
's	I-Algorithm
Method	I-Algorithm
I	I-Algorithm
algorithm	I-Algorithm
,	O
originally	O
described	O
in	O
1957	O
,	O
can	O
be	O
generalized	O
in	O
a	O
straightforward	O
way	O
for	O
application	O
to	O
vector	B-Algorithm
data	O
.	O
</s>
<s>
This	O
generalization	O
results	O
in	O
the	O
Linde	O
–	O
Buzo	O
–	O
Gray	O
(	O
LBG	O
)	O
or	O
k-means	B-Algorithm
classifier	O
optimization	O
methods	O
.	O
</s>
<s>
Moreover	O
,	O
the	O
technique	O
can	O
be	O
further	O
generalized	O
in	O
a	O
straightforward	O
way	O
to	O
also	O
include	O
an	O
entropy	O
constraint	O
for	O
vector	B-Algorithm
data	O
.	O
</s>
<s>
The	O
Lloyd	O
–	O
Max	O
quantizer	B-Algorithm
is	O
actually	O
a	O
uniform	O
quantizer	B-Algorithm
when	O
the	O
input	O
PDF	O
is	O
uniformly	O
distributed	O
over	O
the	O
range	O
.	O
</s>
<s>
However	O
,	O
for	O
a	O
source	O
that	O
does	O
not	O
have	O
a	O
uniform	O
distribution	O
,	O
the	O
minimum-distortion	O
quantizer	B-Algorithm
may	O
not	O
be	O
a	O
uniform	O
quantizer	B-Algorithm
.	O
</s>
<s>
The	O
analysis	O
of	O
a	O
uniform	O
quantizer	B-Algorithm
applied	O
to	O
a	O
uniformly	O
distributed	O
source	O
can	O
be	O
summarized	O
in	O
what	O
follows	O
:	O
</s>
<s>
For	O
example	O
,	O
for	O
=	O
8	O
bits	O
,	O
=	O
256	O
levels	O
and	O
SQNR	O
=	O
86	O
=	O
48dB	O
;	O
and	O
for	O
=	O
16	B-Device
bits	I-Device
,	O
=	O
65536	O
and	O
SQNR	O
=	O
166	O
=	O
96dB	O
.	O
</s>
<s>
The	O
property	O
of	O
6dB	O
improvement	O
in	O
SQNR	O
for	O
each	O
extra	O
bit	O
used	O
in	O
quantization	B-Algorithm
is	O
a	O
well-known	O
figure	O
of	O
merit	O
.	O
</s>
<s>
However	O
,	O
it	O
must	O
be	O
used	O
with	O
care	O
:	O
this	O
derivation	O
is	O
only	O
for	O
a	O
uniform	O
quantizer	B-Algorithm
applied	O
to	O
a	O
uniform	O
source	O
.	O
</s>
<s>
For	O
other	O
source	O
PDFs	O
and	O
other	O
quantizer	B-Algorithm
designs	O
,	O
the	O
SQNR	O
may	O
be	O
somewhat	O
different	O
from	O
that	O
predicted	O
by	O
6dB/bit	O
,	O
depending	O
on	O
the	O
type	O
of	O
PDF	O
,	O
the	O
type	O
of	O
source	O
,	O
the	O
type	O
of	O
quantizer	B-Algorithm
,	O
and	O
the	O
bit	O
rate	O
range	O
of	O
operation	O
.	O
</s>
<s>
However	O
,	O
it	O
is	O
common	O
to	O
assume	O
that	O
for	O
many	O
sources	O
,	O
the	O
slope	O
of	O
a	O
quantizer	B-Algorithm
SQNR	O
function	O
can	O
be	O
approximated	O
as	O
6dB/bit	O
when	O
operating	O
at	O
a	O
sufficiently	O
high	O
bit	O
rate	O
.	O
</s>
<s>
At	O
asymptotically	O
high	O
bit	O
rates	O
,	O
cutting	O
the	O
step	O
size	O
in	O
half	O
increases	O
the	O
bit	O
rate	O
by	O
approximately	O
1	O
bit	O
per	O
sample	O
(	O
because	O
1	O
bit	O
is	O
needed	O
to	O
indicate	O
whether	O
the	O
value	O
is	O
in	O
the	O
left	O
or	O
right	O
half	O
of	O
the	O
prior	O
double-sized	O
interval	O
)	O
and	O
reduces	O
the	O
mean	B-Algorithm
squared	I-Algorithm
error	I-Algorithm
by	O
a	O
factor	O
of	O
4	O
(	O
i.e.	O
,	O
6dB	O
)	O
based	O
on	O
the	O
approximation	O
.	O
</s>
<s>
Moreover	O
,	O
the	O
structure	O
of	O
the	O
optimal	O
scalar	O
quantizer	B-Algorithm
(	O
in	O
the	O
rate	O
–	O
distortion	O
sense	O
)	O
approaches	O
that	O
of	O
a	O
uniform	O
quantizer	B-Algorithm
under	O
these	O
conditions	O
.	O
</s>
<s>
Examples	O
of	O
fields	O
where	O
this	O
limitation	O
applies	O
include	O
electronics	O
(	O
due	O
to	O
electrons	O
)	O
,	O
optics	B-Algorithm
(	O
due	O
to	O
photons	B-Application
)	O
,	O
biology	O
(	O
due	O
to	O
DNA	O
)	O
,	O
physics	O
(	O
due	O
to	O
Planck	O
limits	O
)	O
and	O
chemistry	O
(	O
due	O
to	O
molecules	O
)	O
.	O
</s>
