Difference between revisions of "Aufgaben:Exercise 3.6: Adaptive Multi Rate Codec"

From LNTwww
Line 1: Line 1:
  
{{quiz-Header|Buchseite=Beispiele von Nachrichtensystemen/Sprachcodierung
+
{{quiz-Header|Buchseite=Examples_of_Communication_Systems/Voice_Coding
 
}}  
 
}}  
  
[[File:En_Bei_A_3_6.png|right|frame|Spuren des AMR–Codecs]]
+
[[File:En_Bei_A_3_6.png|right|frame|Tracks of the AMR–codec]]
Ende der 1990er Jahre wurde mit dem AMR–Codec ein sehr flexibler, adaptiver Sprachcodec entwickelt und standardisiert. Dieser stellt insgesamt acht verschiedene Modi mit Datenraten zwischen  $4.75 \ \rm kbit/s$  und  $12.2 \ \rm kbit/s$  zur Verfügung.
+
In the late 1990s, a very flexible, adaptive speech codec was developed and standardised in the form of the AMR codec. This provides a total of eight different modes with data rates between  $4.75 \ \rm kbit/s$  and  $12.2 \ \rm kbit/s$ .
  
Der AMR-Codec beinhaltet wie der in  [[Aufgaben:Aufgabe_3.5:_GSM–Vollraten–Sprachcodec|Aufgabe 3.5]]  behandelte Vollraten–Codec (FRC)  sowohl eine Kurzzeitprädiktion (LPC) als auch eine Langzeitprädiktion (LTP). Allerdings sind diese beiden Komponenten anders realisiert als beim FRC.
+
The AMR codec, like the full-rate codec (FRC) discussed in  [[Aufgaben:Exercise_3.5:_GSM_Full-Rate_Voice_Codec|"Exercise 3.5"]] , includes both a short-term prediction (LPC) and a long-term prediction (LTP). However, these two components are realised differently from FRC.
  
