Docsity

Generally Speaking, Quantization Means - Quantization Theory | ECE 8873, Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
Spring 2004 ECE 8873 B. H. Juang Copyright 2004 Lecture 6, Slide #1
ECE 8873
Data Compression & Modeling
Lecture 6:
Quantization Theory
School of Electrical and Computer Engineering
Georgia Institute of Technology
Spring, 2004
Spring 2004 ECE 8873 B. H. Juang Copyright 2004 Lecture 6, Slide #2
• An analog signal has sample value that needs to be
“rounded” to be represented in computers.
• Sheppard analyzed “round-off error” in 1898
(according to Bob Gray).
• Generally speaking, quantization means:
– Divide the region (of value) into disjoint intervals;
– For each value to be quantized (or re-quantized),
find the interval it is in;
– Represent the interval by its index for transmission
and storage; same index also points to a typical
value to be used at the receiver to recover the
original value (with some discrepancy).
Digital Representation of Analog Signals
Spring 2004 ECE 8873 B. H. Juang Copyright 2004 Lecture 6, Slide #3
Uniform Quantizer
• A quantizer is called uniform if the intervals are
equally and contagiously spaced.
• Conventionally, the typical value chosen for each
interval for recovery at the receiver is the mid-point of
the interval.
X
)(Xq
7
6
5
4
3
2
1
0
index
∆
Quantization error:
ε
ε
−=
−=
)(
)(
XqX
XXq
Granular region: 2/||
∆
<
ε
Overload or saturation region:
quantization error is unbounded
Spring 2004 ECE 8873 B. H. Juang Copyright 2004 Lecture 6, Slide #4
• Suppose data is 0-mean uniformly distributed, no
overload, i.e. .
• Entropy at the output (uniform q, uniform pdf)
• In terms of SNR:
• Bennett showed that for high rate, , the above
average distortion result is approximately true for any
pdf, not just uniform pdf.
Quantization Error - SQNR
NGGGX /]2/,2/[ =∆−∈ and
12
]))([(][
2
22 ∆
=−= XXqEE
ε
intervals ofnumber theis ,ln)( NNqH =
)dB(62loglog10
][
][
log10 10
2
2
2
2
10 RkNk
E
XE +≈+=
ε
∞→N
“6dB gain per bit”
pf3
pf4
pf5
pf8

Partial preview of the text

Download Generally Speaking, Quantization Means - Quantization Theory | ECE 8873 and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

ECE 8873

Data Compression & Modeling

Lecture 6:

Quantization Theory

School of Electrical and Computer Engineering

Georgia Institute of Technology

Spring, 2004

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

-^

An analog signal has sample value that needs to be“rounded” to be represented in computers.

-^

Sheppard analyzed “round-off error” in 1898(according to Bob Gray).

-^

Generally speaking, quantization means:

  • Divide the region (of value) into disjoint intervals;– For each value to be quantized (or re-quantized),

find the interval it is in;

  • Represent the interval by its index for transmission

and storage; same index also points to a typicalvalue to be used at the receiver to recover theoriginal value (with some discrepancy).

Digital Representation of Analog Signals

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

Uniform Quantizer

-^

A quantizer is called uniform if the intervals areequally and contagiously spaced.

-^

Conventionally, the typical value chosen for eachinterval for recovery at the receiver is the mid-point ofthe interval.

X

) (^ Xq

7 6 5 4 3 2 1 0 index

∆

Quantization error:

X

q

X

X

X

q

Granular region:

|^

Overload or saturation region:quantization error is unbounded

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

-^

Suppose data is 0-mean uniformly distributed, nooverload, i.e.

-^

Entropy at the output (uniform

q

, uniform pdf)

-^

In terms of SNR:

-^

Bennett showed that for high rate,

, the above

average distortion result is approximately true for anypdf, not just uniform pdf.

Quantization Error - SQNR

N

G

G

G

X

]

[^

and

]

[(

]

[

2

2

2

X

X

q

E

E

ε^ intervals

of

number

the

is

ln

(^

N

N

q

H

dB(

log

log

]

[

]

[

log

10

2

2

(^22)

10

R

k

N

k

E

X

E

N

“6dB gain per bit”

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

-^

A quantization/coding scheme consists of– An encoder

If

and

appear as a parsable units in their

respective domain, we can define the average code lengtha

per input “unit,” which can be sample, pixel, word

(variable number of letters), sequence, area, or time.

  • A decoder– A reproduction codebook

Basics Again

*^

:^

B

A

A

x

x

A

B

:^

*^

α β

β

A

x

))]

[^

x

l

E

) ( x α

ˆ^

I

i

i

A

β

generality

of

loss

out

index with

integer

in

d

represente

elements

has

codeset

the

and

codeword

a

called

is

Each

I

I

i

i^

Why?

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

Complete Coding Model^ α

′

ˆ A

A

I

I

B

α

ψ

1 − ψ

β ′

β

γ

Source Encoder

: maps letters in

to indices

i^

in

I

Channel Encoder

: maps indices in

I

to channel code in

B

Channel Decoder

: maps channel codes back to indices in

I

Source Decoder

: maps indices in

I

to codewords

in

C

α

′ (^) ψ 1 −

A

( i

Channel/transmisson system

is assumed to be lossless -

is equal to unity.

(^1) −

α ′

ˆ A

A

I^

I

B

ψ

(^1) −

For sequences:

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

C

carries the implication that

and

are

parsable units and the function is defined over

and

Objectives & Concerns

-^

Given

, find the coder and the decoder such that

the discrepancy between

and

is minimum.

-^

How to measure discrepancy? Use “distortionmeasure”

-^

With

fixed, instead of looking at

, we are

interested in

I

) ˆ , (

x x

d

x

x ˆ

)))]

[

)]

