You are on page 1of 19

Ch.

9 Scalar Quantization Uniform Quantizers

Characteristics of Uniform Quantizers


Constraining to UQ makes the design easier but performance usually suffers For a uniform quantizer the following two constraints are imposed: DBs are equally spaced (Step Size = ) For a given Rate RLs are equally spaced & centered between the DBs Only One Choice to
make in Design

3.5 3

2.5 1.5 0.5 2 0

0.5

1.5 2

2.5 3

3.5

x
This Fig in the book has an error
Output

Mid-Riser SQ

Mid-Step SQ
3.0 2.0 1.0

1.0 2.0 3.0 2

PDF-Optimized Uniform Quantizers


The idea here is: Assuming that you know the PDF of the samples to be quantized design the quantizers step so that it is fX(x) optimal for that PDF.
1/(2Xmax)

For Uniform PDF


-Xmax Xmax

Want to uniformly quantize an RV X ~ U(-Xmax,Xmax) Assume that desire M RLs for R = log2(M) M equally-sized intervals having = 2Xmax/M

Distortion is:

=
2 q

X max

X max

[ x Q ( x )]
i

f X ( x )dx
RLs

DLs

1 = 2 ( x (i ) ) dx i =1 ( i 1) 2 X max
M /2 1 2 2

Now b y exploiting the structure


fX(x) 1/(2Xmax)
2

Each of these integrals is identical!

-Xmax 2
M 2 q = 2 2
/2

Xmax

x
Using =2Xmax/M

/2 1 1 q2 dq = q 2 dq /2 2 X max /2

So the result is:


1 = q dq /2
2 q 2 /2

= 12
2 2 q

To get SQR, we need the variance (power) of the signal Since the signal is uniformly dist. we know from Prob. Theory that 2 ( 2 X max )2 2 M 2 = =
X

12

12

2 X SQR( dB ) = 10log10 2 = 10 log10 M 2 q

For n-bit Quantizer: M = 2n

= 20 log10 2 n = 6.02n dB

6 dB per bit
5

Rate Distortion Curve for UQ of Uniform RV


2 2 2 4 X max X max 2 n 2 = = = 2 12 12 M 3 2 q 2 X max 2 n 2 q = 2 3

2 q

Distortion

Rate

Distortion

2 x

Exponential

Rate (bits/sample)

PDF-Optimized Uniform Quantizers


For Non-Uniform PDF
We are mostly interested in Non-Uniform PDFs whose domain is not bounded. For this case, the PDF must decay asymptotically to zero So we cant cover the whole infinite domain with a finite number of -intervals! We have to choose a & M to achieve a desired MSQE Need to balance to types of errors: Granular (or Bounded) Error Overload (or Unbounded) Error f X ( x)

M=8
Typically, M & are such that OL Prob. is less than the Granular Prob.
-4 4

A fixed version of Fig. 9.10 Not a DB the Rt-most DB is

Not a DB the left-most DB is -

Goal: Given M (i.e., given the Rate n typically M = 2n) Find to minimize MSQE (i.e., Distortion)
M=8
b0 =
7 5 3 2 2 2 2 2 3 5 2 2 7 2

DBs bM = + RLs

Write distortion as a function of and then minimize w.r.t. :

=
2 q i =1

bi

bi 1

( x yi )

f X ( x )dx

Granular

By Assumed Symmetry on PDF