Der wesentliche Unterschied von AMR gegenüber FRC stellt die Codierung des Restsignals (nach LPC und LTP) dar:  
+
The main difference between AMR and FRC is the coding of the residual signal (after LPC and LTP):  
*Anstelle von „Regular Pulse Excitation” (RPE) wird beim AMR–Code das Verfahren „Algebraic Code Excitation Linear Prediction” (ACELP) angewendet.  
+
*Instead of "Regular Pulse Excitation" (RPE), the "Algebraic Code Excitation Linear Prediction" (ACELP) procedure is used for the AMR code.  
*Aus dem festen Codebuch (FCB) wird für jeden Unterrahmen von  $5 \ \rm ms$  Dauer derjenige FCB–Puls und diejenige FCB–Verstärkung ausgewählt, die am besten zum Restsignal passen (für die der mittlere quadratische Fehler des Differenzsignals minimal wird).
+
*From the fixed codebook (FCB), for each subframe of  $5 \ \rm ms$  duration, the FCB pulse and FCB gain that best match the residual signal (for which the mean square error of the difference signal becomes minimum) is selected.
  
  
Jeder Eintrag im festen Codebuch kennzeichnet einen Puls, bei dem genau  $10$  der  $40$  Positionen mit  $\pm1$  belegt sind. Hierzu ist anzumerken:
+
Each entry in the fixed codebook identifies a pulse where exactly  $10$  of  $40$  positions are occupied by  $\pm1$ . In this regard it should be noted:
*Der Puls ist in fünf Spuren mit jeweils acht möglichen Positionen aufgeteilt, wobei die Spur  $1$  die Positionen  $1,\ 6,\ 11$, ... , $36$  des Unterrahmens und Spur  $5$  die Positionen  $5,\ 10,\ 15$, ... , $40$  beschreibt.
+
*The pulse is divided into five tracks with eight possible positions each, where track  $1$  contains the positions  $1,\ 6,\ 11$, ... , $36$  of the subframe and track  $5$  the positions  $5,\ 10,\ 15$, ... , $40$  describes.
*In jeder Spur sind genau zwei Werte  $\pm1$, während alle anderen sechs Werte  $0$  sind. Die beiden  $±1$–Positionen werden mit je drei Bit – also mit  $000$, ... ,  $111$ – codiert.
+
*In each track there are exactly two values  $\pm1$, while all the other six values are  $0$ . The two  $±1$-positions are each assigned three bits - i.e. with  $000$, ... ,  $111$ - are coded.
*Für das Vorzeichen des erstgenannten Pulses wird ein weiteres Bit verwendet, wobei eine "$1$" ein positives Vorzeichen und eine "$0$" ein negatives  Vorzeichen kennzeichnet.
+
*Another bit is used for the sign of the first-mentioned pulse, where a "$1$" indicates a positive sign and a "$0$" a negative sign.
*Ist die Pulsposition des zweiten Impulses größer als die des ersten Impulses, so hat der zweite Impuls das gleiche Vorzeichen wie der erste, ansonsten das umgekehrte.
+
*If the pulse position of the second pulse is greater than that of the first pulse, the second pulse has the same sign as the first, otherwise the opposite.
*Zum Empfänger werden somit pro Spur sieben Bit übertragen, außerdem noch fünf Bit für die so genannte  ''FCB–Verstärkung''.
+
*Thus, seven bits per track are transmitted to the receiver, plus five bits for the so-called ''FCB amplification''.
  
  
In der Grafik sind die  $35$  Bit zur Beschreibung eines FCB–Pulses beispielhaft angegeben.
+
In the diagram, the  $35$  bits describing an FCB pulse are given as an example.
 
   
 
   
'''Spur 1''' beinhaltet
+
'''Track 1''' includes.
*einen positiven Impuls  $({\rm VZ} = 1)$  bei  $1$  (erste mögliche Position für Spur 1)  $\hspace{0.2cm}\text{plus}\hspace{0.2cm}0$ (Bitangabe für " 000") $= 1$,
+
*a positive pulse  $({\rm VZ} = 1)$  at  $1$  (first possible position for track 1)  $\hspace{0.2cm}\text{plus}\hspace{0.2cm}0$ (bit specification for " 000") $= 1$,
*einen weiteren positiven Impuls (da $110 > 000$) bei der Position $1 \hspace{0.2cm}\text{plus}\hspace{0.2cm}5$ (Pulsabstand in jeder Spur) $\hspace{0.2cm}\text{mal}\hspace{0.2cm}6$ (Bitangabe für " 110") = $31\hspace{0.05cm}.$
+
*another positive pulse (since $110 > 000$) at position $1 \hspace{0.2cm}\text{plus}\hspace{0.2cm}5$ (pulse spacing in each track) $\hspace{0.2cm}\text{mal}\hspace{0.2cm}6$ (bit specification for " 110") = $31\hspace{0.05cm}.$
  
  
'''Spur 2''' beinhaltet
+
'''Track 2''' includes.
*einen negativen Impuls (${\rm VZ} = 0$) bei $2$ (erste mögliche Position für Spur 2) $\hspace{0.2cm}\text{plus}\hspace{0.2cm}5\hspace{0.2cm}\text{mal}\hspace{0.2cm}4$ (Bitangabe für " 100") = $22\hspace{0.05cm},$
+
*a negative pulse (${\rm VZ} = 0$) at $2$ (first possible position for track 2) $\hspace{0.2cm}\text{plus}\hspace{0.2cm}5\hspace{0.2cm}\text{mal}\hspace{0.2cm}4$ (bit specification for " 100") = $22\hspace{0.05cm},$
*einen positiven Impuls (Vorzeichenumkehr wegen  $011 > 100$) bei der Position $2 \hspace{0.2cm}\text{plus}\hspace{0.2cm}5\hspace{0.2cm}\text{mal}\hspace{0.2cm}3$ (Bitangabe für " 011") = $17\hspace{0.05cm}.$
+
*a positive pulse (sign reversal due to $011 > 100$) at position $2 \hspace{0.2cm}\text{plus}\hspace{0.2cm}5\hspace{0.2cm}\text{mal}\hspace{0.2cm}3$ (bit specification for " 011") = $17\hspace{0.05cm}.$
  
  
Line 38: Line 38:
  
  
''Hinweise:''
+
Hint:  
  