[

β α

α β

D X X d E X X d E

))]

[^

x

l

E

ˆ^ ) , (^

x x d

x

ˆ x

x

ˆ x

symbols.

source

of

deletion

and

insertion

in

y

possibilit

to

due

order

sequential

the

in

alignment

some

requires

or

data

of

ame

window/fr

a

involves

Often

(^

x

x

g g d x x d

I

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

Average or expected rate:

Further Notations & Terminology

)))]

[

)]

[

D X X d E X X d E

}

,

{

I

i

S

S

i^

∈

=

(^

x x d x x d

α β

Distortion:Average or expected distortion:Encoder partition:

where

j

i

S

S

S

j

i

i^

≠

=

∩

⇒

if

disjoint

are

φ

A

S

i I i i^

=

∪

∈,

}

) (

:

{

I

i

x

x

S

i^

∈

=

′

=

α

))]

[^

x

l

E

Quantizer:

(^

l

Q

rate.

the

determines

also

which

function"

length"

the is l

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

Cell Shapes

-^

Now, if local pdf variation does not matter (i.e.,roughly uniform), the factor that affect the centroid(and the distortion) the most is the shape.

-^

But remember

; so, no unattended space

allowed

How to pack the space tightly and

minimize

D

A

S

i I ii

∈,

of

centroid

Euclidean

the is

S

S

x

∫

S k^

dx

S

V

S x x S V k S M

2

/ 2

Introduce dimensionless 2

nd

moment of a cell

S

,^

M

( S

depends on shape and not scale.

(^

cS

M

S

M

( S

M

S

x

c

cx

cS

k^

is dimension of

x.

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

What kind of partition would minimize

Consider the bin packing problem.

Average Distortion

∫^

−

=

S^ i

i i

k i

i^

dx

S V

S x x S V k S M ) (

|| ) (

||

) (

1

1

) (

2

/ 2

( Q

D

With

∑ ∑ ∑

∫

=

= =

−

N i

k

i

i

N i

k i

i

i

N i

S^

i

i

S

V

S

kM i

f

S

V

S

kM S P

dx

i x S V S P Q D

i

1

/ 2 1

1

/ 2

1

2

1

β

β

(^

i

i^

S V i f S P

recall

In this expression, the effect of the partition shape is somewhatisolated.

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

Voronoi Region, Cell, Partition

-^

(AMS definition) Consider any collection of non-overlapping discs of equal size (possibly just isolatedpoints). We associate to this collection a partition ofthe plane into regions called

Voronoi cells

. The

Voronoi cell of a disc in the distribution is the set ofpoints in the plane which are as close or closer to thecenter of that disc than to the center of any other discin the distribution. The partition we associate to anydistribution of non-overlapping discs in the plane is itsVoronoi partition.– http://www.ams.org/new-in-math/cover/cass4.html

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

Voronoi Partition

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

Let

be the set of generating vectors.

Lattice

-^

A lattice

in

is a set of all vectors represented

by a linear combination of integer multiples of thegenerator vectors.

]

[^

2

1

k

u

u

u

U

L

Um

v

v

L

L

k

R

L

i

i

u

k

i

t k^

Z Z m m m m

m

m

]

[^

2

1

L

U

Hexagonal lattice:

(0, 2)

) 1 , 3 (^

) 2 , 0 ( 1 ) 1 , 3 ( 2

− ) (^2) , (^0) ( 1 ) 1 , 3 ( 1

−

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

Lattice from Voronoi Partition

-^

Let

be the Voronoi cell of a lattice with its

Euclidean centroid located at the origin.

-^

It has volume

and normalized moment of

inertia

-^

Let

for all

i

0

0

V

(^

0

M

S

M

i

(^

0

M

k

N i

i

k

N i k

N i

k

V

kM

S

P

V

kM

V

i

f

V

kM

V

i

f

kM

Q

D

/ 2 0

0

1

/ 2

0

0

1

0

/ 2

0

0

1

/ 2 1 0

0

= =

=

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

-^

Scaled partition:

-^

Bounded Partition– Input pdf is concentrated in a bounded set, say

A

  • Since

N

is large and the cell is small,

  • The best lattice quantizer is the one that minimizes

o

over all lattices – cell shape is the key.

Scaled Partition & Bounded Partition

L

L

a

k

V

/ 2 ) 0

(Ξ

D(Q)

(^

0

0

L

L

a

M

M

The normalized moment of inertia does not changeThe average distortion

decreases as the volume shrinks in

k

k^

N

A

V

kM

Q

D

/ 2

/ 2

0

(^

−

(^

0

NV

A

V

(^

0

M

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

Gersho’s Conjecture (Gray)

-^

For optimal quantization, all cells are well approximatedasymptotically by polytopes which are scaled, rotated ortranslated versions of a single tesselating (space filling)convex polytope

with minimum normalized moment of

inertia

, and

the quantizer point density

function





Ξ

=

Ξ

≈

Ξ

≈ ≈

=

=

k

k

N i

k

i

N i

k

i

i

x

N

E

kM

x

N

dx

x f

kM

i

N

S V

i

f

kM

S V S M i f k Q D

/ 2

/ 2

1

/ 2

1

/ 2 1

)] (

[

1

) (

)] (

)[ (

) (

))] ( (

[

) (

)) ( (

) (

) ( ) (

)) ( (

) (

λ

λ

β λ β β k Q M

=

Ξ

) (^

*. k

Q

k

dimension on

depends

only

 



k

x

N

E

/ 2 )] (

[

1 λ

involves distributions of data and quantization points;in lattice quantizer, the point density is uniform andonly the shape matters.

( x λ

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

Partial Distortion Theorem:

For quantization with the

asymptotically optimal (quantizer) point density function,the partial distortion

are

asymptotically constant with value

as

approaches infinity.

Partial Distortion Theorem

N

D

3

3

3

c

y

G

y

f

D

i i

X

i

2

i

i^

S X X X E D

α

∑

∑

=

=

∈

∈

−

=

=

N i

i

i

N i

i^

S X P S X X X E D D

1

2

1

}

{ }

| )) (

{(

α

N

∑

∑

∫^

=

=

−

N i

i

i

N i

x x^

i

i

i

S

P

dx

y

x

S

P

D

i i

1

2

1

2

(^

1

i

i

i

X i

i^

y G y f S P

and

independent of

i

Average distortion in eachquantization region is thesame if point density isoptimally chosen.

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

Quantization Designs

-^

High rate analysis provides guidance on choice ofshapes of partition.

-^

Lattice quantizer based on “space-filling polytopewith minimum NMI” has the advantage of:– Efficient coding (fast search of closest region)– Performance

-^

If smaller distortion is desired, then need to look atnon-uniform quantizers with point density function tominimize

-^

The expectation can be evaluated by integration ifthe data pdf is known (e.g., the cubic root result forthe scalar case); otherwise, use empirical methods.

k

N

/ 2 −

∝

{

k }

x

N

E

/ 2 )] (

[^

−

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

Non-uniform Quantizer

-^

Coding principle– The best representation value in an interval is one

that minimizes average distortion in that interval,i.e, the centroid

  • The best interval an input value is assigned to is

the one whose centroid is closest to the inputvalue.

-^

Lloyd’s methods– Lloyd’s method I (Lloyd algorithm)– Lloyd’s method II

  • Reported in 1957.• Rediscovered by Max in 1960; led to the name

Lloyd-Max quantizer.

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

Lloyd’s Method II

For scalar quantizer design– Initialization: set the lowest threshold

choose a smallest reproduction value

  • Since

must be the centroid of

,^

can

be computed.

  • But

must be mid-point between

and

due

to the nearest neighbor principle for minimizingcoding distortion given any codebook,

is thus

determined as

  • Iterate until final codeword is chosen. If

is not

close to the centroid of

, adjust

reproduction initial value

. If close enough, stop.

0 τ

1 τ

1 ˆ x

)

,

(^

1

0

τ

τ

ˆ^1 x 1 τ

ˆ^1

x

2

ˆ x

2 ˆ x

N ˆ x

ˆ x^1

)

,

(^

1

∞

− N τ

1 1 1 1 1 2

ˆ^

x

x

x

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 6, Slide #

Lloyd Principle and Consequences

-^

Suppose all reconstruction values satisfy (Lloyd’s)centroid conditions – they minimize squared error inrespective intervals.

-^

Then,

2

) (

2

2

) (

2

2

2

2

2

2

) (

2

2

2

]

[

] [ ] ) ) (

[(

]

[

]

[

]

[

]

[

X q X X q X

X q

X

E

E

X

E

X

E E

X

E E

X

X

ε

ε

ε