A fair coin is flipped a million times and you have to store the result. Compression cannot help. The entropy of a fair coin is bit per flip, so a million bits is the least that will do.
Now change the rules a little. You are allowed to get some of the flips wrong. If 11% of the stored flips may be wrong, how many bits do you need?
The answer is half a million: half a bit per flip. Tolerating one error in nine cuts the storage in half. And if half of the flips may be wrong, you need no bits at all, because you can simply guess.
This curve is what the note is about. The number of bits per symbol is called the rate . The amount of error we tolerate is called the distortion . The rate distortion function is the smallest rate that keeps the distortion at or below . Every point above the curve can be reached by some code. No code can reach a point below it.
The main result is a formula for the curve:
where is one source symbol and is the symbol the decoder puts in its place. Section 1 explains what is being minimized. Sections 2 to 4 calculate the minimum for the sources that appear in the problems.
This note follows Chapter 10 of Cover & Thomas, Elements of Information Theory (second edition), referred to below as “the book”. It covers only the parts that Problem Set 6 and the practice Midterm 2 use: calculating for a given source and distortion measure, the two ends of the curve, the Gaussian source, the converse, and sending a source over a noisy channel. It leaves out strongly typical sequences, the general equations for the minimizing distribution, and the Blahut–Arimoto algorithm (book Sections 10.6 to 10.8). The proof that the curve can be reached is given only as an idea.
How to read this note
Every section starts from an example with numbers and then states the general rule. Short calculations are shown in the text, because the same few steps solve every problem here. The two longer proofs, in Section 5, are in collapsed boxes. Homework and exam problems sit in the section they belong to, with the full statement in a box and the solution in a collapsed box below it. Try each problem before opening its solution.
What we use from earlier notes
Every term below is used later. Each has a one-line reminder here.
- Entropy and conditional entropy : the uncertainty in , and what is left of it once is known. Conditioning never increases entropy: . A variable with possible values has entropy at most . See entropy and mutual information.
- Binary entropy : the entropy of a coin with bias . It increases from at to bit at . The problem sheets write this function as . This note writes and keeps the small for differential entropy.
- Mutual information : the number of bits that tells us about .
- Data-processing inequality. If is a Markov chain, then . Processing cannot create information. See data processing.
- Fano’s inequality. If takes values and , then . See Fano’s inequality.
- Convex function and Jensen’s inequality. A function is convex if its graph lies below its chords. For a convex , the average of is at least of the average. See Jensen’s inequality.
- Channel capacity : the largest rate at which a channel can carry bits reliably. See channel capacity.
- Differential entropy : entropy for a continuous variable. Among all variables with , the Gaussian has the largest: . See differential entropy.
1. The Problem
1.1 A small lossy code
Here is the smallest code that shows every part of the problem. Take the fair coin flips three at a time, and store each group of three in one bit: the majority.
| Source flips | Stored bit | Decoder outputs | Flips wrong |
|---|---|---|---|
| 000 | 0 | 000 | 0 of 3 |
| 001, 010, 100 | 0 | 000 | 1 of 3 |
| 011, 101, 110 | 1 | 111 | 1 of 3 |
| 111 | 1 | 111 | 0 of 3 |
Three flips cost one bit, so the rate is bit per flip. The eight groups are equally likely. Six of them come back with one flip in three wrong and two come back exact, so the average fraction of wrong flips is
This code is the purple dot in the figure above, at . It is above the curve, so it is possible, but it is not the best. At a rate of the curve allows . Closing the gap takes codes that work on many more than three flips at a time.
The parts of this code have names, and every code in this note has the same parts.
- The list of sequences that the decoder can output, here , is the codebook. Its members are codewords.
- The encoder looks at the source sequence, finds the closest codeword, and sends its position in the list. That position is the index.
- The decoder outputs the codeword with that index. This output is the reconstruction.
1.2 Encoder and decoder in general
A source produces symbols , independent and all with the same distribution . We write the whole sequence as .
A code of rate has a codebook of codewords, each symbols long. The index is then a number between and . Writing it down takes bits, which is bits per source symbol. The reconstruction is written . In the small code, and .
To say which codeword is “closest”, we need a way to measure how far a reconstruction is from the source.
1.3 Distortion
A distortion measure is a function . It is the cost of representing the source symbol by the reconstruction symbol . Two measures are used far more than any other.
- Hamming distortion: if and otherwise. The average distortion is then the probability of error, . This is what “fraction of flips wrong” measured in the small code.
- Squared-error distortion: , for real-valued sources.
For finite alphabets the measure is often given as a matrix, with one row for each and one column for each . Hamming distortion for a coin is
The distortion between two sequences is the average over their symbols,
and the distortion of a code is the expected value when the source sequence is random. For the small code it is .
1.4 The rate distortion function
A pair is achievable if there are codes with rate , for longer and longer blocks, whose distortion is at most in the limit.
Definition. The rate distortion function is the smallest rate such that is achievable.
This definition is about codes. It says what means, but it gives no way to compute it, since we cannot search over all codes of all lengths.
1.5 The rate distortion theorem
Theorem (rate distortion theorem). For an i.i.d. source and a bounded distortion measure ,
The minimum is over all conditional distributions for which the pair , with joint distribution , has expected distortion at most .
What is. It is a table with one row for each source symbol. Row says: of all the source symbols equal to , what fraction is reconstructed as each ? Every code has such a table. In the majority code a flip comes back wrong one time in four, whatever its value, so the table is
Two numbers can be read off a table, once the source distribution is known:
- its distortion , here ,
- its mutual information , here bits.
What it means. The mutual information of a table is its price in bits per symbol. No code can have a rate below the mutual information of its own table (Section 5 proves this), and good codes on long blocks have a rate barely above it. The majority code pays bits for a table that is worth . That waste is the cost of working on three flips at a time.
So the search for the best code turns into a search for the cheapest table: among all tables with distortion at most , find the one with the smallest mutual information. That smallest value is . The right-hand side of the theorem contains no codes and no block length. It is a calculation about a single source symbol and a single reconstruction symbol .
It also makes sense that less mutual information means fewer bits. A table is a noisy way of copying . The more noise, the less says about , and the less there is to store. The distortion limit is what stops us from adding too much noise.
Reading the formula once. Take the fair coin and . One allowed table is “copy the flip, but get it wrong with probability “. Its distortion is , and its mutual information is
A minimum cannot be larger than the value at one particular table, so . To show that it equals we still have to show that no other table with at most 11% errors is cheaper. That is the work of Section 2.
The parallel with channel capacity is close.
| Channel capacity | Rate distortion | |
|---|---|---|
| What is given | the channel | the source and the measure |
| What we choose | the input distribution | the table |
| What we compute | ||
| What it is | the most bits a channel can carry | the fewest bits a source needs |
Why it is believable. Count, for fair coin flips. There are source sequences of length , all equally likely, and each one needs a codeword that differs from it in at most places. One codeword can serve only the sequences that are that close to it, and there are about of those. So the codebook needs at least
codewords, which is a rate of . The surprising half of the theorem is that about this many are also enough. When is large, a codebook of that size filled at random leaves almost no source sequence without a codeword nearby. The proof uses jointly typical sequences and is not given here. The other half, that no code does better than the formula, is proved in Section 5.
2. Calculating : the Two-Step Method
2.1 The method
We cannot try every table. Almost every problem is solved by two steps that avoid the search.
The two-step method
Step 1: a floor. Show that every allowed table has at least some number. Start from . The first term is fixed by the source, so the work is to show that cannot be large when the distortion is small.
Step 2: one table that reaches the floor. Write down one allowed pair whose mutual information equals that number.
Step 1 gives floor. Step 2 gives floor. So is the floor.
Step 1 is a chain of inequalities. Each inequality becomes an equality only under some condition, and those conditions say what the pair in Step 2 must look like. So Step 2 is never a guess.
2.2 Binary source with Hamming distortion
Let be a coin with , and let the distortion be the probability of error.
Theorem. The rate distortion function of a Bernoulli() source with Hamming distortion is
Assume (otherwise swap the names of the two symbols) and take .
Step 1: the floor. Let be the error indicator: it is when and otherwise. For any table with ,
- Line 2. Once is known, knowing is the same as knowing whether an error occurred.
- Line 3. Dropping the conditioning can only increase an entropy.
- Line 4. is a coin that shows with the error probability. That probability is at most , and is increasing on that range, so the entropy is at most .
In words: once is known, all that is left to learn about is where the errors are, and an error pattern with at most a fraction of errors has entropy at most .
Step 2: a pair that reaches it. Line 3 is an equality when the error indicator is independent of . Line 4 is an equality when the error probability is exactly . Both conditions describe given , so build the pair in that direction: choose first, then produce by flipping with probability .
This backward description, , is called the test channel. Nothing is sent through it. It is only a convenient way to write down the joint distribution of .
One thing is left to choose: . The that comes out of the test channel must have the source distribution, :
For a fair coin this gives . In general is a valid probability exactly when . For this pair and the error probability is , so . The floor is reached.
When . Let always. This is wrong exactly when , so the distortion is , and it costs no bits because the decoder already knows what to output. Hence .
What it means. At the rate is , the lossless rate. Allowing errors lowers the rate by , which is the entropy of the error pattern: these are the bits we no longer have to send. The curve reaches zero at , the error rate of the trivial reconstruction “always output the more likely symbol”.
For example, for a coin with and ,
2.3 Step 1 by counting
Step 1 has a version that works for any distortion matrix of zeros and ones, and it is the one to use in exam problems. It rests on one question:
Given the reconstruction , and given whether a cost was paid, how many values of are still possible?
Call the answers and :
- is the number of source symbols at distortion from a given (the zeros in its column of the matrix),
- is the number of source symbols at distortion from it (the ones in its column).
For the coin, and : knowing and whether there was an error leaves exactly one .
Now let be the cost that actually occurs, or , and let , which is the expected distortion. Then
- Line 1. is computed from and , so writing it next to adds nothing.
- Line 2. The chain rule.
- Line 3. Drop the conditioning in the first term, and split the second term by the value of .
- Line 4. is a coin with bias . Given and , the source is one of symbols, so its entropy is at most . The same holds for with .
The result is worth remembering as it stands:
It says that what leaves unknown about has two parts: whether a cost was paid, and which of the remaining candidates is. Here is what it gives for the three matrices in this note.
| Source and distortion | Bound on | ||
|---|---|---|---|
| Coin, Hamming (Section 2.2) | |||
| symbols, Hamming (the next problem) | , which is Fano’s inequality | ||
| Three symbols with ties (practice midterm, Section 3) |
The first three lines of the chain are the hint printed in the practice midterm problem. Two more things finish a calculation.
From to . We only know , and we want the bound with in it. That is allowed when the right-hand side is increasing in . Its derivative is , which is nonnegative exactly when . In the three rows above this limit is , and .
Reaching the floor. Line 3 is an equality when is independent of . Line 4 is an equality when is equally likely to be any of its candidates. So the test channel gives probability to each zero-cost and to each cost-one . Then check that comes out with the source distribution.
HW6 Problem 2: Rate distortion for uniform source with Hamming distortion (book Problem 10.5)
Let be uniformly distributed on . Find the rate distortion function of under Hamming distortion,
Solution to Problem 2
Answer.
Step 1. Let . Given , no error leaves one possible and an error leaves . So , , and the counting bound of Section 2.3 (here it is Fano’s inequality) gives
We want to replace by , so we need the right-hand side to be increasing in . Its derivative is
which is nonnegative exactly when , that is, when . So for ,
Step 2. Equality needs the error to be independent of and, when there is an error, to be equally likely to be any of the other symbols. So take uniform on and the test channel
By symmetry is uniform, as required. The error probability is , and . The floor is reached.
Large distortion. Output a fixed symbol, say . It is wrong with probability , and it costs no bits. So for . As a check, the formula gives at , so the two pieces join.
With this is , the fair coin of Section 2.2.
3. The Two Ends of the Curve
Before computing a whole curve it helps to know where it starts and where it ends. Both ends can be found without the two-step method, and exam problems often ask for them separately.
3.1 The right end:
Suppose the decoder gets no bits at all. It must output a reconstruction that does not depend on the source, and the best it can do is to output, every time, the single symbol with the smallest average cost. That cost is
Then for every , and for every .
To find from a distortion matrix: weight each row by , add up each column, and take the smallest column sum. For example, take a coin with and Hamming distortion. The rows have weights and .
So : always output , and be wrong on the 20% of symbols that are . In general a coin has , and the uniform source on symbols has , since every column sum is the same.
The reason no other zero-rate scheme does better is short. exactly when is independent of . For an independent the expected distortion is an average of the column sums, and an average cannot be smaller than the smallest of them.
3.2 The left end:
At every symbol must be reconstructed at zero cost.
If the only zero-cost reconstruction of is itself, as with Hamming distortion, then and
This is lossless compression. The source coding theorem of the earlier notes is the point of this theory.
With ties, can be smaller than . A row of the distortion matrix with more than one is a tie: that source symbol has several reconstructions that cost nothing. Then does not have to identify , and fewer bits are needed.
For example, let be uniform on and let the reconstruction be one of two labels: “low”, which costs nothing when , and “high”, which costs nothing when . Zero distortion only requires us to say which half is in. That takes bit, while bits.
The count of Section 2.3 gives the general rule. At only zero-cost pairs may occur, so given the source is one of symbols. Hence and
with equality when some allowed pair makes equally likely to be any of the candidates. In the example, and bit.
The figure shows the distortion measure of the practice midterm problem at the end of this section. Each reconstruction symbol is free for two source symbols, so and .
3.3 Infinite distortion: forbidden pairs
An entry equal to marks a forbidden pair: that must never be reconstructed as that . The reason is that any table that gives the pair positive probability has infinite expected distortion. So for every finite ,
This removes most of the freedom in the table. Often only one or two free numbers remain, and then can be written as a function of them and minimized directly. The next two problems are of this kind.
The rate distortion theorem was stated for bounded distortion measures. The two problems ask for the formula itself, which is well defined with infinite entries.
HW6 Problem 1: Rate distortion function with infinite distortion (book Problem 10.2)
Let , and consider the distortion measure
Find the rate distortion function .
Solution to Problem 1
Answer.
Which tables are allowed. The pair is forbidden, so a source is always reconstructed as . The only freedom is what happens to a source . Let
The only pair with distortion is , which has probability . So the distortion is , and the constraint is .
The mutual information as a function of . The reconstruction is only when and it is kept, so . Given the reconstruction is certain. Given it is a coin with bias . Hence
Which is best. At this is , and at it is . Mutual information is a convex function of for a fixed , and here depends linearly on , so is a convex function of . A convex function on that attains its smallest possible value, , at is nonincreasing on . So we should take as large as the constraint allows: when . Substituting gives the answer.
Large distortion. For take , that is, always. This agrees with Section 3.1: the column sums are for and for , so .
Another form. Computing instead gives the same function written differently. When the source is certainly . When , which has probability , the source is with probability . So
At both forms give bits.
HW6 Problem 3: Erasure distortion (book Problem 10.7)
Let , let the reconstruction alphabet be , where denotes an erasure, and let the distortion matrix be
with rows indexed by and columns by . Find the rate distortion function of this source. Can you suggest a simple scheme that achieves any value of the rate distortion function?
Solution to Problem 3
Answer. for , and for .
Which tables are allowed. Reconstructing a bit as the opposite bit is forbidden. So each source bit is either reproduced exactly, at cost , or erased, at cost . The expected distortion is the probability of erasure:
Step 1. If is or , then and nothing is uncertain. Uncertainty about remains only when , and then it is at most bit. So
and .
Step 2. Erase each source bit with probability , independently of its value. Then , and given an erasure the source bit is still a fair coin, so . Both inequalities are equalities, and . The test channel from to is not needed here. Read from to , this is a binary erasure channel with erasure probability , whose capacity is also .
Large distortion. Erasing everything gives distortion at rate , and the column sums confirm .
A simple scheme. Out of every source bits, store the first exactly and declare the rest erased. This uses bits, so the rate is , and the fraction of erasures is . It reaches the curve at every point, with no long codebook and no search for the closest codeword. This is unusual. It happens here because the curve is a straight line between the points and , so mixing the two trivial schemes “store the bit” and “erase the bit” is already optimal.
The last problem of this section is from the practice midterm. It uses everything so far: a tie at zero distortion, Step 1 by counting, a test channel, and .
Practice Midterm 2, Problem 4: Rate distortion (15 points)
Consider a ternary source coding problem with . Suppose the source is uniformly distributed, and the distortion measure is given by
Alternatively, we can describe the distortion measure by the matrix
Note: for each source symbol there are two reproduction symbols that result in zero distortion.
(a) Find for . (Be careful, this is not the same as lossless source coding.)
(b) For , show that
Hint: you may want to use the following as a starting point,
and then show that
where .
(c) Find a joint distribution on that achieves the lower bound in part (b), thus establishing that the lower bound in (b) equals for .
(d) Show that for .
Solution to Practice Midterm 2, Problem 4
Read the matrix first. All arithmetic on symbols is modulo . The pair costs exactly when . So, given the reconstruction :
- the source symbols at distortion are and , so ,
- the source symbol at distortion is , so .
(a) bits.
Lower bound. At only zero-cost pairs may occur. Given , the source is then one of two symbols, so and
A distribution that meets it. Let be uniform, and given let be or with probability each. Then is uniform by symmetry, the distortion is , and .
This is less than bits, the rate of lossless coding. The decoder does not need to know . It only needs to name a symbol that is free for , and there are two such symbols to choose from.
(b) Follow the hint. Write and . In the last line of the hint:
- , since is or .
- Given and , the source is one of two symbols, so .
- Given and , the source is for certain, so .
Therefore
To replace by we need to be increasing. Its derivative is
which is nonnegative exactly when , that is, when . Since , we get , and
(c) Make every inequality in (b) an equality. We need independent of , the distortion equal to , and equally likely to be either of its two candidates when . So let be uniform on and use the test channel
Check the three requirements. Each receives probability , so is uniform. The distortion is . And
because choosing among the three outcomes is the same as first deciding whether there is an error, which has entropy , and then, with probability , flipping a fair coin between the two free symbols. So , and this is for . At it agrees with part (a).
(d) Let always. The distortion is only when , which has probability . A constant reconstruction carries no information, so the pair is achievable and . Since is never negative and never increases with , for all . This is of Section 3.1: every column of the matrix has exactly one , so every column sum is .
As a check, the formula of part (c) also gives zero at , because :
4. The Gaussian Source
4.1 The rate distortion function
Now the source is a real number, , and the cost is the squared error . The theorem of Section 1.5 still holds, with differential entropies in place of entropies, and the same two steps work.
Theorem. The rate distortion function of a source with squared-error distortion is
Step 1: the floor. For any pair with ,
- Line 2. The first term is the entropy of a Gaussian. In the second, is known, so subtracting it is only a shift, and a shift does not change differential entropy.
- Line 3. Dropping the conditioning can only increase an entropy.
- Line 4. The error has mean square at most , and no variable with that mean square has more entropy than a Gaussian of variance .
These are the same moves as for the coin. There the error was and its entropy was at most . Here the error is and its entropy is at most .
Step 2: a pair that reaches it. Line 3 is an equality when the error is independent of . Line 4 is an equality when the error is Gaussian with variance exactly . So build the pair from again: the test channel adds independent Gaussian noise to the reconstruction.
The variance of is chosen so that has variance , as the source requires. This is possible when .
When . Output always. The squared error is , at no cost. So .
What it means. Turn the formula around to get the smallest distortion at a given rate:
Each extra bit per sample divides the squared error by four. With bit per sample the best possible distortion is .
Compare this with the obvious way to spend one bit on one sample: send the sign of , and reconstruct a positive sample as and a negative one as (the averages of the two halves of the bell curve). This is the best that can be done with one sample at a time, and its distortion is . The curve promises at the same rate. As with the majority code of Section 1.1, the gap is closed only by describing many samples together with one index, even though the samples are independent.
The next problem repeats the two steps for a source that is not Gaussian. They no longer meet, but they trap between two bounds.
HW6 Problem 4: Bounds on rate distortion function for squared-error distortion (book Problem 10.8)
Let be a continuous random variable with mean and variance , and use squared-error distortion. Show that
For the upper bound, consider the test channel
where is independent of . Using these bounds, decide whether a Gaussian random variable is harder or easier to describe than a non-Gaussian one with the same variance.
(The problem sheet writes for the differential entropy. It is written here.)
Solution to Problem 4
Lower bound. This is Step 1 of Section 4.1 without replacing by its Gaussian value. For any with ,
The last line uses that has mean square at most , so its entropy is at most that of a Gaussian with variance . The bound holds for every allowed , so it holds for the minimum, .
Upper bound. is a minimum, so the mutual information of any allowed test channel is an upper bound. Use the one in the statement, and write and for the variance of .
It meets the distortion limit. The error is , with . Since and are independent with mean zero,
Its mutual information. Multiplying by the constant can be undone, so . Then
The inequality holds because has variance , and a Gaussian has the largest entropy for a given variance. The last step uses . Hence .
Is the Gaussian harder or easier? Harder. For a Gaussian source equals (Section 4.1). For every other source with the same variance, is at most that. So at every distortion the Gaussian needs at least as many bits as any other source of the same variance.
The two bounds differ by . This is zero for a Gaussian and positive for every other density, since the Gaussian has the largest differential entropy for a given variance. The further a source is from Gaussian, the more room there is to describe it with fewer bits.
4.2 Several independent Gaussians: reverse water-filling
Suppose we must describe independent Gaussian components with different variances , and the limit is on the total squared error . How should the distortion be shared among the components?
Start with two components, with variances and .
- Total distortion . Give each component the same distortion, . The rate is bits.
- Total distortion . An equal share would be each, but the second component has variance only . Outputting for it already has distortion and costs nothing. So drop it, with , which leaves . The rate is bits, all spent on the first component.
The general rule is the same: an equal level for every component, except that no component is given more distortion than its own variance.
Theorem (reverse water-filling).
where the level is chosen so that .
What it means. Every component is described down to the same distortion . A component whose variance is already below is not described at all: the decoder outputs for it, its distortion is its whole variance, and it receives no bits. All the bits go to the components with large variance.
The reason for the equal level is that the rate of component is , so allowing it a little more distortion saves bits in proportion to . If two components had different , moving some distortion from the larger to the smaller would lower the total rate. The exception is a component that has reached . Its rate is already zero and cannot be lowered further.
The name comes from the channel version of the same picture. There, power is poured on top of the noise levels up to a common water level. Here the level is drawn from above, and what lies under it is thrown away.
5. The Converse: No Code Can Beat
Sections 2 to 4 calculated the formula . This section shows that no code can do better than the formula. From here on, stands for the formula.
5.1 The curve is nonincreasing and convex
Lemma. is a nonincreasing, convex function of .
What it means. The curve falls, and it falls most steeply at the start: the first units of distortion we tolerate save the most bits. Every curve in this note has this shape. The straight line of the erasure problem is the borderline case.
It is nonincreasing because a larger allows more tables, and a minimum over a larger set cannot be larger. Convexity takes one more idea, which is to mix two tables.
Proof that is convex
Take two points on the curve, and , reached by the tables and . Mix them:
- Its distortion. Distortion is an average, so it mixes in the same proportion: .
- Its mutual information. Mutual information is a convex function of for a fixed (a consequence of the convexity of relative entropy). So the mixture has mutual information at most .
is a minimum, so it is no larger than the mutual information of this particular table. Hence
5.2 The converse
Theorem (converse). Let be an i.i.d. source and let be any sequence with , however it was produced. Then
What it means. To be within distortion of the source, a reconstruction must contain at least bits of information about it. The statement does not mention an encoder or an index, so it applies to every way of producing . The next section uses it when the reconstruction is made from the output of a noisy channel.
Why this limits every code. Take a code with rate and distortion at most , and let be the index it sends. Then
The index takes at most values, so its entropy is at most . Mutual information with cannot exceed the entropy of . The reconstruction is computed from alone, so by the data-processing inequality it cannot know more about than does. The last step is the theorem. So : the index is the only way information reaches the decoder, and it must carry at least bits.
Proof of the converse
Write for the distortion of the -th symbol.
- Line 2. The source symbols are independent, so is a sum. The second sum is the chain rule.
- Line 3. Dropping part of the conditioning can only increase each entropy.
- Line 5. The pair has the source distribution and distortion , and is the smallest mutual information of any such pair.
- Line 6. Jensen’s inequality for the convex function .
- Line 7. The average of the is the distortion of the whole sequence, which is at most , and is nonincreasing.
6. Sending a Source over a Noisy Channel
The source-channel separation theorem said that a source can be sent over a channel with vanishing error exactly when its entropy is below the capacity. If the entropy is above the capacity, perfect reconstruction is impossible. But we may be content with a reconstruction that is only close. How close can it be?
Start with an example. Fair coin flips are sent over a binary symmetric channel with flip probability , one channel use per flip. The capacity is bits per use, less than the bit per flip that the source produces, so some flips must arrive wrong. The fewest errors come from the at which the source needs exactly what the channel delivers:
No scheme can deliver the flips with fewer than 11% errors. For this source and channel, sending the flips uncoded already achieves it.
Theorem (source-channel separation with distortion). Let be an i.i.d. source with a finite alphabet, sent with one channel use per source symbol over a discrete memoryless channel with capacity , and reconstructed as . Distortion can be achieved if , and cannot be achieved if .
What it means. is the number of bits per symbol that the source needs for distortion . is the number of bits per use that the channel delivers. The reconstruction can have distortion exactly when the channel delivers more than the source needs. To find the best distortion for a given source and channel, solve , as in the example.
The two-stage design is again enough: first compress the source to about bits per symbol with a rate distortion code, ignoring the channel, then protect those bits with a channel code, ignoring where they came from. No design that mixes the two stages can reach a smaller distortion.
The proof is the next problem.
HW6 Problem 5: Source-channel separation theorem with distortion (book Problem 10.17)
Let be an i.i.d. source with a finite alphabet. The source sequence is encoded into inputs of a discrete memoryless channel with capacity , and the channel output is mapped to a reconstruction . Let
be the average distortion of this combined source and channel coding scheme, and let be the rate distortion function of .
(a) Show that if , there exist encoders and decoders whose average distortion is arbitrarily close to .
(b) (Converse) Show that if the average distortion equals , then the capacity must be greater than .
Solution to Problem 5
(a) Two stages. Assume the distortion measure is bounded, with largest value . Pick a rate with , and any .
Source code. Since , the rate distortion theorem gives, for large , a code with codewords and distortion at most . It maps to an index .
Channel code. Since , the channel coding theorem gives, for large , a code that sends one of indices over the channel with probability of error at most , whichever index is sent. (The theorem holds for the maximal probability of error. This matters, because the indices produced by the source code need not be equally likely.)
Together. Send with the channel code, decode it as , and output codeword number of the source code. If , the reconstruction is the one the source code intended. If not, the distortion is still at most . So
which is as close to as we like.
(b) Converse. Take any scheme with average distortion . The sequence passes through the stages , and each stage depends only on the one before it, so this is a Markov chain. Then
The first line is the converse of Section 5.2. It applies because is i.i.d. and is within distortion of it, however the reconstruction was produced. The second line is the data-processing inequality for the Markov chain. The third is the fact, from the converse of the channel coding theorem, that uses of a memoryless channel carry at most bits: .
Dividing by gives . So distortion is impossible when . The proof gives , with equality allowed. That is the precise meaning of “greater than” in the statement.
Summary
The problem. A rate distortion code describes source symbols with bits. is the smallest rate at which the average distortion can be kept at or below .
The theorem.
Here is a table saying how often each source symbol is reconstructed as each . Its mutual information is its price in bits per symbol, and is the price of the cheapest table with distortion at most .
How to calculate it.
- Read the distortion matrix. Entries equal to force . Rows with several zeros are ties. For each column count , the number of zeros, and , the number of ones.
- Find the right end: , and for .
- Step 1, the floor: write and use . Check that the bound is increasing in before replacing by .
- Step 2, a pair that reaches it: choose and a test channel that give its distribution, have distortion , and make every inequality an equality. This usually means: the error is independent of , and is uniform over its candidates.
- Check the ends: the formula should give at and at .
Closed forms.
| Source and distortion | Range of | |
|---|---|---|
| Bernoulli(), Hamming | ||
| Uniform on symbols, Hamming | ||
| Fair coin, erasure distortion | ||
| Gaussian , squared error | ||
| Any source with variance , squared error | between and | |
| Independent Gaussians, total squared error | with |
Beyond the stated range, .
Facts to remember.
- is nonincreasing and convex.
- when only has zero distortion. With ties, is smaller.
- Among sources with the same variance, the Gaussian is the hardest to describe.
- Any reconstruction within distortion of an i.i.d. source satisfies .
- A source can be sent over a channel with distortion if , and cannot if .