Exercises
ex-ch06-01
EasyFor a Bernoulli(0.3) source with Hamming distortion, compute for and sketch the curve.
for .
Compute
bits.
- bits
- bits
- bits
- bits
The curve is convex, decreasing from to 0.
ex-ch06-02
EasyFor a Gaussian source with squared-error distortion, compute the rate needed to achieve SNR = 30 dB.
SNR in linear scale. 30 dB .
Compute
SNR = 30 dB . So . bits/sample.
Alternatively: bits.
ex-ch06-03
EasyExplain why for any source and distortion measure, where .
At , the encoder sends no information; the decoder uses a fixed reconstruction.
Zero-rate codebook
At rate , the codebook has codeword. The best single reconstruction is , achieving distortion . Since when is constant (independent of ), we have .
For Hamming distortion on Bernoulli(): (always output the more likely symbol). For Gaussian squared error: (always output the mean, zero).
ex-ch06-04
EasyA Gaussian source is quantized to 8 bits/sample using an ideal entropy-coded quantizer. What is the achievable SNR according to the R-D bound? What if using a uniform quantizer without entropy coding?
R-D bound: .
Uniform quantizer (no entropy coding): .
R-D bound
. SNR dB.
Uniform without entropy coding
For a uniform quantizer with levels: SNR dB (using the standard formula for uniform quantization of Gaussian). The gap from R-D is about 7.3 dB β this includes both the shaping loss (1.53 dB) and the overload loss.
ex-ch06-05
MediumProve that is convex in directly from the definition (without using the test-channel mixing argument). Hint: use the operational definition β achievability implies a code exists, and time-sharing two codes gives a convex combination.
Given codes achieving and , time-share to achieve .
Time-sharing argument
For , given a code achieving and achieving : use on a -fraction of the source blocks and on the rest. The average rate is and the average distortion is . Since this pair is achievable: Setting : . This is the definition of convexity.
ex-ch06-06
MediumCompute the rate-distortion function for a ternary source uniform on with Hamming distortion .
By symmetry, the optimal test channel is a symmetric channel: if and otherwise.
.
Optimal test channel
By symmetry (uniform source, symmetric distortion), the optimal test channel is a ternary symmetric channel: if , and otherwise. The marginal is also uniform.
Compute mutual information
(uniform). (in bits, where is the binary entropy).
Wait β more carefully: .
So ...
Let me redo this cleanly. With the ternary symmetric channel: .
for . At : bits. At : (always output any fixed symbol).
ex-ch06-07
Medium(Reverse waterfilling.) Two independent Gaussian sources have variances and . Compute the rate-distortion function at total distortion . Which component is "shut off"?
Reverse waterfilling: , .
If , the second component is shut off.
Try $\ntn{rwf_lvl} > 1$
If : (shut off, zero bits allocated). Then . Check: , so . This is the boundary case β the waterfilling level equals .
Compute rate
bit. Only the first (stronger) component gets any bits. The second component contributes its full variance to the distortion budget.
Compare with equal allocation
Equal allocation: . Same result! But for : reverse waterfilling gives , rate bits. Equal allocation: , rate bits. Equal allocation is better here because it doesn't waste bits on the weak component. Wait β reverse waterfilling gives 1.5 bits while equal gives 1.42. Let me recheck: at , satisfies . If : , so . Rate bits. So reverse waterfilling gives 1.42 bits β same as equal allocation! This makes sense: , so both components are active with .
ex-ch06-08
MediumShow that for the Gaussian source, the distortion-rate function satisfies dB, confirming the "6 dB per bit" rule.
Express in dB and use .
Derivation
SNR . In dB: Each bit of rate adds 6.02 dB of SNR β this is the fundamental resolution of digital representation. A 16-bit audio sample (CD quality) achieves dB SNR.
ex-ch06-09
Medium(Blahut-Arimoto.) Implement one iteration of the Blahut-Arimoto algorithm for the binary source with , Hamming distortion, at . Start with .
Update: .
Hamming: if , 1 otherwise.
Update test channel
. For : , . Normalizing: , . For : , . Normalizing: , .
Update marginal
. .
Compute D and R
. . This requires more computation; after convergence (a few more iterations), the algorithm produces the point on the R-D curve corresponding to .
ex-ch06-10
HardProve the converse of the rate-distortion theorem: any sequence of codes with satisfies .
Use .
Single-letterize using .
Use convexity of to get .
Rate lower bound
The encoder output takes values: where the last step uses data processing ().
Single-letterization
by the chain rule and dropping conditioning (conditioning reduces mutual information for independent 's). Each by definition of , where .
Convexity
by convexity (Jensen's inequality applied to convex ) and .
ex-ch06-11
Hard(Wyner-Ziv for binary source.) Let and where independent of (BSC observation). Compute (side information at both encoder and decoder) and compare with for Hamming distortion.
for .
The Wyner-Ziv rate is where .
$R_{XY}(D)$
With side information at both encoder and decoder, the problem reduces to compressing given . Since (the BSC flips with probability ):
$R_{WZ}(D)$
Without side information at the encoder, the Wyner-Ziv rate for this binary case is: where (BSC convolution). This can be shown using the auxiliary in the Wyner-Ziv theorem with , .
Compare
The gap . Since (BSC convolution increases entropy for ), with strict inequality for and . The gap is zero only when (useless side information) or (lossless).
For example, with , : bits. bits. Gap: 0.119 bits (65% overhead for not knowing at the encoder).
ex-ch06-12
Hard(Separation theorem proof sketch.) Prove that a DMS is transmissible over a DMC at distortion if and only if , assuming one channel use per source symbol. Show that separate source and channel coding achieves this.
Achievability: choose with . Use a source code at rate and a channel code at rate .
Converse: and .
Achievability
Choose with . This is possible since . Use a lossy source code at rate achieving distortion (by the R-D theorem). The encoder output is indices β transmit these over the channel using a channel code at rate with (by the channel coding theorem). The overall distortion is where accounts for the (vanishing) channel error.
Converse
Any joint source-channel code maps to via the channel. By data processing: . By the R-D converse: . Combining: , so is necessary.
Optimality of separation
The achievability proof uses separate source and channel codes, while the converse applies to any coding scheme (including joint). Since both give the same condition , separation is optimal. No joint scheme can do better.
ex-ch06-13
Challenge(Rate-distortion for exponential source.) Let (exponential with rate ) and squared-error distortion . Show that for , and compare with the Gaussian R-D at the same variance .
The exponential source has differential entropy nats.
The optimal test channel is NOT Gaussian β the exponential source does not match the Gaussian R-D.
Use the Shannon lower bound .
Shannon lower bound
For any source with differential entropy and squared-error distortion: The "entropy power" is . The Gaussian with the same entropy has variance , and the bound says with .
Compute for exponential
nats bits. Entropy power: . Hmm, this doesn't simplify to .
Actually, for the exponential source, the exact is not available in simple closed form. The Shannon lower bound gives . The actual for the exponential source lies strictly above the Gaussian at the same variance β this is because the Gaussian has the maximum entropy for a given variance, making it the "hardest" source to compress.
Comparison
The Gaussian at variance is . The exponential source has for all , because the Gaussian is the hardest source to compress at a given variance. The gap measures the "non-Gaussianity" penalty and can be computed numerically via Blahut-Arimoto.
ex-ch06-14
Challenge(Successive refinement necessity.) Show that a binary source with and Hamming distortion is NOT successively refinable between some pairs . Specifically, find with such that , i.e., the incremental rate exceeds what successive refinement would require.
For the binary source, the test channel achieving is a BSC().
For successive refinement, we need derivable from via a degraded channel.
Check whether can simultaneously achieve both and .
Degradation constraint
For successive refinement, we need where . If with , then where . For this to give , we need .
Check rates
The rate for is . The incremental rate for in the successive scheme is . The total rate must be achievable, and the base rate must be . The constraint is: can we find a joint distribution achieving both at and at with the degradation structure?
Failure for asymmetric sources
For , the optimal test channel at distortion is BSC(), but the optimal marginal depends on . At : . At : is different. The degradation fixes the relationship between marginals, and for , this constraint prevents both layers from being individually optimal. The gap is small but nonzero.
ex-ch06-15
Challenge(Dithered ECSQ achieves bits.) Show that a uniform quantizer with step , combined with dithering (adding uniform noise independent of before quantization, then subtracting after), achieves distortion for ANY source distribution, and the rate (entropy of the quantized output) is at most bits.
Dithering makes the quantization noise independent of and uniformly distributed.
The entropy of the dithered quantized output is bounded using the entropy power inequality.
Dithered quantization noise
With dithering: where is the uniform quantizer. The quantization noise is . Schuchman's theorem states that is uniformly distributed on and independent of . Therefore , regardless of the distribution of .
Rate bound
The quantized output takes integer values. Its entropy satisfies: (by the entropy bound for integer RVs). Since ... More directly: ...
The clean result (Zamir and Feder, 1996) is: nats. Converting: nats bits... The 0.754 bit figure comes from the full analysis including the entropy of the uniform distribution vs. Gaussian: nats bits is the shaping loss in entropy.
The total gap to : rate bits.