Digital Communication Systems ECS 452
Asst. Prof. Dr. Prapun Suksompong [email protected] 4. Mutual Information and Channel Capacity Office Hours: Check Google Calendar on the course website. Dr.Prapun’s Office: 6th floor of Sirindhralai building, 1 BKD Digital Communication Systems ECS 452 Asst. Prof. Dr. Prapun Suksompong [email protected] Operational Channel Capacity
14 Channel Capacity
[Section 4.2] “Operational”: max rate at which reliable communication is possible
Channel Capacity Arbitrarily small error probability can be achieved.
“Information”: [bpcu] 𝐩 [Section 4.3]
Shannon [1948] shows that these two quantities are actually the same.
15 System Model for Section 3.4
Message Transmitter
Information Source Channel Digital Source Encoder Encoder Modulator Transmitted Remove Add X: channelSignal input redundancy systematic redundancy EquivalentChannel Channel Recovered Decoded Message value Received Y: channelSignal output Source Channel Digital Destination Decoder Decoder (Detector)Demodulator
Receiver In Chapter 3, we studied how to find the optimal decoder. Some results from Section 3.3-3.4
17 Under appropriate assumptions, minimum distance decoder is optimal. System Model for Section 3.5
Message Transmitter
Information Source Channel Source Encoder Encoder
Remove Add systematic X: channel input redundancy redundancy Equivalent Channel Recovered Decoded Message value Y: channel output Source Channel Destination Decoder Decoder (Detector)
Receiver We then introduced the channel encoder box. [3.62] Block Encoding
Channel X Encoder k bits k bits k bits n bits n bits n bits 𝒏, 𝒌 code 𝒌 Code rate = 𝒏 [3.62] Block Encoding
Channel X Encoder k bits k bits k bits n bits n bits n bits 𝒏, 𝒌 code 𝒌 Code rate = 𝒏 Example: Repetition Code
Channel X 1 0 1 111110000011111 Encoder 1bit 1bit 1bit 5 bits 5 bits 5 bits 𝟓, 𝟏 code 𝟏 Code rate = 𝟓 [3.62] Block Encoding
Channel X Encoder k bits n bits
𝑀 2 possibilities 𝐱 Choose 𝑀 2 from 𝒔 𝐱 𝐬 2 possibilities to be [Figure 13] 𝐬 𝐱 used as codewords. 𝐬 𝐱
Codebook Repetition Code
22 Review: Channel Encoder and Decoder 𝑀 2 possibilities 𝐱 Choose 𝑀 2 from 𝒔 𝐱 𝐬 2 possibilities to be 𝐬 𝐱 used as codewords. 𝐬 Message (Data block) 𝐱 Channel Digital Encoder Modulator Transmitted k bits k bits k bits Signal Add n bits n bits n bits systematic redundancy 0 1-p 0 p Channel Binary Symmetric p 1 1-p 1 Channel with p < 0.5 Received Noise & Interference Signal Channel Digital Recovered Message Decoder Demodulator
23 minimum distance decoder Example: Repetition Code [Figure 14] Original Equivalent Channel: 0 1-p 0 p p 1 1-p 1 BSC with crossover probability p = 0.01 New (and Better) Equivalent Channel:
1-p Repetition 0 0 Majority 0 0 Code with p p Vote 1 1 n = 5 1 1-p 1
Use repetition code with n = 5 at the transmitter Use majority vote at the receiver 5 5 5 𝑝 1 𝑝 𝑝 1 𝑝 𝑝 1 𝑝 New BSC with 𝑝 3 4 5 10 24 [From ECS315]
25 MATLAB
close all; clear all;
% ECS315 Example 6.58 % ECS452 Example 3.66 C = [0 0 0 0 0; 1 1 1 1 1]; % repetition code
p = (1/100); PE_minDist(C,p)
Code C is defined by putting all its (valid) codewords as its rows. For repetition >> PE_minDist_demo1 code, there are two codewords: 00..0 and 11..1. ans = 9.8506e-06 Crossover probability of the binary symmetric channel. 26 function PE = PE_minDist(C,p) MATLAB % Function PE_minDist_3 computes the error probability P(E) when code C % is used for transmission over BSC with crossover probability p. % Code C is defined by putting all its (valid) codewords as its rows. M = size(C,1); k = log2(M); n = size(C,2);
% Generate all possible received vectors Y = dec2bin(0:2^n-1)-'0';
% Normally, we need to construct an extended Q matrix. However, because % each conditional probability in there is a decreasing function of the % Hamming distance, we can work with the distances instead of the % conditional probability. In particular, instead of selecting the max in % each column of the Q matrix, we consider min distance in each column. dmin = zeros(1,2^n); for j = 1:(2^n) % for each received vector y, y = Y(j,:); % find the minimum distance (the distance from y to the closest % codeword) d = sum(mod(bsxfun(@plus,y,C),2),2); dmin(j) = min(d); end
% From the distances, calculate the conditional probabilities. % Note that we compute only the values that are to be selected (instead of % calculating the whole Q first). n1 = dmin; n0 = n-dmin; Qmax = (p.^n1).*((1-p).^n0); % Scale the conditional probabilities by the input probabilities and add % the values. Note that we assume equally likely input. PC = sum((1/M)*Qmax); PE = 1-PC; end 27 MATLAB
28 Example: Repetition Code Original Equivalent Channel: 0 1-p 0 p p 1 1-p 1 BSC with crossover probability p New (and Better) Equivalent Channel:
1-p Repetition 0 0 Majority 0 0 Code with p p Vote 1 1 n = 5 1 1-p 1
Use repetition code at the transmitter Use majority vote at the receiver New BSC with new crossover probability 29 MATLAB close all; clear all;
0.5
% ECS315 Example 6.58 0.45 % ECS452 Example 3.66 0.4 C = [0 0 0 0 0; 1 1 1 1 1]; 0.35 0.3
0.25 syms p; P(E) PE = PE_minDist(C,p) 0.2 pp = linspace(0,0.5,100); 0.15 0.1 PE = subs(PE,p,pp); 0.05
plot(pp,PE,'LineWidth',1.5) 0 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 xlabel('p') p ylabel('P(E)') grid on >> PE_minDist_demo2
PE = (p - 1)^5 + 10*p^2*(p - 1)^3 - 5*p*(p - 1)^4 + 1 30 Searching for the best encoder Now that we have MATLAB function PE_minDist, for specific values of n, k, we can try to search for the encoder that minimizes the error probability. Recall that, from Example 3.64, there are reasonable encoders. Even for small n and k, this is a large space to look at every possible cases.
31 Example: Repetition Code
0 1-p 0 0 0 Repetition p Majority p Vote Code 1 1 1 1-p 1 𝑝 0.1
𝒏 1 𝑝 0.1 3 3 3 𝑝 1 𝑝 𝑝 0.0280 2 3 5 5 5 5 𝑝 1 𝑝 𝑝 1 𝑝 𝑝 0.0086 3 4 5 7 0.0027 9 8.9092 10 11 2.9571 10
32 Channel Capacity
[Section 4.2] “Operational”: max rate at which reliable communication is possible
Channel Capacity Arbitrarily small error probability can be achieved.
“Information”: [bpcu] 𝐩 [Section 4.3]
Shannon [1948] shows that these two quantities are actually the same.
33 Digital Communication Systems ECS 452 Asst. Prof. Dr. Prapun Suksompong [email protected] 5. Channel Coding
Office Hours: Check Google Calendar on the course website. Dr.Prapun’s Office: 6th floor of Sirindhralai building, 1 BKD Review: Channel Encoder and Decoder
Message Transmitter S Information Source Channel Digital Source Encoder Encoder Modulator Transmitted Add X: channelSignal input systematic redundancy 0 1-p 0 p Channel p 1 1-p 1 Noise & Interference Recovered Message Receiver Received Y: channelSignal output 𝐒 Source Channel Digital Destination Decoder Decoder Demodulator
2 System Model for Chapter 5
Transmitter s Channel Digital Message Encoder Modulator Transmitted Add x: channelSignal input systematic redundancy 0 1-p 0 p Channel p 1 1-p 1
Received Noise & Interference Receiver y: channel output 𝐬 Signal Channel Digital Recovered Message Decoder Demodulator
3 𝑣 Vector Notation 𝑣 0,0: the zero vector ⋮ (the all-zero vector) : column vector 𝑣 ⋮ 1,1: the one vector 𝑣 (the all-one vector) : row vector 𝑟 ,𝑟 ,…,𝑟 ,…𝑟 Subscripts represent element indices inside individual vectors. th and refer to the i elements inside the vectors and , respectively. When we have a list of vectors, we use superscripts in parentheses as indices of vectors. is a list of M column vectors is a list of M row vectors and refer to the ith vectors in the corresponding lists. 4 Harpoon a long, heavy spear attached to a rope, used for killing large fish or whales
5 Review: Channel Decoding Recall 1. The MAP decoder is the optimal decoder. 2. When the codewords are equally-likely, the ML decoder the same as the MAP decoder; hence it is also optimal. 3. When the crossover probability of the BSC p is < 0.5, ML decoder is the same as the minimum distance decoder. In this chapter, we assume the use of minimum distance decoder. 𝐱 𝐲 arg min 𝑑 𝐱 ,𝐲 𝐱 Also, in this chapter, we will focus less on probabilistic analysis, but more on explicit codes.
6 Digital Communication Systems ECS 452 Asst. Prof. Dr. Prapun Suksompong [email protected] 5.1 Binary Linear Block Codes
Office Hours: Check Google Calendar on the course website. Dr.Prapun’s Office: 6th floor of Sirindhralai building, 7 BKD Review: Block Encoding We mentioned the general form of channel coding over BSC. In particular, we looked at the general form of block codes. Block Encoder
k bits k bits k bits n bits n bits n bits Code length “Dimension” of the code (n,k) codes: n-bit blocks are used to conveys k-info-bit blocks Assume n > k codewords “messages” Max. achievable rate Rate: . Recall that the capacity of BSC is 𝐶 1 𝐻 𝑝 . For 𝑝∈ 0,1 , we also have 𝐶∈ 0,1 . Achievable rate is < 1. 8 System Model for Section 5.1
Transmitter s Channel Digital Message Encoder Modulator n bits Transmitted k bits Add x: channelSignal input systematic redundancy 0 1-p 0 p Channel p 1 1-p 1
Received Noise & Interference Receiver y: channel output 𝐬 Signal Recovered Message Channel Digital Decoder Demodulator k bits n bits
9 = the collection of all codewords for the code considered Each n-bit block is selected from . The message (data block) has k bits, so there are 2k possibilities. A reasonable code would not assign the same codeword to different messages. Therefore, there are 2k (distinct) codewords in . Ex. Repetition code with n = 3
10 MATHEMATICAL SCRIPT CAPITAL C
11 [ http://www.charbase.com/1d49e-unicode-mathematical-script-capital-c ] GF(2) The construction of the codes can be expressed in matrix form using the following definition of addition and multiplication of bits: 01 01 0 01 000 110 101 These are modulo-2 addition and modulo-2 multiplication, respectively. The operations are the same as the exclusive-or (XOR) operation and the AND operation. We will simply call them addition and multiplication so that we can use a matrix formalism to define the code. The two-element set {0, 1} together with this definition of addition and multiplication is a number system called a finite field or a Galois field, and is denoted by the label GF(2). 12 Modulo operation The modulo operation finds the remainder after division of one number by another (sometimes called modulus). Given two positive numbers, (the dividend) and (the divisor), (abbreviated as ) is the remainder of the division of by . quotient 13 “ ” divisor 6 83 dividend “ ” 6 In MATLAB, mod(5,2) = 1. 23 Congruence relation quotient 2 18 divisor 2 5 dividend 5 ≡ 1 mod 2 5 remainder 4 13 1 remainder GF(2) and modulo operation Normal addition and multiplication (for 0 and 1): 01 01 001 000 112 101
Addition and multiplication in GF(2): 01 01 0 01 000 110 101
14 GF(2) The construction of the codes can be expressed in matrix form using the following definition of addition and multiplication of bits: 01 01 0 01 000 110 101 Note that x 0 x x 1 x xx 0 The above property implies x x By definition, “-x” is something that, when added with x, gives 0. Extension: For vector and matrix, apply the operations to the elements the same way that addition and multiplication would normally apply 15 (except that the calculations are all in GF(2)). Examples Normal vector addition:
1 121 2 3 0 1 1 2 2 2
Vector addition in GF(2): Alternatively, one can also apply normal vector addition first, then apply “mod 2” to each element:
1011⊕ 0101
1011⊕ 0101 1110 1112 1110
16 Examples Normal matrix multiplication: 7 2 4 3 + 3 7 14 12 21
743 2 4 23 14 256 3 8 31 4 189 7 6 41 6 Matrix multiplication in GF(2):
1 · 1 0 · 0 1 · 1 101 Alternatively, one can also apply normal matrix multiplication first, then apply “mod 2” to each element: 10111 01 10111 21 01 00101 10 00101 10 10 11110 00 11110 22 00 17 Galois: Introduction
18 [ https://www.youtube.com/watch?v=Mc0bvea6G3I ] Galois: Introduction
On the morning of May 30th, 1832, two men in Paris fought a duel. Not an unusual event for those days. One of the men was shot in the gut and died the following day... 19 Galois: Introduction
Do not cry Alfred I need all my courage to die at 20.
20 Galois: Introduction
The night before the duel, Galois sent several letters. Some were to his political colleagues but one of his letters in particular has become famous amongst mathematicians. Fearing that he might die, Galois assembled his mathematical discoveries and sent them to his friend with instructions to pass him along to two of 21 the best mathematicians of the day: Gauss and Jacobi. Galois: Introduction
The papers laid dormant until over a decade later when the letter made its way to the mathematician Liouville who took the time to read through the manuscripts and sought to their publication.
The world finally learned that as a teenager Galois had solved one of the most important problems in algebra.
22 Galois: Contribution
23 [ https://www.youtube.com/watch?v=Mc0bvea6G3I ] Galois: Contribution
In algebra, you learn to solve equations. To solve quadratic equations you use a quadratic formula. To solve cubic equations, you use the less well-known cubic formula and to solve equations of degree four, you use the quartic formula... Galois proved that for degrees five and higher, there are no general formulas.
To prove this Galois created new mathematics which we now call Galois theory in his honor. 24 Galois: Life
25 [ https://www.youtube.com/watch?v=Mc0bvea6G3I ] Galois: Life
Galois’ tale was tinged with frustration, trouble, and tragedy.
26 Galois: Life
27 [ https://www.youtube.com/watch?v=Mc0bvea6G3I ] Galois: Life
Unfortunately, Galois was not very good at patiently explaining his ideas to others. He entered math contests and sent his work to leading mathematicians but his writing was considered incomprehensible.
28 Galois: Life
troubled genius, indeed!
29 BSC and the Error Pattern For one use of the channel,
x BSC y
Again, to transmit k information bits, the channel is used n times.
b Encoder x BSC y 1 k 1 n y xe
error pattern Its nonzero elements mark the 30 positions of transmission error in y Additional Properties in GF(2) The following statements are equivalent 1. Having one of these is the same 2. as having all three of them. 3. The following statements are equivalent 1. 2. Having one of these is the same 3. as having all three of them. In particular, because , if we are given two quantities, we can find the third quantity by summing the other two.
2 Linear Block Codes Definition: is a (binary) linear (block) code if and only if forms a vector (sub)space (over GF(2)). In case you forgot about the concept of vector space,… Equivalently, this is the same as requiring that f and then
Note that any (non-empty) linear code must contain 0.
Ex. The code that we considered in Problem 5 of HW3 is 00000,01000,10001,11111 Is it a linear code?
31 Linear Block Codes: Motivation (1) Why linear block codes are popular? Recall: General block encoding Characterized by its codebook.
𝑀 2 possibilities 𝐱 Choose 𝑀 2 from 𝒔 𝐱 𝐬 2 possibilities to be 𝐬 𝐱 used as codewords. 𝐬 𝐱 [See p. 51 in Ch. notes.] 3 of the lecture Ch. 51 in [See p.
Can be realized by combinational/combinatorial circuit. 32 If lucky, can used K-map to simplify the circuit. Linear Block Codes: Motivation (2) Why linear block codes are popular? Linear block encoding is the same as matrix multiplication. See next slide. The matrix replaces the table for the codebook. The size of the matrix is only bits. Compare this against the table (codebook) of size 2 𝑘 𝑛 bits for general block encoding. Linearity easier implementation and analysis Performance of the class of linear block codes is similar to performance of the general class of block codes. Can limit our study to the subclass of linear block codes without sacrificing system performance. 33 Linear Block Codes: Generator Matrix