Difference between revisions of "Aufgaben:Exercise 1.5Z: SPC (5, 4) vs. RC (5, 1)"

From LNTwww
Line 1: Line 1:
{{quiz-Header|Buchseite=Kanalcodierung/Beispiele binärer Blockcodes
+
{{quiz-Header|Buchseite=Channel_Coding/Examples_of_Binary_Block_Codes
  
 
}}
 
}}
  
[[File:P_ID2386__KC_Z_1_5.png|right|frame|Single Parity–check Code und Wiederholungscode mit  $n = 5$]]
+
[[File:P_ID2386__KC_Z_1_5.png|right|frame|Single parity check code and Repetition code with  $n = 5$]]
  
Zwischen dem  ''Single Parity–check Code''  und dem  ''Repetition Code''  gleicher Codelänge  $n$  besteht eine gewisse Verwandtschaft. Wie im Kapitel  [[Channel_Coding/Allgemeine_Beschreibung_linearer_Blockcodes|Allgemeine Beschreibung linearer
+
There is a certain relationship between the  ''Single Parity Check Code''  and the  ''Repetition Code''  of the same code length  $n$  . As will be shown in the chapter  [[Channel_Coding/General_Description_of_Linear_Block_Codes|General Description of Linear Block Codes]]  they are so-called  ''Dual codes''.  
Blockcodes]]  noch gezeigt wird, handelt es sich um so genannte  ''duale  Codes''.  
 
  
*Der  [[Channel_Coding/Beispiele_binärer_Blockcodes#Single_Parity.E2.80.93check_Codes|Single Parity–check Code]] mit den Parametern  $k = 4$  und  $n = 5$   ⇒   $\rm SPC \ (5, 4)$  fügt zu den vier Informationsbits  $u_{1}$, ... ,  $u_{4}$  ein Prüfbit  $p$  hinzu, so dass in jedem Codewort  $\underline{x}$  eine gerade Anzahl von Einsen vorkommt:
+
*The  [[Channel_Coding/Examples_of_Binary_Block_Codes#Single_Parity_Check_Codes|Single Parity Check Code]] with parameters  $k = 4$  and  $n = 5$   ⇒   $\rm SPC \ (5, 4)$  adds to the four information bits  $u_{1}$, ... ,  $u_{4}$  adds a check bit  $p$  so that an even number of ones occurs in each codeword  $\underline{x}$  :
 
:$$x_1 \oplus x_2 \oplus x_3 \oplus x_4 \oplus x_5 = 0 \hspace{0.3cm} \Rightarrow \hspace{0.3cm} u_1 \oplus u_2 \oplus u_3 \oplus u_4 \oplus p = 0 \hspace{0.05cm}.$$
 
:$$x_1 \oplus x_2 \oplus x_3 \oplus x_4 \oplus x_5 = 0 \hspace{0.3cm} \Rightarrow \hspace{0.3cm} u_1 \oplus u_2 \oplus u_3 \oplus u_4 \oplus p = 0 \hspace{0.05cm}.$$
  
*Ein jeder  [[Channel_Coding/Beispiele_binärer_Blockcodes#Wiederholungscodes|Wiederholungscode]]  (englisch:   ''Repetition Code'') ist durch den Codeparameter  $k = 1$  charakterisiert. Beim  $\rm RC \ (5, \ 1)$  lauten die beiden Codeworte  $(0, 0, 0, 0, 0)$  und  $(1, 1, 1, 1, 1)$.
+
*Each  [[Channel_Coding/Examples_of_Binary_Block_Codes#Repetition_Codes|Repetition Code]]  is characterized by the code parameter  $k = 1$ . For  $\rm RC \ (5, \ 1)$  the two code words are  $(0, 0, 0, 0)$  and  $(1, 1, 1, 1)$.
  
  
Die Grafik zeigt die Grundstruktur dieser beiden Codes, die in dieser Aufgabe miteinander verglichen werden sollen.
+
The graphic shows the basic structure of these two codes, which will be compared in this task.
  
  
Line 22: Line 21:
  
  
''Hinweise:'' 
+
Hints:  
*Die Aufgabe gehört zum Kapitel  [[Channel_Coding/Beispiele_binärer_Blockcodes|Beispiele binärer Blockcodes]].
+
*This exercise belongs to the chapter  [[Channel_Coding/Examples_of_Binary_Block_Codes|Examples of Binary Block Codes]].
*Bezug genommen wird insbesondere auf die Seiten  [[Channel_Coding/Beispiele_binärer_Blockcodes#Single Parity.E2.80.93check_Codes|Single Parity–check Codes]]  sowie   [[Channel_Coding/Beispiele_binärer_Blockcodes#Wiederholungscodes|Wiederholungscodes]].
+
*Reference is made in particular to the pages  [[Channel_Coding/Examples_of_Binary_Block_Codes#Single_Parity_Check_Codes|Single Parity Check Codes]]  and   [[Channel_Coding/Examples_of_Binary_Block_Codes#Repetition_Codes|Repetition Codes]].
 
   
 
   
  
  
  
===Fragebogen===
+
===Questions===
  
 
<quiz display=simple>
 
<quiz display=simple>
  
{Wie unterscheiden sich der&nbsp; $\text{SPC (5, 4)}$&nbsp; und der&nbsp; $\text{RC (5, 1)}$&nbsp; hinsichtlich des Codeumfangs?
+
{How do the&nbsp; $\text{SPC (5, 4)}$&nbsp; and the&nbsp; $\text{RC (5, 1)}$&nbsp; differ in terms of code scope?
 
|type="{}"}
 
|type="{}"}
 
$\ {\rm SPC} \ (5, 4)\text{:}\hspace{0.4cm}|\hspace{0.05cm}\mathcal{C}\hspace{0.05cm}| \ = \ $ { 16 3% }
 
$\ {\rm SPC} \ (5, 4)\text{:}\hspace{0.4cm}|\hspace{0.05cm}\mathcal{C}\hspace{0.05cm}| \ = \ $ { 16 3% }
Line 39: Line 38:
  
  
{Welche der folgenden Codeworte sind beim&nbsp; $\text{SPC (5, 4)}$&nbsp; möglich?
+
{Which of the following code words are possible in the&nbsp; $\text{SPC (5, 4)}$&nbsp;?
 
|type="[]"}
 
|type="[]"}
 
+ $(0, 0, 0, 0, 0)$,
 
+ $(0, 0, 0, 0, 0)$,
Line 46: Line 45:
 
- $(1, 1, 1, 1, 1)$.
 
- $(1, 1, 1, 1, 1)$.
  
{Welche der folgenden Codeworte sind beim&nbsp; $\text{RC (5, 1)}$&nbsp; möglich?
+
{Which of the following code words are possible in the&nbsp; $\text{RC (5, 1)}$&nbsp;?
 
|type="[]"}
 
|type="[]"}
 
+ $(0, 0, 0, 0, 0)$,
 
+ $(0, 0, 0, 0, 0)$,
Line 54: Line 53:
  
  
{Wieviele Codefolgen&nbsp; $(N)$&nbsp; müssen in die Maximum&ndash;Likelihood–Entscheidung einbezogen werden?
+
{How many code sequences&nbsp; $(N)$&nbsp; must be included in the maximum likelihood decision?
 
|type="{}"}
 
|type="{}"}
 
$\ {\rm SPC} \ (5, 4)\text{:}\hspace{0.4cm}N \ = \ $ { 32 }
 
$\ {\rm SPC} \ (5, 4)\text{:}\hspace{0.4cm}N \ = \ $ { 32 }
$\ {\rm RC} \ (5, 1)\text{:}\hspace{0.6cm}N \ = \ $ { 32 }
+
$ {\rm RC} \ (5, 1)\text{:}\hspace{0.6cm}N \ = \ $ { 32 }
  
{Wie groß ist die minimale Distanz beider Codes?
+
{What is the minimum distance between the two codes?
 
|type="{}"}
 
|type="{}"}
 
$\ {\rm SPC} \ (5, 4)\text{:}\hspace{0.4cm}d_{\rm min} \ = \ $ { 2 }
 
$\ {\rm SPC} \ (5, 4)\text{:}\hspace{0.4cm}d_{\rm min} \ = \ $ { 2 }
 
$\ {\rm RC} \ (5, 1)\text{:}\hspace{0.6cm}d_{\rm min} \ = \ $ { 5 }
 
$\ {\rm RC} \ (5, 1)\text{:}\hspace{0.6cm}d_{\rm min} \ = \ $ { 5 }
  
{Bis zu wievielen Bitfehlern&nbsp; $(e)$&nbsp; funktioniert die Fehlererkennung?
+
{Up to how many bit errors&nbsp; $(e)$&nbsp; does error detection work?
 
|type="{}"}
 
|type="{}"}
$\ {\rm SPC} \ (5, 4)\text{:}\hspace{0.4cm}e \ = \ $ { 1 }
+
$\ {\rm SPC} \ (5, 4)\text{:}\hspace{0.4cm}e \ = \ $ { 1 }
$\ {\rm RC} \ (5, 1)\text{:}\hspace{0.6cm}e \ = \ $ { 4 }
+
$ {\rm RC} \ (5, 1)\text{:}\hspace{0.6cm}e \ = \ $ { 4 }
  
{Bis zu wievielen Bitfehlern&nbsp; $(t)$&nbsp; funktioniert die Fehlerkorrektur?
+
{Up to how many bit errors&nbsp; $(t)$&nbsp; does error correction work?
 
|type="{}"}
 
|type="{}"}
 
$\ {\rm SPC} \ (5, 4)\text{:}\hspace{0.4cm}t \ = \ $ { 0. }
 
$\ {\rm SPC} \ (5, 4)\text{:}\hspace{0.4cm}t \ = \ $ { 0. }
$\ {\rm RC} \ (5, 1)\text{:}\hspace{0.6cm}t \ = \ $ { 2 }
+
$ {\rm RC} \ (5, 1)\text{:}\hspace{0.6cm}t \ = \ $ { 2 }
  
 
</quiz>
 
</quiz>
  
===Musterlösung===
+
===Solution===
 
{{ML-Kopf}}
 
{{ML-Kopf}}
'''(1)'''&nbsp; Der Codeumfang gibt die Anzahl der möglichen Codeworte an. Es gilt $|\mathcal{C}| = 2^k$, so dass es
+
'''(1)'''&nbsp; The code scope gives the number of possible code words. It holds $|\mathcal{C}| = 2^k$, so that there are.
*beim hier betrachteten ''Single Parity–check'' Code <u>16 Codeworte gibt</u> ($k = 4$), und
+
*in the ''Single Parity Check'' code considered here, there are <u>16 codewords</u> ($k = 4$), and
*beim Wiederholungscode nur <u>zwei Codeworte</u> ($k = 1$).
+
*in the repeat code, only <u>two codewords</u> ($k = 1$).
  
  
  
'''(2)'''&nbsp; Bei jedem ''Single Parity–check Code'' ist die Anzahl der Einsen geradzahlig  &nbsp; ⇒ &nbsp; <u>Antwort 1 und 3</u>.
+
'''(2)'''&nbsp; For any ''single parity check code'', the number of ones is even &nbsp; ⇒ &nbsp; <u>answers 1 and 3</u>.
  
  
  
'''(3)'''&nbsp; Bei einem jeden Wiederholungscode gibt es (unabhängig von $n$) nur zwei Codeworte, die beide hier angegeben sind  &nbsp; ⇒ &nbsp; <u>Antwort 1 und 4</u>.
+
'''(3)'''&nbsp; For any repetition code, there are only two codewords (independent of $n$), both given here &nbsp; ⇒ &nbsp; <u>Answer 1 and 4</u>.
  
  
  
'''(4)'''&nbsp; Aufgrund von Bitfehlern kann es für den Empfangsvektor $\underline{y}$ stets $N = 2^n \hspace{0.15cm}\underline{= 32}$ unterschiedliche Bitkombinationen geben, die alle in die Maximum&ndash;Likelihood–Entscheidung einbezogen werden müssen.  
+
'''(4)'''&nbsp; Due to bit errors, there can always be $N = 2^n \hspace{0.15cm}\underline{= 32}$ different bit combinations for the receive vector $\underline{y}$, all of which must be included in the maximum likelihood decision.  
*Dies gilt sowohl für den SPC (5, 4) als auch für den RC (5, 1).
+
*This is true for both the SPC (5, 4) and the RC (5, 1).
  
  
  
'''(5)'''&nbsp; Beim SPC (5, 4) beträgt die Hamming–Distanz zwischen zwei beliebigen Codeworten mindestens $d_{\rm min} \hspace{0.15cm}\underline{= 2}$. Dagegen sind beim RC (5, 1) alle Bit der beiden Codeworte unterschiedlich &nbsp; ⇒ &nbsp; $d_{\rm min} \hspace{0.15cm}\underline{= 5}$.
+
'''(5)'''&nbsp; For the SPC (5, 4), the Hamming distance between any two codewords is at least $d_{\rm min} \hspace{0.15cm}\underline{= 2}$. In contrast, for RC (5, 1), all bits of the two codewords are different &nbsp; ⇒ &nbsp; $d_{\rm min} \hspace{0.15cm}\underline{= 5}$.
  
  
  
'''(6)'''&nbsp; Eine Fehlererkennung ist möglich, so lange nicht mehr als $e = d_{\rm min} 1$ Bitfehler in einem Codewort auftreten.  
+
'''(6)'''&nbsp; Error detection is possible as long as there are no more than $e = d_{\rm min} - 1$ bit errors in a codeword.  
*Mit dem Ergebnis aus (5) erhält man $\underline{e = 1}$ (SPC) bzw. $\underline{e = 4}$ (RC).
+
*Using the result from (5), we obtain $\underline{e = 1}$ (SPC) or $\underline{e = 4}$ (RC).
  
  
  
'''(7)'''&nbsp; Allgemein gilt für die Anzahl der korrigierbaren Fehler:
+
'''(7)'''&nbsp; In general, for the number of correctable errors:
 
:$$t = \left\lfloor \frac{d_{\rm min}-1}{2} \right\rfloor \hspace{0.05cm}.$$
 
:$$t = \left\lfloor \frac{d_{\rm min}-1}{2} \right\rfloor \hspace{0.05cm}.$$
*Bei jedem ''Single Parity–check Code'' ist ($d_{\rm min} 1)/2 = 0.5$ &nbsp; ⇒ &nbsp; $\underline{t = 0}$.  
+
*For any ''single parity-check code'', ($d_{\rm min} - 1)/2 = 0.5$ &nbsp; ⇒ &nbsp; $\underline{t = 0}$.  
*Dagegen können mit dem RC (5, 1) wegen $d_{\rm min} = 5$ bis zu $\underline{t = 2}$ Fehler korrigiert werden.
+
*In contrast, RC (5, 1) can be used to correct errors up to $\underline{t = 2}$ because of $d_{\rm min} = 5$.
  
 
{{ML-Fuß}}
 
{{ML-Fuß}}

Revision as of 05:01, 11 June 2022

Single parity check code and Repetition code with  $n = 5$

There is a certain relationship between the  Single Parity Check Code  and the  Repetition Code  of the same code length  $n$  . As will be shown in the chapter  General Description of Linear Block Codes  they are so-called  Dual codes.

  • The  Single Parity Check Code with parameters  $k = 4$  and  $n = 5$   ⇒   $\rm SPC \ (5, 4)$  adds to the four information bits  $u_{1}$, ... ,  $u_{4}$  adds a check bit  $p$  so that an even number of ones occurs in each codeword  $\underline{x}$  :
$$x_1 \oplus x_2 \oplus x_3 \oplus x_4 \oplus x_5 = 0 \hspace{0.3cm} \Rightarrow \hspace{0.3cm} u_1 \oplus u_2 \oplus u_3 \oplus u_4 \oplus p = 0 \hspace{0.05cm}.$$
  • Each  Repetition Code  is characterized by the code parameter  $k = 1$ . For  $\rm RC \ (5, \ 1)$  the two code words are  $(0, 0, 0, 0)$  and  $(1, 1, 1, 1)$.


The graphic shows the basic structure of these two codes, which will be compared in this task.




Hints:



Questions

1

How do the  $\text{SPC (5, 4)}$  and the  $\text{RC (5, 1)}$  differ in terms of code scope?

$\ {\rm SPC} \ (5, 4)\text{:}\hspace{0.4cm}|\hspace{0.05cm}\mathcal{C}\hspace{0.05cm}| \ = \ $

$\ {\rm RC} \ (5, 1)\text{:}\hspace{0.6cm}|\hspace{0.05cm}\mathcal{C}\hspace{0.05cm}| \ = \ $

2

Which of the following code words are possible in the  $\text{SPC (5, 4)}$ ?

$(0, 0, 0, 0, 0)$,
$(0, 0, 1, 0, 0)$,
$(1, 1, 0, 1, 1)$,
$(1, 1, 1, 1, 1)$.

3

Which of the following code words are possible in the  $\text{RC (5, 1)}$ ?

$(0, 0, 0, 0, 0)$,
$(0, 0, 1, 0, 0)$,
$(1, 1, 0, 1, 1)$,
$(1, 1, 1, 1, 1)$.

4

How many code sequences  $(N)$  must be included in the maximum likelihood decision?

$\ {\rm SPC} \ (5, 4)\text{:}\hspace{0.4cm}N \ = \ $

$ {\rm RC} \ (5, 1)\text{:}\hspace{0.6cm}N \ = \ $

5

What is the minimum distance between the two codes?

$\ {\rm SPC} \ (5, 4)\text{:}\hspace{0.4cm}d_{\rm min} \ = \ $

$\ {\rm RC} \ (5, 1)\text{:}\hspace{0.6cm}d_{\rm min} \ = \ $

6

Up to how many bit errors  $(e)$  does error detection work?

$\ {\rm SPC} \ (5, 4)\text{:}\hspace{0.4cm}e \ = \ $

$ {\rm RC} \ (5, 1)\text{:}\hspace{0.6cm}e \ = \ $

7

Up to how many bit errors  $(t)$  does error correction work?

$\ {\rm SPC} \ (5, 4)\text{:}\hspace{0.4cm}t \ = \ $

$ {\rm RC} \ (5, 1)\text{:}\hspace{0.6cm}t \ = \ $


Solution

(1)  The code scope gives the number of possible code words. It holds $|\mathcal{C}| = 2^k$, so that there are.

  • in the Single Parity Check code considered here, there are 16 codewords ($k = 4$), and
  • in the repeat code, only two codewords ($k = 1$).


(2)  For any single parity check code, the number of ones is even   ⇒   answers 1 and 3.


(3)  For any repetition code, there are only two codewords (independent of $n$), both given here   ⇒   Answer 1 and 4.


(4)  Due to bit errors, there can always be $N = 2^n \hspace{0.15cm}\underline{= 32}$ different bit combinations for the receive vector $\underline{y}$, all of which must be included in the maximum likelihood decision.

  • This is true for both the SPC (5, 4) and the RC (5, 1).


(5)  For the SPC (5, 4), the Hamming distance between any two codewords is at least $d_{\rm min} \hspace{0.15cm}\underline{= 2}$. In contrast, for RC (5, 1), all bits of the two codewords are different   ⇒   $d_{\rm min} \hspace{0.15cm}\underline{= 5}$.


(6)  Error detection is possible as long as there are no more than $e = d_{\rm min} - 1$ bit errors in a codeword.

  • Using the result from (5), we obtain $\underline{e = 1}$ (SPC) or $\underline{e = 4}$ (RC).


(7)  In general, for the number of correctable errors:

$$t = \left\lfloor \frac{d_{\rm min}-1}{2} \right\rfloor \hspace{0.05cm}.$$
  • For any single parity-check code, ($d_{\rm min} - 1)/2 = 0.5$   ⇒   $\underline{t = 0}$.
  • In contrast, RC (5, 1) can be used to correct errors up to $\underline{t = 2}$ because of $d_{\rm min} = 5$.