2 M /2 i 1 x (1 2 ) ) f X ( x )dx = 2 ( ( i 1) i =1

Overload

+ 2 M
2

(x (

M 2

1 2

) )

f X ( x )dx
8

Now to minimize take derivative & set to zero:

2 d q

=0

Gets complicated & messy to do analytically solve numerically!


This balances the granular & overload effects to minimize distortion Overload but Granular
2 q

min{ f1 ( x ) + f 2 ( x )}
Slopes are negatives

df1 ( x ) df 2 ( x ) + =0 dx dx df1 ( x ) df ( x ) = 2 dx dx

Distributions that have heavier tails tend to have larger step sizes

How practical are these quantizers?


Useful when source really does adhere to designed-for-pdf Otherwise have degradation due to mismatch Right PDF, Wrong Variance Wrong PDF Type

# of Bits
1 2 3

4 5

10

Adaptive Uniform Quantizers


We use adaptation to make UQ robust to Variance Mismatch Forward-Adaptive Quantization Collect a Block of N Samples
xB,0 xB,1 xB,N-1

Estimate Signal Variance in the


Error in Book

Bth

Block ( B ) = 1 N
2 x

2 x B ,i i =0

N 1

Normalize the Samples in the Bth Block Quantize Normalized Samples

2 x B ,i = x B , i / x ( B )

Always Use Same Quantizer: Designed for Unit Variance

Quantize Estimated Variance


Send as Side Info

Design Issues Block Size Short captures changes, SI misses changes, SI Long # of bits for SI 8 bits is typical

11

Quantization of 16-bit Speech


16-Bit Original vs. 3-bit Fixed Quantizer

16-Bit Original vs. 3-bit Forward-Adapt Quant.

Another Application
Synthetic Aperture Radar (SAR) often uses Block Adaptive Quantizer (BAQ)
12

Alternative Method for Forward-Adaptive Quant. Block-Shifted Adaptive Quantization (BSAQ) Given digital samples w/ large # of bits (B bits) In each block, shift all samples up by S bits
S is chosen so that the MSB of largest sample in block is filled

Truncate shifted samples to b < B bits Side Info = S (use log2(B) bits)
Original 8 bit samples
000000000000 000000000000 000000100000 100100001001 111111111111 101011001110 010001001010 010110010010

Shifted Up by 2 Bits
000000100000 100100001001 111111111111 101011001110 010001001010 010110010010

Truncated to 3 Bits
000000100000 100100001001 111111111111

To Decode: Shift down, fill zeros above & below


000000000000 000000000000 000000100000 100100001001 111111111111 000000000000 000000000000 000000000000

Coded S = 010

13

Backward-Adaptive Quantization
There are some downsides to Forward AQ: Have to send Side Information reduces the compression ratio Block-Size Trade-Offs Short captures changes, SI Coding Delay cant quantize any samples in block until see whole block Backward-Adaptation Addresses These Drawbacks as Follows: Monitor which quantization cells the past samples fall in Increase Step Size if outer cells are too common Decrease Step Size if inner cells are too common Because it is based on past quantized values, no side info needed for the decoder to synchronize to the encoder
At least when no transmission errors occur

no delay because current sample is quantized based on past samples So in principle block size can be set based on rate of signals change How many past samples to use? How are the decisions made? Jayant provided simple answers!!
14

Jayant Quantizer (Backward-Adaptive)


Use single most recent output If it
is in outer levels, increase or is in inner levels, decrease

Assign each interval a multiplier: Mk for the kth interval Update according to: n = M l ( n 1) n 1
New last samples level index Old

Multipliers for outer levels are > 1 (Multipliers are symmetric) inner <1 Specify min & max to avoid going too far

15

Example of Jayant Multipliers

16

How Do We Pick the Jayant Multipliers? IF we knew the PDF & designed for the correct
Then we want the multipliers to have no effect after, say, N samples:
Sequence of multipliers for some observed N samples

M 3M 6 M 4 M1
# of Levels

M4M5 1

( )
Use = for design

Let nk = # of times Mk is used Then ( ) becomes Now taking the Nth root gives

M knk = 1
k =0

M
k =0

nk N k

=1

M kPk = 1
k =0

where we have used the frequency of occurrence view: Pk nk/N For a given designed-for PDF it is possible to find the correct and then find the resulting Pk probabilities Then this Is a requirement on the multipliers Mk values But there are infinitely many solutions!!!!
17

One way to further restrict to get a unique solution is to require a specific Integers (+/-) form on the Mk: lk

Mk =

Real # >1

l P =1
k k

k =0

M lk Pk k =0

=1
)

l P
k =0 k

=0 (

So if weve got an idea of the Pk ( Then use creativity to select :

values for the lk

Large gives fast adaptation Small gives slow adaptation

In general we want faster expansion than contraction: Samples in outer levels indicate possible overload (potential big overload error) so we need to expand fast to eliminate this potential Samples in inner levels indicate possible underload (granular error is likely too big but granular is not as dire as overload) so we only need to contract slowly
18

Robustness of Jayant Quantizer


Optimal Non-Adapt is slightly better when perfectly matched Jayan is significantly better when mismatched

Combining Figs. 9.11 & 9.18


19

You might also like