*Diese Aufgabe gehört zum Kapitel  [[Examples_of_Communication_Systems/Sprachcodierung|Sprachcodierung]].
+
*This exercise belongs to the chapter  [[Examples_of_Communication_Systems/Voice_Coding|"Voice Coding"]].
 
   
 
   
*Bei der Eingabe der Pulspositionen bezeichnet  $N_{1}$  das erste Bit–Tripel und  $N_{2}$  das zweite.
+
*When entering the pulse positions  $N_{1}$  denotes the first triple of bits and  $N_{2}$  the second.
*Man müsste zum Beispiel für Spur  $2$  die Werte  $N_{1}=-22$  und  $N_{2}=+17$  eintragen.   
+
*For example, for track  $2$  one would have to enter the values  $N_{1}=-22$  and  $N_{2}=+17$ .   
  
  
  
===Fragebogen===
+
===Questions===
  
 
<quiz display=simple>
 
<quiz display=simple>

Revision as of 21:45, 21 January 2023

Tracks of the AMR–codec

In the late 1990s, a very flexible, adaptive speech codec was developed and standardised in the form of the AMR codec. This provides a total of eight different modes with data rates between  $4.75 \ \rm kbit/s$  and  $12.2 \ \rm kbit/s$ .

The AMR codec, like the full-rate codec (FRC) discussed in  "Exercise 3.5" , includes both a short-term prediction (LPC) and a long-term prediction (LTP). However, these two components are realised differently from FRC.

The main difference between AMR and FRC is the coding of the residual signal (after LPC and LTP):

  • Instead of "Regular Pulse Excitation" (RPE), the "Algebraic Code Excitation Linear Prediction" (ACELP) procedure is used for the AMR code.
  • From the fixed codebook (FCB), for each subframe of  $5 \ \rm ms$  duration, the FCB pulse and FCB gain that best match the residual signal (for which the mean square error of the difference signal becomes minimum) is selected.


Each entry in the fixed codebook identifies a pulse where exactly  $10$  of  $40$  positions are occupied by  $\pm1$ . In this regard it should be noted:

  • The pulse is divided into five tracks with eight possible positions each, where track  $1$  contains the positions  $1,\ 6,\ 11$, ... , $36$  of the subframe and track  $5$  the positions  $5,\ 10,\ 15$, ... , $40$  describes.
  • In each track there are exactly two values  $\pm1$, while all the other six values are  $0$ . The two  $±1$-positions are each assigned three bits - i.e. with  $000$, ... ,  $111$ - are coded.
  • Another bit is used for the sign of the first-mentioned pulse, where a "$1$" indicates a positive sign and a "$0$" a negative sign.
  • If the pulse position of the second pulse is greater than that of the first pulse, the second pulse has the same sign as the first, otherwise the opposite.
  • Thus, seven bits per track are transmitted to the receiver, plus five bits for the so-called FCB amplification.


In the diagram, the  $35$  bits describing an FCB pulse are given as an example.

Track 1 includes.

  • a positive pulse  $({\rm VZ} = 1)$  at  $1$  (first possible position for track 1)  $\hspace{0.2cm}\text{plus}\hspace{0.2cm}0$ (bit specification for " 000") $= 1$,
  • another positive pulse (since $110 > 000$) at position $1 \hspace{0.2cm}\text{plus}\hspace{0.2cm}5$ (pulse spacing in each track) $\hspace{0.2cm}\text{mal}\hspace{0.2cm}6$ (bit specification for " 110") = $31\hspace{0.05cm}.$


