Difference between revisions of "Aufgaben:Exercise 3.09: Basics of the Viterbi Algorithm"

From LNTwww
Line 1: Line 1:
{{quiz-Header|Buchseite=Kanalcodierung/Decodierung von Faltungscodes}}
+
{{quiz-Header|Buchseite=Channel_Coding/Decoding_of_Convolutional_Codes}}
  
[[File:P_ID2659__KC_A_3_8.png|right|frame|Zu analysierendes Trellis]]
+
[[File:P_ID2659__KC_A_3_8.png|right|frame|Trellis to be analyzed]]
Die Grafik zeigt ein Trellisdiagramm und definiert gleichzeitig die Fehlergrößen  ${\it \Gamma}_i(S_0)$  und  ${\it \Gamma}_i(S_1)$  zu den Zeiten  $i = 0$  bis  $i = 5$.  
+
The graph shows a trellis diagram and simultaneously defines the branch metrics  ${\it \Gamma}_i(S_0)$  and  ${\it \Gamma}_i(S_1)$  at times  $i = 0$  to  $i = 5$.  
  
Aus diesem Trellis können zum Beispiel abgelesen werden:
+
From this trellis can be read, for example:
* die Coderate  $R$,
+
* the code rate  $R$,
* das Gedächtnis  $m$,
+
* the memory  $m$,
* die freie Distanz  $d_{\rm F}$,
+
* the free distance  $d_{\rm F}$,
* die Informationssequenzlänge  $L$,
+
* the information sequence length  $L$,
* die Sequenzlänge  $L\hspace{0.05cm}'$  inklusive der Terminierung.
+
* the sequence length  $L\hspace{0.05cm}'$  including the termination.
  
  
In der Aufgabe ist weiter zu klären:
+
In the exercise it is further necessary to clarify:
* die Bedeutung des Endwertes  ${\it \Gamma}_5(S_0)$,
+
* the meaning of the final value  ${\it \Gamma}_5(S_0)$,
* Auswirkungen von einem bzw. von zwei Übertragungsfehlern.
+
* effects of one and two transmission errors, respectively.
  
  
Line 23: Line 23:
  
  
''Hinweis:''
+
Hint:  
* Die Aufgabe gehört zum Kapitel  [[Channel_Coding/Decodierung_von_Faltungscodes| Decodierung von Faltungscodes]].
+
* This exercise belongs to the chapter  [[Channel_Coding/Decoding_of_Convolutional_Codes| "Decoding of Convolutional Codes"]].
  
  
Line 33: Line 33:
  
  
===Fragebogen===
+
===Questions===
 
<quiz display=simple>
 
<quiz display=simple>
{Welche der folgenden Aussagen werden durch das Trellis bestätigt?
+
{Which of the following statements are confirmed by the trellis?
 
|type="[]"}
 
|type="[]"}
+ Es handelt sich um einen Rate&ndash;1/2&ndash;Faltungscode.
+
+ It is a rate 1/2 convolutional code.
- Das Gedächtnis des Codes ist&nbsp; $m = 2$.
+
- The memory of the code is&nbsp; $m = 2$.
+ Der Faltungscode ist terminiert.
+
+ The convolutional code is terminated.
- Die Länge der Informationssequenz ist&nbsp; $L = 5$.
+
- The length of the information sequence is&nbsp; $L = 5$.
  
{Geben Sie die freie Distanz&nbsp; $d_{\rm F}$&nbsp; des Faltungscodes an.
+
{Specify the free distance&nbsp; $d_{\rm F}$&nbsp; of the convolutional code.
 
|type="{}"}
 
|type="{}"}
 
$d_{\rm F} \ = \ ${ 3 3% }  
 
$d_{\rm F} \ = \ ${ 3 3% }  
  
