Professional Documents
Culture Documents
9 Scalar Quantization
1
Encoder: Scalar Quantization
Samples w/ Samples w/
In practice: Large # Bits Small # Bits
(Fine Quantization) (Coarse Quantization)
Samples w/
In practice: Real-Valued Small # Bits
Samples in Time (Coarse Quantization)
2
Samples w/
Real-Valued Small # Bits
Samples in Time (Coarse Quantization)
b0 b1 b2 b3 … bM-1 bM x [b0,b1)
[b1,b2)
→
→
C1
C2
[b2,b3) → C3
:
Binary
Codewords: C1 C2 C3 … CM :
[bM-1,bM) → CM
3
Decoder: Scalar Quantization
Quantized
Bit Stream DT Signal
Decoder
(SQ)
Real #s… but only
M M Reconstruction finitely many
Codewords Levels possible values
C1 → y1
C2 → y2
→
…
C3 y3 Binary
: Codewords: C1 C2 C3 CM
:
CM → yM
y1 y2 y3 yM y
b0 b1 b2 b3 … bM-1 bM
4
Encoder-Decoder = Quantizer
For analysis: View Encoder & Decoder as a Pair
Codeword w/ Real #… but only
Real # Small # Bits finitely many
possible values
Encoder Decoder
Input x (SQ) Bit (SQ) Output y
Stream
Measure Distortion
b0 b1 b2 b3 … bM-1 bM x
y1 y2 y3 yM y
b0 b1 b2 b3 … bM-1 bM
5
Scalar Quantizer Input-Output Map
Q(x)=yi iff bi-1 < x ≤ bi
{ yi }i =1
M
Recon.
Levels
Step Size
Decision
{bi }i =0
M
Boundaries
6
Quantizer Design DBs Impact Rate if
Entropy Coding is used
Specify: 1. Decision Boundaries (DBs)
Set
2. Codewords Set Rate
Distortion
3. Reconstruction Levels (RLs)
To Meet: 1. Distortion Criteria
Sometimes
2. Rate Criteria just MSE
∫ [ x − Q ( x )] f
Theory: σ q2 = ( x )dx
X We use this theoretical view
−∞
in the design process.
M bi
=∑ ∫ [x − y ] f
i X ( x )dx
i =1 bi −1
DBs RLs 7
Experimental: For a sequence of signal values s[n], n= 0, 1, 2, …
sq[n]
1 N
+
s[n] Σ sq[n]
+
e[n] 8
Rate We’ll use Avg # of bits/sample
Let li be the length of the binary code for RL yi.
M
Theory: Then the theoretical Rate is: R = ∑ li P( yi )
i =1
f X ( x) Rˆ =
N
∑ Length {Q( s[n])}
i =1
P(y2)
y1 y2 y3 … yM x
b0 b1 b2 b3 … bM-1 bM 9
Quantizer Design Problem
Two “Flavors” of the problem:
1. Given a Distortion Constraint σ q ≤ D
2 *
10
Tractable Quantizer Design
Two-Stage Encoder Two-Stage Decoder
SQ w/ Entropy Decoder to
Entropy
Fixed-Length Coder Assign RLs
Decoder
Codes (e.g. Huffman)
Design to
Minimize Rate
Design to
Minimize Distortion