4 Codec homing
3GPP46.010Full rate speechRelease 17TranscodingTS
The below described codec homing procedure is introduced to the GSM Full Rate speech codec as an optional feature to simplify bit-exact codec tests. If is free to the manufacturers to implement this feature or not.
4.1 Functional description
The full rate speech codec is described in a bit‑exact arithmetic to ease type approval as well as general testing purposes of the full rate speech codec.
The response of the codec to a predefined input sequence can only be foreseen if the internal state variables of the codec are in a predefined state at the beginning of the experiment. Therefore, the codec has to be put into a so called home state before a bit‑exact test can be performed. This is usually done by a reset (a procedure in which the internal state variables of the codec are set to their defined initial values).
To allow a reset of the codec in remote locations, special homing frames have been defined for the encoder and the decoder, thus enabling a codec homing by inband signalling.
The codec homing procedure is defined in such a way, that in either direction (encoder or decoder) the homing functions are called after processing the homing frame that is input. The output corresponding to the first homing frame is therefore dependent on the codec state when receiving that frame and hence usually not known. The response to any further homing frame in one direction is by definition a homing frame of the other direction. This procedure allows homing of both, the encoder and decoder from either side, if a loop back configuration is implemented, taking proper framing into account.
4.2 Definitions
Encoder-homing-frame: The encoder-homing-frame consists of 160 identical samples, each 13 bits long, with the least significant bit set to "one" and all other bits set to "zero". When written to 16‑bit words with left justification, the samples have a value of 0008 hex. The speech decoder has to produce this frame as a response to the second and any further decoder-homing-frame if at least two decoder-homing-frames were input to the decoder consecutively.
Decoder-homing-frame: The decoder-homing-frame has a fixed set of speech parameters as described in table 4.1 a/b. It is the natural response of the speech encoder to the second and any further encoder-homing-frame if at least two encoder-homing-frames were input to the encoder consecutively.
Table 4.1 a: LAR parameter values for the decoder-homing-frame
LARc[1] |
LARc[2] |
LARc[3] |
LARc[4] |
LARc[5] |
LARc[6] |
LARc[7] |
LARc[8] |
0x0009 |
0x0017 |
0x000F |
0x0008 |
0x0007 |
0x0003 |
0x0003 |
0x0002 |
Table 4.1 b: Sub-frame parameter values for the decoder-homing-frame
Parameter |
Sub-frame 1 |
Sub-frame 2 |
Sub-frame 3 |
Sub-frame 4 |
|
LTP lag |
Nc |
0x0028 |
0x0028 |
0x0028 |
0x0028 |
LTP gain |
bc |
0x0000 |
0x0000 |
0x0000 |
0x0000 |
RPE grid |
Mc |
0x0000 |
0x0000 |
0x0000 |
0x0000 |
block amplitude |
xmaxc |
0x0000 |
0x0000 |
0x0000 |
0x0000 |
RPE pulse 0 |
xMc[0] |
0x0004 |
0x0004 |
0x0004 |
0x0004 |
RPE pulse 1 |
xMc[1] |
0x0004 |
0x0004 |
0x0004 |
0x0004 |
RPE pulse 2 |
xMc[2] |
0x0004 |
0x0004 |
0x0004 |
0x0004 |
RPE pulse 3 |
xMc[3] |
0x0004 |
0x0004 |
0x0004 |
0x0004 |
RPE pulse 4 |
xMc[4] |
0x0004 |
0x0004 |
0x0004 |
0x0003 |
RPE pulse 5 |
xMc[5] |
0x0004 |
0x0004 |
0x0004 |
0x0004 |
RPE pulse 6 |
xMc[6] |
0x0004 |
0x0004 |
0x0004 |
0x0004 |
RPE pulse 7 |
xMc[7] |
0x0004 |
0x0004 |
0x0004 |
0x0004 |
RPE pulse 8 |
xMc[8] |
0x0004 |
0x0004 |
0x0004 |
0x0004 |
RPE pulse 9 |
xMc[9] |
0x0004 |
0x0004 |
0x0004 |
0x0004 |
RPE pulse 10 |
xMc[10] |
0x0004 |
0x0004 |
0x0004 |
0x0004 |
RPE pulse 11 |
xMc[11] |
0x0004 |
0x0004 |
0x0004 |
0x0004 |
RPE pulse 12 |
xMc[12] |
0x0004 |
0x0004 |
0x0004 |
0x0004 |
4.3 Encoder homing
Whenever the full rate speech encoder receives at its input an encoder-homing-frame exactly aligned with its internal speech frame segmentation, the following events take place:
Step 1: The speech encoder performs its normal operation including VAD and DTX and produces a speech parameter frame at its output which is in general unknown. If the speech encoder is already in its home state at the beginning of that frame, then the resulting speech parameter frame is identical to the decoder-homing-frame.This is how the decoder-homing-frame was constructed.
Step 2: After successful completion of that operation, the speech encoder provokes the homing functions for all sub‑modules including VAD and DTX and sets all state variables into their home state. On the reception of the next input frame, the speech encoder will start from its home state.
NOTE: Applying a sequence of N encoder-homing-frames will cause at least N‑1 decoder-homing-frames at the output of the speech encoder.
4.4 Decoder homing
Whenever the speech decoder receives at its input a decoder-homing-frame (which is not marked as a bad frame), then the following events take place:
Step 1: The speech decoder performs its normal operation and produces a speech frame at its output which is in general unknown. If the speech decoder is already in its home state at the beginning of that frame, then the resulting speech frame is replaced by the encoder- homing-frame. This would not naturally be the case but is forced by this definition here.
Step 2: After successful completion of that operation, the speech decoder provokes the homing functions for all sub‑modules including the comfort noise generator and sets all state variables into their home state. On the reception of the next input frame, the speech decoder will start from its home state.
NOTE 1: Applying a sequence of N decoder-homing-frames will cause at least N‑1 encoder-homing-frames at the output of the speech decoder.
NOTE 2: By definition, the first frame of each decoder test sequence must differ from the decoder-homing-frame at least in one bit position within the parameters for LARs and first subframe. Therefore, if the decoder is in its home state, it is sufficient to check only these parameters to detect a subsequent decoder-homing-frame. This definition is made to support a delay‑optimized implementation in the TRAU uplink direction.
4.5 Encoder home state
In table 4.2, a listing of all the encoder state variables with their predefined values when in the home state is given.
Table 4.2: Initial values of the encoder state variables
Variable |
Initial value |
|
Offset compensation filter memory |
z1 |
set to 0 |
Offset compensation filter memory |
L_z2 |
set to 0 |
Pre-emphasis filter memory |
mp |
set to 0 |
LARs from previous frame |
LARpp(j‑1)[1…8] |
all set to 0 |
Short term analysis filter memory |
u[0…7] |
all set to 0 |
LTP delay line |
dp[‑120…‑1] |
all set to 0 |
Initial values for variables used by the VAD algorithm are listed in GSM 06.32 [12]. In addition, the state variables of the DTX system have to be brought into their home state. As the DTX system is not specified in a bit-exact way, no common reset table can be given here.
4.6 Decoder home state
In table 4.3, a listing of all the decoder state variables with their predefined values when in the home state is given.
Table 4.3: Initial values of the decoder state variables
Variable |
Initial value |
|
LTP lag from previous frame |
nrp |
set to 40 |
LTP delay line |
drp[‑120…‑1] |
all set to 0 |
LARs from previous frame |
LARrpp(j‑1)[1…8] |
all set to 0 |
Short term synthesis filter memory |
v[0…8] |
all set to 0 |
De-emphasis filter memory |
msr |
set to 0 |
In addition, the state variables of the bad frame handling (error concealment) module and the comfort noise insertion module have to be brought into their home state. As these modules are not specified in a bit-exact way, no common reset table can be given here.