{Welche Aussagen erlaubt der Endwert&nbsp; ${\it \Gamma}_5(S_0) = 0$&nbsp; der Fehlergröße?
+
{What statements does the final value&nbsp; ${\it \Gamma}_5(S_0) = 0$&nbsp; of the branch metric allow?
 
|type="[]"}
 
|type="[]"}
- Es ist kein Übertragungsfehler aufgetreten.
+
- No transmission error has occurred.
- Das Decodierergebnis&nbsp; $\underline{v}$&nbsp; ist mit Sicherheit richtig $($gleich&nbsp; $\underline{u})$.
+
- The decoding result&nbsp; $\underline{v}$&nbsp; is certainly correct $($equal&nbsp; $\underline{u})$.
+ Das Decodierergebnis minimiert die Wahrscheinlichkeit&nbsp; ${\rm Pr}(\underline{v} &ne; \underline{u})$.
+
+ The decoding result minimizes the probability&nbsp; ${\rm Pr}(\underline{v} &ne; \underline{u})$.
  
{Welche Aussagen treffen <u>bei einem einzigen</u> Übertragungsfehler zu?
+
{Which statements are true <u>in the case of a single</u> transmission error?
 
|type="[]"}
 
|type="[]"}
+ Der Fehlergrößenendwert ist&nbsp; ${\it \Gamma}_5(S_0) = 1$.
+
+ The final branch metric is&nbsp; ${\it \Gamma}_5(S_0) = 1$.
+ Das Decodierergebnis&nbsp; $\underline{v}$&nbsp; ist mit Sicherheit richtig&nbsp; $($gleich&nbsp; $\underline{u})$.
+
+ The decoding result&nbsp; $\underline{v}$&nbsp; is certainly correct&nbsp; $($equal&nbsp; $\underline{u})$.
+ Das Decodierergebnis minimiert die Wahrscheinlichkeit&nbsp; ${\rm Pr}(\underline{v} &ne; \underline{u})$.
+
+ The decoding result minimizes the probability&nbsp; ${\rm Pr}(\underline{v} &ne; \underline{u})$.
  
{Welche Aussagen treffen <u>bei zwei</u> Übertragungsfehlern zu?
+
{Which statements are true <u>in the case of two</u> transmission errors?
 
|type="[]"}
 
|type="[]"}
- Der Fehlergrößenendwert ist&nbsp; ${\it \Gamma}_5(S_0) = 2$.
+
- The final branch metric is&nbsp; ${\it \Gamma}_5(S_0) = 2$.
- Das Decodierergebnis&nbsp; $\underline{v}$&nbsp; ist mit Sicherheit richtig&nbsp; $($gleich&nbsp; $\underline{u})$.
+
- The decoding result&nbsp; $\underline{v}$&nbsp; is certainly correct&nbsp; $($equal&nbsp; $\underline{u})$.
- Das Decodierergebnis&nbsp; $\underline{v}$&nbsp; ist mit Sicherheit falsch&nbsp; $($ungleich&nbsp; $\underline{u})$.
+
- The decoding result&nbsp; $\underline{v}$&nbsp; is certainly false&nbsp; $($unequal&nbsp; $\underline{u})$.
 
</quiz>
 
</quiz>
  
===Musterlösung===
+
===Solution===
 
{{ML-Kopf}}
 
{{ML-Kopf}}
'''(1)'''&nbsp; Richtig sind die <u>Lösungsvorschläge 1 und 3</u>:
+
'''(1)'''&nbsp; Correct are the <u>solutions 1 and 3</u>:
*Es gibt hier $2^{k \cdot m} = 2$ Zustände. Daraus folgt $k = 1$ und $m = 1$.  
+
*There are $2^{k \cdot m} = 2$ states here. It follows that $k = 1$ and $m = 1$.  
*Pro Codierschritt werden $n = 2$ Codebits ausgegeben &nbsp; &#8658; &nbsp; $R = 1/2$.  
+
*Per coding step, $n = 2$ code bits are output &nbsp; &#8658; &nbsp; $R = 1/2$.  
*Die Informationssequenzlänge ist $L = 4$.  
+
*The information sequence length is $L = 4$.  
*Erst durch ein (da $m = 1$) zusätzliches Terminierungsbit kommt man zur Gesamtlänge $L' = 5$.
+
*Only by one (since $m = 1$) additional termination bit one arrives at the total length $L' = 5$.
  
  
  