Track 2 includes.

  • a negative pulse (${\rm VZ} = 0$) at $2$ (first possible position for track 2) $\hspace{0.2cm}\text{plus}\hspace{0.2cm}5\hspace{0.2cm}\text{mal}\hspace{0.2cm}4$ (bit specification for " 100") = $22\hspace{0.05cm},$
  • a positive pulse (sign reversal due to $011 > 100$) at position $2 \hspace{0.2cm}\text{plus}\hspace{0.2cm}5\hspace{0.2cm}\text{mal}\hspace{0.2cm}3$ (bit specification for " 011") = $17\hspace{0.05cm}.$




Hint:

  • When entering the pulse positions  $N_{1}$  denotes the first triple of bits and  $N_{2}$  the second.
  • For example, for track  $2$  one would have to enter the values  $N_{1}=-22$  and  $N_{2}=+17$ .


Questions

1

Wie viele Bit beschreiben einen Sprachrahmen $($der Dauer  $20 \ \rm ms)$  im  $12.2 \ \rm kbit/s$–Modus?

$N_{12.2} \ = \ $

$ \ \rm Bit$

2

Wie viele Bit werden für FCB–Puls und –Verstärkung pro Rahmen benötigt?

$N_{\rm FCB} \ = \ $

$ \ \rm Bit$

3

Wie viele Bit verbleiben somit für LPC und LTP?

$N_{\rm LPC/LTP} \ = \ $

$ \ \rm Bit$

4

Welche Impulspositionen des Unterrahmens und Vorzeichen beschreibt die Spur  $3$?
Beachten Sie die Hinweise zur Eingabe auf der Angabenseite.

$N_{1} \ = \ $

$N_{2} \ = \ $

5

Welche Impulspositionen inklusive Vorzeichen beschreiben die Spur  $4$?

$N_{1} \ = \ $

$N_{2} \ = \ $

6

Welche Impulspositionen inklusive Vorzeichen beschreiben die Spur  $5$?

$N_{1} \ = \ $

$N_{2} \ = \ $


Musterlösung

(1)  Mit der Datenrate $12.2 \ \rm kbit/s$ ergeben sich innerhalb von $20 \ \rm ms$ genau $\underline{244 \ \rm Bit}$, während zum Beispiel im $4.75 \ \rm kbit/s$–Modus nur $95 \ \rm Bit$ übertragen werden.


(2)  In jedem Unterrahmen benötigt der FCB–Puls $35 \ \rm Bit$ (fünf Spuren zu je sieben Bit) und die FCB–Verstärkung fünf Bit.

  • Bei vier Unterrahmen kommt man so auf $N_{\rm FCB} \underline{= 160 \ \rm Bit}$.


(3)  Hierfür verbleiben die Differenz aus (1) und (2), also $N_{\rm LPC/LTP}\underline{ = 84 \ \rm Bit}$.


(4)  Das Vorzeichenbit "$0$" deutet auf einen negativen ersten Impuls hin.

  • Wegen $001 < 011$ hat der zweite Impuls das gleiche Vorzeichen.
  • Die beiden Beträge ergeben sich zu
$$|N_1| \ = \ 3 \hspace{0.1cm}{\rm(da \hspace{0.1cm} Spur \hspace{0.1cm}3)} + 5\cdot 1 \hspace{0.1cm} {\rm(Bitangabe \hspace{0.1cm} 001)} = 8\hspace{0.05cm}, $$
$$ |N_2| \ = \ 3 \hspace{0.1cm}{\rm(da \hspace{0.1cm} Spur \hspace{0.1cm}3)} + 5\cdot 3 \hspace{0.1cm} {\rm(Bitangabe \hspace{0.1cm} 011)} = 18\hspace{0.05cm}.$$
  • Einzugeben sind deshalb für die dritte Spur $N_{1} \underline{ = -8}$ und $N_{2} \underline{ = -18}.$


(5)  In analoger Weise erhält man für die Spur $4$ die Werte  $N_{1} \underline{ = +39}$  und  $N_{2} \underline{ = -14}$.


(6)  Die fünfte Spur liefert  $N_{1} \underline{ =-30}$  und  $N_{2} \underline{ = +5}$