Difference between revisions of "Aufgaben:Exercise 1.2Z: Three-dimensional Representation of Codes"

From LNTwww
Line 1: Line 1:
{{quiz-Header|Buchseite=Kanalcodierung/Zielsetzung_der_Kanalcodierung
+
{{quiz-Header|Buchseite=Channel_Coding/Objective_of_Channel_Coding
 
}}
 
}}
  
[[File:P_ID2400__KC_Z_1_2.png|right|frame|Raum $\rm GF(2^3)$ und <br>Code der Länge $n = 3$]]
+
[[File:P_ID2400__KC_Z_1_2.png|right|frame|Space $\rm GF(2^3)$ and <br>Code of length $n = 3$]]
Codes zur Fehlererkennung bzw. Fehlererkorrektur lassen sich sehr anschaulich im&nbsp; $n$–dimensionalen Raum darstellen. Wir beschränken uns hier auf binäre Codes der Länge&nbsp; $n = 3$:
+
Codes for error detection or error correction can be represented very clearly in&nbsp; $n$-dimensional space. We restrict ourselves here to binary codes of length&nbsp; $n = 3$:
 
:$$\underline{x} = (x_{1}, x_{2}, x_{3}) \hspace{0.1cm} \in \hspace{0.1cm}{\rm GF}(2^3) \hspace{0.05cm},\hspace{0.5cm} x_i = \{0, 1 \}\hspace{0.05cm},\hspace{0.2cm} i = 1, 2, 3\hspace{0.05cm}.$$
 
:$$\underline{x} = (x_{1}, x_{2}, x_{3}) \hspace{0.1cm} \in \hspace{0.1cm}{\rm GF}(2^3) \hspace{0.05cm},\hspace{0.5cm} x_i = \{0, 1 \}\hspace{0.05cm},\hspace{0.2cm} i = 1, 2, 3\hspace{0.05cm}.$$
  