'''(2)'''&nbsp; Die freie Distanz $d_{\rm F}$ ist definiert als die Anzahl der Codebits, in denen sich zwei Sequenzen $\underline{x}$ und $\underline{x'}$ unterscheiden. Als Bezugssequenz wählen wir die Nullsequenz:
+
'''(2)'''&nbsp; The free distance $d_{\rm F}$ is defined as the number of codebits in which two sequences $\underline{x}$ and $\underline{x'}$ differ. We choose the zero sequence as the reference sequence:
 
:$$\underline{x}\hspace{0.03cm}' = \underline{0} = \big (00\hspace{0.05cm}, 00\hspace{0.05cm}, 00\hspace{0.05cm}, 00\hspace{0.05cm}, ... \hspace{0.1cm} \big ) \hspace{0.05cm},$$
 
:$$\underline{x}\hspace{0.03cm}' = \underline{0} = \big (00\hspace{0.05cm}, 00\hspace{0.05cm}, 00\hspace{0.05cm}, 00\hspace{0.05cm}, ... \hspace{0.1cm} \big ) \hspace{0.05cm},$$
  
ausgedrückt mit der Zustandsabfolge: &nbsp; $S_0 &#8594; S_0 &#8594; S_0 &#8594; S_0 &#8594; \ \text{...} \ $  
+
expressed with the sequence of states: &nbsp; $S_0 &#8594; S_0 &#8594; S_0 &#8594; S_0 &#8594; \ \text{...} \ $  
*Eine der Folgen $\underline{x} &ne; \underline{0}$, die sich von $\underline{0}$ nur in der minimalen Anzahl an Codebits unterscheidet, folgt dem Pfad $S_0 &#8594; S_1 &#8594; S_0 &#8594; S_0 &#8594; \\text{...} \ $:
+
*One of the sequences $\underline{x} &ne; \underline{0}$, which differs from $\underline{0}$ only in the minimum number of codebits, follows the path $S_0 &#8594; S_1 &#8594; S_0 &#8594; S_0 &#8594; \text{...} \ $:
 
:$$\underline{x} = \big (11\hspace{0.05cm}, 01\hspace{0.05cm}, 00\hspace{0.05cm}, 00\hspace{0.05cm}, ... \hspace{0.1cm} \big )  
 
:$$\underline{x} = \big (11\hspace{0.05cm}, 01\hspace{0.05cm}, 00\hspace{0.05cm}, 00\hspace{0.05cm}, ... \hspace{0.1cm} \big )  
 
\hspace{0.3cm}\Rightarrow \hspace{0.3cm} d_{\rm F}\hspace{0.1cm}\underline{ = 3}
 
\hspace{0.3cm}\Rightarrow \hspace{0.3cm} d_{\rm F}\hspace{0.1cm}\underline{ = 3}
Line 86: Line 86:
  
  
'''(3)'''&nbsp; Richtig ist hier nur der <u>Vorschlag 3</u>, weil das Ereignis "Kein Übertragungsfehler" sehr viel wahrscheinlicher ist als drei Fehler an genau vorgegebenen Positionen. Betrachten Sie hierzu die folgende Grafik:
+
'''(3)'''&nbsp; Only <u>proposition 3</u> is correct here, because the event "No transmission error" is much more likely than three errors at exactly specified positions. Consider the following graphic:
  
[[File:P_ID2660__KC_A_3_9c.png|center|frame|Trellis ohne Fehler/mit drei Übertragungsfehlern]]
+
[[File:P_ID2660__KC_A_3_9c.png|center|frame|Trellis without error/with three transmission errors]]
  
*Wird die Nullsequenz gesendet und diese auch empfangen, so kann die Viterbi&ndash;Decodierung durch das obere Trellis veranschaulicht werden.  
+
*If the zero sequence is sent and this is also received, the Viterbi decoding can be illustrated by the upper trellis.  
*Der Endwert der Fehlergröße ist ${\it \Gamma}_5(S_0) = 0$, und der Viterbi&ndash;Decoder entscheidet mit Sicherheit richtig: $\underline{z} = \underline{x} &nbsp;&#8658;&nbsp; \underline{v} = \underline{u}$.
+
*The final value of the branch metric is ${\it \Gamma}_5(S_0) = 0$, and the Viterbi decoder decides correctly with certainty: $\underline{z} = \underline{x} &nbsp;&#8658;&nbsp; \underline{v} = \underline{u}$.
*Für das untere Trellis gehen wir ebenfalls von $\underline{u} = (0, \, 0, \, 0, \, 0, \, 0) &nbsp; &#8658; &nbsp; \underline{x} = (00, \, 00, \, 00, \, 00, \, 00)$ aus. Empfangen wird aber nun $\underline{y} = (00, \, 00, \, 00, \, 11, \, 01)$. Trotzdem gilt ${\it \Gamma}_5(S_0) = 0$. Das Beispiel belegt, dass die beiden ersten Aussagen falsch sind.  
+
*For the lower trellis, we also assume $\underline{u} = (0, \, 0, \, 0, \, 0 \, 0) &nbsp; &#8658; &nbsp; \underline{x} = (00, \, 00, \, 00, \, 00, \, 00)$. However, $\underline{y} = (00, \, 00, \, 00, \, 11, \, 01)$ is now received. Nevertheless, ${\it \Gamma}_5(S_0) = 0$ holds. The example proves that the first two statements are false.  
  
  
 +
'''(4)'''&nbsp; Correct are <u>all answers</u>:
 +
*If it is known for sure that only one transmission error occurred, for a convolutional code with free distance $d_{\rm F} = 3$ the Viterbi algorithm works perfectly, no matter at which position the error occurred.
  
'''(4)'''&nbsp; Richtig sind <u>alle Antworten</u>:
 
*Wenn man sicher weiß, dass nur ein Übertragungsfehler aufgetreten ist, funktioniert bei einem Faltungscode mit der freien Distanz $d_{\rm F} = 3$ der Viterbi&ndash;Algorithmus perfekt, egal, an welcher Position der Fehler aufgetreten ist.
 
  
  
 +
'''(5)'''&nbsp;<u> None of the proposed solutions</u> is correct, as can be seen from the examples below.
  
'''(5)'''&nbsp;<u> Keiner der Lösungsvorschläge</u> ist richtig, wie aus den nachfolgenden Beispielen zu erkennen ist.
+
[[File:P_ID2661__KC_A_3_9e.png|center|frame|Trellis with two transmission errors]]
 
 
[[File:P_ID2661__KC_A_3_9e.png|center|frame|Trellis mit zwei Übertragungsfehlern]]
 
 
{{ML-Fuß}}
 
{{ML-Fuß}}
  

Revision as of 21:47, 17 October 2022

Trellis to be analyzed

The graph shows a trellis diagram and simultaneously defines the branch metrics  ${\it \Gamma}_i(S_0)$  and  ${\it \Gamma}_i(S_1)$  at times  $i = 0$  to  $i = 5$.

From this trellis can be read, for example:

  • the code rate  $R$,
  • the memory  $m$,
  • the free distance  $d_{\rm F}$,
  • the information sequence length  $L$,
  • the sequence length  $L\hspace{0.05cm}'$  including the termination.


In the exercise it is further necessary to clarify:

  • the meaning of the final value  ${\it \Gamma}_5(S_0)$,
  • effects of one and two transmission errors, respectively.





Hint:





Questions

1

Which of the following statements are confirmed by the trellis?

It is a rate 1/2 convolutional code.
The memory of the code is  $m = 2$.
The convolutional code is terminated.
The length of the information sequence is  $L = 5$.

2

Specify the free distance  $d_{\rm F}$  of the convolutional code.

$d_{\rm F} \ = \ $

3

What statements does the final value  ${\it \Gamma}_5(S_0) = 0$  of the branch metric allow?

No transmission error has occurred.
The decoding result  $\underline{v}$  is certainly correct $($equal  $\underline{u})$.
The decoding result minimizes the probability  ${\rm Pr}(\underline{v} ≠ \underline{u})$.

4

Which statements are true in the case of a single transmission error?

The final branch metric is  ${\it \Gamma}_5(S_0) = 1$.
The decoding result  $\underline{v}$  is certainly correct  $($equal  $\underline{u})$.
The decoding result minimizes the probability  ${\rm Pr}(\underline{v} ≠ \underline{u})$.

5

Which statements are true in the case of two transmission errors?

The final branch metric is  ${\it \Gamma}_5(S_0) = 2$.
The decoding result  $\underline{v}$  is certainly correct  $($equal  $\underline{u})$.
The decoding result  $\underline{v}$  is certainly false  $($unequal  $\underline{u})$.


Solution

(1)  Correct are the solutions 1 and 3:

  • There are $2^{k \cdot m} = 2$ states here. It follows that $k = 1$ and $m = 1$.
  • Per coding step, $n = 2$ code bits are output   ⇒   $R = 1/2$.
  • The information sequence length is $L = 4$.
  • Only by one (since $m = 1$) additional termination bit one arrives at the total length $L' = 5$.


(2)  The free distance $d_{\rm F}$ is defined as the number of codebits in which two sequences $\underline{x}$ and $\underline{x'}$ differ. We choose the zero sequence as the reference sequence:

$$\underline{x}\hspace{0.03cm}' = \underline{0} = \big (00\hspace{0.05cm}, 00\hspace{0.05cm}, 00\hspace{0.05cm}, 00\hspace{0.05cm}, ... \hspace{0.1cm} \big ) \hspace{0.05cm},$$

expressed with the sequence of states:   $S_0 → S_0 → S_0 → S_0 → \ \text{...} \ $

  • One of the sequences $\underline{x} ≠ \underline{0}$, which differs from $\underline{0}$ only in the minimum number of codebits, follows the path $S_0 → S_1 → S_0 → S_0 → \text{...} \ $:
$$\underline{x} = \big (11\hspace{0.05cm}, 01\hspace{0.05cm}, 00\hspace{0.05cm}, 00\hspace{0.05cm}, ... \hspace{0.1cm} \big ) \hspace{0.3cm}\Rightarrow \hspace{0.3cm} d_{\rm F}\hspace{0.1cm}\underline{ = 3} \hspace{0.05cm}.$$


(3)  Only proposition 3 is correct here, because the event "No transmission error" is much more likely than three errors at exactly specified positions. Consider the following graphic:

Trellis without error/with three transmission errors
  • If the zero sequence is sent and this is also received, the Viterbi decoding can be illustrated by the upper trellis.
  • The final value of the branch metric is ${\it \Gamma}_5(S_0) = 0$, and the Viterbi decoder decides correctly with certainty: $\underline{z} = \underline{x}  ⇒  \underline{v} = \underline{u}$.
  • For the lower trellis, we also assume $\underline{u} = (0, \, 0, \, 0, \, 0 \, 0)   ⇒   \underline{x} = (00, \, 00, \, 00, \, 00, \, 00)$. However, $\underline{y} = (00, \, 00, \, 00, \, 11, \, 01)$ is now received. Nevertheless, ${\it \Gamma}_5(S_0) = 0$ holds. The example proves that the first two statements are false.


(4)  Correct are all answers:

  • If it is known for sure that only one transmission error occurred, for a convolutional code with free distance $d_{\rm F} = 3$ the Viterbi algorithm works perfectly, no matter at which position the error occurred.


(5)  None of the proposed solutions is correct, as can be seen from the examples below.

Trellis with two transmission errors