Allgemein gilt bei der Blockcodierung:
+
In general, for block coding:
*Das Informationswort&nbsp; $\underline{u} = (u_{1}, u_{2}, \ \text{...} , \ u_{k})$&nbsp; wird eindeutig in das Codewort&nbsp; $\underline{x} =(x_{1}, x_{2}, \ \text{...} , \ , x_{n})$&nbsp; überführt.
+
*The information word&nbsp; $\underline{u} = (u_{1}, u_{2}, \ \text{...} , \ u_{k})$&nbsp; is uniquely transformed into the codeword&nbsp; $\underline{x} =(x_{1}, x_{2}, \ \text{...} , \ , x_{n})$&nbsp; .
*Die Coderate beträgt&nbsp; $R = k/n$.
+
*The code rate is&nbsp; $R = k/n$.
*Die Hamming–Distanz&nbsp; $d_{\rm H}(x, \hspace{0.05cm}x\hspace{0.05cm}')$&nbsp; zwischen zwei Codeworten&nbsp; $x ∈ \mathcal{C}$&nbsp; und&nbsp; $x\hspace{0.05cm}' ∈ \mathcal{C}$&nbsp; gibt die Anzahl der Bitpositionen an, in denen sich&nbsp; $x$&nbsp; und&nbsp; $x\hspace{0.05cm}'$&nbsp; unterscheiden.
+
*The Hamming distance&nbsp; $d_{\rm H}(x, \hspace{0.05cm}x\hspace{0.05cm}')$&nbsp; between two codewords&nbsp; $x ∈ \mathcal{C}$&nbsp; and&nbsp; $x\hspace{0.05cm}' ∈ \mathcal{C}$&nbsp; indicates the number of bit positions in which&nbsp; $x$&nbsp; and&nbsp; $x\hspace{0.05cm}'$&nbsp; differ.
*Die Minimaldistanz&nbsp; $d_{\rm min} = {\rm min}\big[d_{\rm H}(x, \hspace{0.05cm}x\hspace{0.05cm}')\big]$&nbsp; ist ein Maß für die Korrekturfähigkeit eines Codes.
+
*The minimum distance&nbsp; $d_{\rm min} = {\rm min}\big[d_{\rm H}(x, \hspace{0.05cm}x\hspace{0.05cm}')\big]$&nbsp; is a measure of the correctability of a code.
*Es können&nbsp; $e =d_{\rm min} 1$&nbsp; Fehler erkannt und&nbsp; $t =(d_{\rm min} 1)/2$&nbsp; Fehler korrigiert werden.  
+
*It can&nbsp; $e =d_{\rm min} - 1$&nbsp; detect errors and&nbsp; $t =(d_{\rm min} - 1)/2$&nbsp; correct errors.  
*Die letzte Aussage gilt allerdings nur für ungerades&nbsp; $d_{\rm min}$.
+
*The last statement, however, is valid only for odd&nbsp; $d_{\rm min}$.
  
  
Line 19: Line 19:
  
  
''Hinweise'':
+
Hints:
*Die Aufgabe gehört zum Kapitel&nbsp; [[Channel_Coding/Zielsetzung_der_Kanalcodierung|Zielsetzung der Kanalcodierung]].
+
*This exercise belongs to the chapter&nbsp; [[Channel_Coding/Objective_of_Channel_Coding|Obective of Channel Coding]]
*Zusätzlich werden einige einfache Fragen zum Kapitel&nbsp; [[Channel_Coding/Beispiele_binärer_Blockcodes|Beispiele binärer Blockcodes]]&nbsp; vorweg genommen.
+
*In addition, some simple questions about the chapter&nbsp; [[Channel_Coding/Examples_of_Binary_Block_Codes|Examples of binary block codes]]&nbsp; are anticipated.
 
   
 
   
  
  
  
===Fragebogen===
+
===Questions===
  
 
<quiz display=simple>
 
<quiz display=simple>
  
{Welche Aussagen gelten, wenn alle Punkte in&nbsp; $\rm GF(2^3)$&nbsp; belegt sind?
+
{Which statements hold if all points in&nbsp; $\rm GF(2^3)$&nbsp; are occupied?
 
|type="[]"}
 
|type="[]"}
+ Es gilt die Zuordnung&nbsp; $\underline{u} = (u_{1}, u_{2}, u_{3})$ &nbsp; → &nbsp; $\underline{x} = (x_{1}, x_{2},x_{3})$.
+
+ The assignment&nbsp; $\underline{u} = (u_{1}, u_{2}, u_{3})$ &nbsp; → &nbsp; $\underline{x} = (x_{1}, x_{2},x_{3})$ holds.
- Es gilt die Identität&nbsp; $\underline{x} = \underline{u}$.
+
- The identity&nbsp; $\underline{x} = \underline{u}$ holds.
+ Die Coderate ist&nbsp; $R = 1$.
+
+ The code rate is&nbsp; $R = 1$.
-Die Minimaldistanz zwischen zwei Codeworten ist&nbsp; $d_{\rm min} = 2$.
+
-The minimum distance between two codewords is&nbsp; $d_{\rm min} = 2$.
  
{Welche Aussagen gelten für einen (3, 2, 2)–Blockcode?
+
{Which statements are true for a (3, 2, 2)-block code?
 
|type="[]"}
 
|type="[]"}
+ Code&nbsp; $\mathcal{C}_{1} = \{(0, 0, 0), (0, 1, 1), (1, 0, 1), (1, 1, 0)\}$&nbsp; ist möglich.
+
+ code&nbsp; $\mathcal{C}_{1} = \{(0, 0, 0), (0, 1, 1), (1, 0, 1), (1, 1, 0)\}$&nbsp; is possible.
+ Code&nbsp; $\mathcal{C}_{2} = \{(0, 0, 1), (0, 1, 0), (1, 0, 0), (1, 1, 1)\}$&nbsp; ist möglich.
+
+ Code&nbsp; $\mathcal{C}_{2} = \{(0, 0, 1), (0, 1, 0), (1, 0, 0), (1, 1, 1)\}$&nbsp; is possible.
- Code&nbsp; $\mathcal{C}_{3} = \{(0, 0, 0), (0, 1, 1), (1, 0, 0), (1, 1, 1)\}$&nbsp; ist möglich.
+
- Code&nbsp; $\mathcal{C}_{3} = \{(0, 0, 0), (0, 1, 1), (1, 0, 0), (1, 1, 1)\}$&nbsp; is possible.
  
{Welche Eigenschaften zeigt der in Teilaufgabe '''(2)''' definierte Code&nbsp; $\mathcal{C}_{1}$?
+
{What properties does the code defined in subtask '''(2)''' show&nbsp; $\mathcal{C}_{1}$?
 
|type="[]"}
 
|type="[]"}
+ Ein Bitfehler lässt sich erkennen.
+
+ A bit error can be detected.
- Ein Bitfehler kann korrigiert werden.
+
- A bit error can be corrected.
  
{Welche Eigenschaften zeigt der Code&nbsp; $\mathcal{C}_{4}= \{(0, 0, 0), (1, 1, 1)\}$?
+
{What properties does the code show&nbsp; $\mathcal{C}_{4}= \{(0, 0, 0), (1, 1, 1)\}$?
 
|type="[]"}
 
|type="[]"}
- Die Coderate beträgt&nbsp; $R = 1/4$.
+
- The code rate is&nbsp; $R = 1/4$.
+ Die Coderate beträgt&nbsp; $R = 1/3$.
+
+ The code rate is&nbsp; $R = 1/3$.
+ Ein Bitfehler lässt sich erkennen.
+
+ A bit error can be detected.
+ Ein Bitfehler kann korrigiert werden.
+
+ A bit error can be corrected.
  
  
 
</quiz>
 
</quiz>
  
===Musterlösung===
+
===Solution===
 
{{ML-Kopf}}
 
{{ML-Kopf}}
'''(1)'''&nbsp; Richtig sind die <u>Aussagen 1 und 3</u>:  
+
'''(1)'''&nbsp; Correct <u>statements 1 and 3</u>:  
*Bei dieser Belegung werden $k = 3$ Informationsbits auf $n = 3$ Codebits abgebildet &nbsp; ⇒ &nbsp; $R = k/n = 1$.  
+
*In this assignment, $k = 3$ information bits are mapped to $n = 3$ code bits &nbsp; ⇒ &nbsp; $R = k/n = 1$.  
*Die Aussage $\underline{x} =   \underline{u} $ würde nur bei systematischer Codierung gelten.  
+
*The statement $\underline{x} = \underline{u} $ would only hold in the case of systematic coding.  
*Prinzipiell möglich wäre zum Beispiel auch $(0, 0, 0)$ &nbsp; → &nbsp; $(0, 1, 1)$.  
+
*For example, in principle, $(0, 0, 0)$ &nbsp; → &nbsp; $(0, 1, 1)$ would also be possible.  
*Die letzte Aussage ist mit Sicherheit falsch: Aus der Grafik erkennt man die Minimaldistanz $d_{\rm min} = 1$.
+
*The last statement is certainly false: from the graph one can see the minimum distance $d_{\rm min} = 1$.
  
  
[[File:P_ID2401__KC_Z_1_2b.png|right|frame|Zwei (3, 2, 2)–Blockcodes]]
+
[[File:P_ID2401__KC_Z_1_2b.png|right|frame|Two (3, 2, 2)-block codes]]
'''(2)'''&nbsp; Richtig sind die <u>Aussagen 1 und 3</u>:  
+
'''(2)'''&nbsp; Correct <u>statements 1 and 3</u>:  
*$\mathcal{C}_{1}$ und $\mathcal{C}_{2}$ beschreiben tatsächlich Codes mit der Rate $R = 2/3$ und der Minimaldistanz $d_{\rm min} = 2$.     
+
*$\mathcal{C}_{1}$ and $\mathcal{C}_{2}$ actually describe codes with rate $R = 2/3$ and minimum distance $d_{\rm min} = 2$.     
*In der Grafik markieren die grünen Punkte den Code $\mathcal{C}_{1}$ und die blauen Punkte den Code $\mathcal{C}_{2}$.  
+
*In the graph, the green dots mark the code $\mathcal{C}_{1}$ and the blue dots mark the code $\mathcal{C}_{2}$.  
*Beim Code $\mathcal{C}_{3}$ – ebenfalls mit Rate $R = 2/3$ – ist die minimale Distanz zwischen zwei Codeworten $d_{\rm min} = 1$, zum Beispiel zwischen $(0, 0, 0)$ und $(1, 0, 0)$ oder zwischen $(0, 1, 1)$ und $(1, 1, 1)$.
+
*For the code $\mathcal{C}_{3}$ - also with rate $R = 2/3$ - the minimum distance between two codewords is $d_{\rm min} = 1$, for example between $(0, 0, 0)$ and $(1, 0, 0)$ or between $(0, 1, 1)$ and $(1, 1, 1)$.
  
  
 
   
 
   
'''(3)'''&nbsp; Richtig ist nur die <u>Aussage 1</u>:  
+
'''(3)'''&nbsp; Correct is only <u>statement 1</u>:  
*Mit der Minimaldistanz $d_{\rm min} = 2$ kann lediglich ein Bitfehler erkannt werden.  
+
*Only a bit error can be detected with the minimum distance $d_{\rm min} = 2$.  
*In der oberen Grafik kennzeichnen die grünen Punkte zulässige Codeworte von $\mathcal{C}_{1}$. Wird ein blauer Punkt empfangen, so weist dies auf einen Übertragungsfehler hin.  
+
*In the upper graph, the green dots indicate allowed codewords of $\mathcal{C}_{1}$. If a blue dot is received, this indicates a transmission error.  
*Eine Fehlerkorrektur ist mit $d_{\rm min} = 2$ dagegen nicht möglich.  
+
*On the other hand, error correction is not possible with $d_{\rm min} = 2$.  
*Der Code $\mathcal{C}_{1}$ entspricht dem [[Channel_Coding/Beispiele_binärer_Blockcodes#Single_Parity.E2.80.93check_Codes|Single Parity–check Code (3, 2, 2)]].
+
*The code $\mathcal{C}_{1}$ corresponds to the [[Channel_Coding/Examples_of_Binary_Block_Codes#Single_Parity_Check_Codes|Single Parity-check Code (3, 2, 2)]].
  
  
[[File:P_ID2402__KC_Z_1_2d.png|right|frame|(3, 1, 3)–Blockcode]]
+
[[File:P_ID2402__KC_Z_1_2d.png|right|frame|(3, 1, 3) block code]]
'''(4)'''&nbsp; Richtig sind die <u>Antworten 2, 3 und 4</u>:
+
'''(4)'''&nbsp; Correct <u>answers 2, 3, and 4</u>:
*$C_{4}$ beschreibt den [[Channel_Coding/Beispiele_binärer_Blockcodes#Wiederholungscodes|(3, 1, 3)–Wiederholungscode]].  
+
*$C_{4}$ describes the [[Channel_Coding/Examples_of_Binary_Block_Codes#Repetition_Codes|(3, 1, 3) repetition code]].  
*Bei diesem Code sind zwar zwei der insgesamt acht möglichen Punkte belegt, woraus man fälschlicherweise auf die Coderate $R = 1/4$ schließen könnte. Die Coderate berechnet sich aber gemäß $R = k/n = 1/3$.
+
*In this code, two of the total eight possible points are occupied, from which one could incorrectly conclude the code rate $R = 1/4$. However, the code rate is calculated according to $R = k/n = 1/3$.
*Aus der unteren Grafik erkennt man, dass wegen $d_{\rm min} = 3$ nun auch ein Bitfehler korrigiert werden kann.  
+
*From the lower diagram one recognizes that because of $d_{\rm min} = 3$ now also a bit error can be corrected.  
*Bei der Decodierung werden alle hellgrünen Punkte (mit schwarzer Umrahmung) in den grünen Punkt $(0, 0, 0)$ überführt und alle hellblauen in den blauen Punkt $(1, 1, 1)$.  
+
*During decoding, all light green points (with black outline) are transferred to the green point $(0, 0, 0)$ and all light blue points are transferred to the blue point $(1, 1, 1)$.  
*Gleichzeitig können bis zu zwei Bitfehler erkannt werden (einer natürlich auch).
+
*Up to two bit errors can be detected at the same time (one of course).  
 
{{ML-Fuß}}
 
{{ML-Fuß}}
  

Revision as of 18:13, 4 June 2022

Space $\rm GF(2^3)$ and
Code of length $n = 3$

Codes for error detection or error correction can be represented very clearly in  $n$-dimensional space. We restrict ourselves here to binary codes of length  $n = 3$:

$$\underline{x} = (x_{1}, x_{2}, x_{3}) \hspace{0.1cm} \in \hspace{0.1cm}{\rm GF}(2^3) \hspace{0.05cm},\hspace{0.5cm} x_i = \{0, 1 \}\hspace{0.05cm},\hspace{0.2cm} i = 1, 2, 3\hspace{0.05cm}.$$

In general, for block coding:

  • The information word  $\underline{u} = (u_{1}, u_{2}, \ \text{...} , \ u_{k})$  is uniquely transformed into the codeword  $\underline{x} =(x_{1}, x_{2}, \ \text{...} , \ , x_{n})$  .
  • The code rate is  $R = k/n$.
  • The Hamming distance  $d_{\rm H}(x, \hspace{0.05cm}x\hspace{0.05cm}')$  between two codewords  $x ∈ \mathcal{C}$  and  $x\hspace{0.05cm}' ∈ \mathcal{C}$  indicates the number of bit positions in which  $x$  and  $x\hspace{0.05cm}'$  differ.
  • The minimum distance  $d_{\rm min} = {\rm min}\big[d_{\rm H}(x, \hspace{0.05cm}x\hspace{0.05cm}')\big]$  is a measure of the correctability of a code.
  • It can  $e =d_{\rm min} - 1$  detect errors and  $t =(d_{\rm min} - 1)/2$  correct errors.
  • The last statement, however, is valid only for odd  $d_{\rm min}$.




Hints:



Questions

1

Which statements hold if all points in  $\rm GF(2^3)$  are occupied?

The assignment  $\underline{u} = (u_{1}, u_{2}, u_{3})$   →   $\underline{x} = (x_{1}, x_{2},x_{3})$ holds.
The identity  $\underline{x} = \underline{u}$ holds.
The code rate is  $R = 1$.
The minimum distance between two codewords is  $d_{\rm min} = 2$.

2

Which statements are true for a (3, 2, 2)-block code?

code  $\mathcal{C}_{1} = \{(0, 0, 0), (0, 1, 1), (1, 0, 1), (1, 1, 0)\}$  is possible.
Code  $\mathcal{C}_{2} = \{(0, 0, 1), (0, 1, 0), (1, 0, 0), (1, 1, 1)\}$  is possible.
Code  $\mathcal{C}_{3} = \{(0, 0, 0), (0, 1, 1), (1, 0, 0), (1, 1, 1)\}$  is possible.

3

What properties does the code defined in subtask (2) show  $\mathcal{C}_{1}$?

A bit error can be detected.
A bit error can be corrected.

4

What properties does the code show  $\mathcal{C}_{4}= \{(0, 0, 0), (1, 1, 1)\}$?

The code rate is  $R = 1/4$.
The code rate is  $R = 1/3$.
A bit error can be detected.
A bit error can be corrected.


Solution

(1)  Correct statements 1 and 3:

  • In this assignment, $k = 3$ information bits are mapped to $n = 3$ code bits   ⇒   $R = k/n = 1$.
  • The statement $\underline{x} = \underline{u} $ would only hold in the case of systematic coding.
  • For example, in principle, $(0, 0, 0)$   →   $(0, 1, 1)$ would also be possible.
  • The last statement is certainly false: from the graph one can see the minimum distance $d_{\rm min} = 1$.


Two (3, 2, 2)-block codes

(2)  Correct statements 1 and 3:

  • $\mathcal{C}_{1}$ and $\mathcal{C}_{2}$ actually describe codes with rate $R = 2/3$ and minimum distance $d_{\rm min} = 2$.
  • In the graph, the green dots mark the code $\mathcal{C}_{1}$ and the blue dots mark the code $\mathcal{C}_{2}$.
  • For the code $\mathcal{C}_{3}$ - also with rate $R = 2/3$ - the minimum distance between two codewords is $d_{\rm min} = 1$, for example between $(0, 0, 0)$ and $(1, 0, 0)$ or between $(0, 1, 1)$ and $(1, 1, 1)$.


(3)  Correct is only statement 1:

  • Only a bit error can be detected with the minimum distance $d_{\rm min} = 2$.
  • In the upper graph, the green dots indicate allowed codewords of $\mathcal{C}_{1}$. If a blue dot is received, this indicates a transmission error.
  • On the other hand, error correction is not possible with $d_{\rm min} = 2$.
  • The code $\mathcal{C}_{1}$ corresponds to the Single Parity-check Code (3, 2, 2).


(3, 1, 3) block code

(4)  Correct answers 2, 3, and 4:

  • $C_{4}$ describes the (3, 1, 3) repetition code.
  • In this code, two of the total eight possible points are occupied, from which one could incorrectly conclude the code rate $R = 1/4$. However, the code rate is calculated according to $R = k/n = 1/3$.
  • From the lower diagram one recognizes that because of $d_{\rm min} = 3$ now also a bit error can be corrected.
  • During decoding, all light green points (with black outline) are transferred to the green point $(0, 0, 0)$ and all light blue points are transferred to the blue point $(1, 1, 1)$.
  • Up to two bit errors can be detected at the same time (one of course).