8 Homing sequences
3GPP46.060Enhanced Full Rate (EFR) speech transcodingRelease 17TS
8.1 Functional description
The enhanced full rate speech codec is described in a bit‑exact arithmetic to allow for easy type approval as well as general testing purposes of the enhanced 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 in 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.
8.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 table7. 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.
Table7: Parameter values for the decoder homing frame
Parameter |
Value (LSB=b0) |
LPC 1 |
0x0004 |
LPC 2 |
0x002F |
LPC 3 |
0x00B4 |
LPC 4 |
0x0090 |
LPC 5 |
0x003E |
LTP‑LAG 1 |
0x0156 |
LTP‑LAG 2 |
0x0036 |
LTP‑LAG 3 |
0x0156 |
LTP‑LAG 4 |
0x0036 |
LTP‑GAIN 1 |
0x000B |
LTP‑GAIN 2 |
0x0001 |
LTP‑GAIN 3 |
0x0000 |
LTP‑GAIN 4 |
0x000B |
FCB‑GAIN 1 |
0x0003 |
FCB‑GAIN 2 |
0x0000 |
FCB‑GAIN 3 |
0x0000 |
FCB‑GAIN 4 |
0x0000 |
PULSE 1_1 |
0x0000 |
PULSE 1_2 |
0x0001 |
PULSE 1_3 |
0x000F |
PULSE 1_4 |
0x0001 |
PULSE 1_5 |
0x000D |
PULSE 1_6 |
0x0000 |
PULSE 1_7 |
0x0003 |
PULSE 1_8 |
0x0000 |
PULSE 1_9 |
0x0003 |
PULSE 1_10 |
0x0000 |
PULSE 2_1 |
0x0008 |
PULSE 2_2 |
0x0008 |
PULSE 2_3 |
0x0005 |
PULSE 2_4 |
0x0008 |
PULSE 2_5 |
0x0001 |
PULSE 2_6 |
0x0000 |
PULSE 2_7 |
0x0000 |
PULSE 2_8 |
0x0001 |
PULSE 2_9 |
0x0001 |
PULSE 2_10 |
0x0000 |
PULSE 3_1 |
0x0000 |
PULSE 3_2 |
0x0000 |
PULSE 3_3 |
0x0000 |
PULSE 3_4 |
0x0000 |
PULSE 3_5 |
0x0000 |
PULSE 3_6 |
0x0000 |
PULSE 3_7 |
0x0000 |
PULSE 3_8 |
0x0000 |
PULSE 3_9 |
0x0000 |
PULSE 3_10 |
0x0000 |
PULSE 4_1 |
0x0000 |
PULSE 4_2 |
0x0000 |
PULSE 4_3 |
0x0000 |
PULSE 4_4 |
0x0000 |
PULSE 4_5 |
0x0000 |
PULSE 4_6 |
0x0000 |
PULSE 4_7 |
0x0000 |
PULSE 4_8 |
0x0000 |
PULSE 4_9 |
0x0000 |
PULSE 4_10 |
0x0000 |
8.3 Encoder homing
Whenever the enhanced 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. But if the speech encoder was 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 the way how the decoder homing frame was constructed).
Step 2: After successful termination 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.
8.4 Decoder homing
Whenever the speech decoder receives at its input a decoder homing 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. But if the speech decoder was 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 termination 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 LPC 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.
8.5 Encoder home state
In table 8, a listing of all the encoder state variables with their predefined values when in the home state is given.
Table 8: Initial values of the encoder state variables
File |
Variable |
Initial value |
cod_12k2.c |
old_speech0:319 |
All set to 0 |
old_exc0:153 |
All set to 0 |
|
old_wsp0:142 |
All set to 0 |
|
mem_syn0:9 |
All set to 0 |
|
mem_w0:9 |
All set to 0 |
|
mem_w00:9 |
All set to 0 |
|
mem_err0:9 |
All set to 0 |
|
ai_zero11:50 |
All set to 0 |
|
hvec0:39 |
All set to 0 |
|
lsp_old0, lsp_old_q0 |
30000 |
|
lsp_old1, lsp_old_q1 |
26000 |
|
lsp_old2, lsp_old_q2 |
21000 |
|
lsp_old3, lsp_old_q3 |
15000 |
|
lsp_old4, lsp_old_q4 |
8000 |
|
lsp_old5, lsp_old_q5 |
0 |
|
lsp_old6, lsp_old_q6 |
‑8000 |
|
lsp_old7, lsp_old_q7 |
‑15000 |
|
lsp_old8, lsp_old_q8 |
‑21000 |
|
lsp_old9, lsp_old_q9 |
‑26000 |
|
levinson.c |
old_A0 |
4096 |
old_A1:10 |
All set to 0 |
|
pre_proc.c |
y2_hi, y2_lo, y1_hi, y1_lo, x1, x0 |
All set to 0 |
q_plsf_5.c |
past_r2_q0:9 |
All set to 0 |
q_gains.c |
past_qua_en0:3 |
All set to ‑2381 |
pred0 |
44 |
|
pred1 |
37 |
|
pred2 |
22 |
|
pred3 |
12 |
|
dtx.c |
txdtx_hangover |
7 |
txdtx_N_elapsed |
0x7fff |
|
txdtx_ctrl |
0x0003 |
|
old_CN_mem_tx0:5 |
All set to 0 |
|
lsf_old_tx0:60 |
1384 |
|
lsf_old_tx0:61 |
2077 |
|
lsf_old_tx0:62 |
3420 |
|
lsf_old_tx0:63 |
5108 |
|
lsf_old_tx0:64 |
6742 |
|
lsf_old_tx0:65 |
8122 |
|
lsf_old_tx0:66 |
9863 |
|
lsf_old_tx0:67 |
11092 |
|
lsf_old_tx0:68 |
12714 |
|
lsf_old_tx0:69 |
13701 |
|
gain_code_old_tx0:27 |
All set to 0 |
|
L_pn_seed_tx |
0x70816958 |
|
buf_p_tx |
0 |
Initial values for variables used by the VAD algorithm are listed in GSM 06.32 [4].
8.6 Decoder home state
In table 9, a listing of all the decoder state variables with their predefined values when in the home state is given.
Table 9: Initial values of the decoder state variables
File |
Variable |
Initial value |
decoder.c |
synth_buf0:9 |
All set to 0 |
dec_12k2.c |
old_exc0:153 |
All set to 0 |
mem_syn0:9 |
All set to 0 |
|
lsp_old0 |
30000 |
|
lsp_old1 |
26000 |
|
lsp_old2 |
21000 |
|
lsp_old3 |
15000 |
|
lsp_old4 |
8000 |
|
lsp_old5 |
0 |
|
lsp_old6 |
‑8000 |
|
lsp_old7 |
‑15000 |
|
lsp_old8 |
‑21000 |
|
lsp_old9 |
‑26000 |
|
prev_bf |
0 |
|
state |
0 |
|
agc.c |
past_gain |
4096 |
d_plsf_5.c |
past_r2_q0:9 |
All set to 0 |
past_lsf_q0, lsf_p_CN0, lsf_old_CN0,lsf_new_CN0 |
1384 |
|
past_lsf_q1, lsf_p_CN1, lsf_old_CN1,lsf_new_CN1 |
2077 |
|
past_lsf_q2, lsf_p_CN2, lsf_old_CN2,lsf_new_CN2 |
3420 |
|
past_lsf_q3, lsf_p_CN3, lsf_old_CN3,lsf_new_CN3 |
5108 |
|
past_lsf_q4, lsf_p_CN4, lsf_old_CN4,lsf_new_CN4 |
6742 |
|
past_lsf_q5, lsf_p_CN5, lsf_old_CN5,lsf_new_CN5 |
8122 |
|
past_lsf_q6, lsf_p_CN6, lsf_old_CN6,lsf_new_CN6 |
9863 |
|
past_lsf_q7, lsf_p_CN7, lsf_old_CN7,lsf_new_CN7 |
11092 |
|
past_lsf_q8, lsf_p_CN8, lsf_old_CN8,lsf_new_CN8 |
12714 |
|
past_lsf_q9, lsf_p_CN9, lsf_old_CN9,lsf_new_CN9 |
13701 |
|
d_gains.c |
pbuf0:4 |
All set to 410 |
gbuf0:4 |
All set to 1 |
|
past_gain_pit |
0 |
|
past_gain_code |
0 |
|
prev_gp |
4096 |
|
prev_gc |
1 |
|
gcode0_CN |
0 |
|
gain_code_old_CN |
0 |
|
gain_code_new_CN |
0 |
|
gain_code_muting_CN |
0 |
|
past_qua_en0:3 |
All set to ‑2381 |
|
pred0 |
44 |
|
pred1 |
37 |
|
pred2 |
22 |
|
pred3 |
12 |
|
(continued) |
Table 9 (concluded): Initial values of the decoder state variables
File |
Variable |
Initial value |
dtx.c |
rxdtx_aver_period |
7 |
rxdtx_N_elapsed |
0x7fff |
|
rxdtx_ctrl |
0x0001 |
|
lsf_old_rx0:60 |
1384 |
|
lsf_old_rx0:61 |
2077 |
|
lsf_old_rx0:62 |
3420 |
|
lsf_old_rx0:63 |
5108 |
|
lsf_old_rx0:64 |
6742 |
|
lsf_old_rx0:65 |
8122 |
|
lsf_old_rx0:66 |
9863 |
|
lsf_old_rx0:67 |
11092 |
|
lsf_old_rx0:68 |
12714 |
|
lsf_old_rx0:69 |
13701 |
|
gain_code_old_rx0:27 |
All set to 0 |
|
L_pn_seed_rx |
0x70816958 |
|
rx_dtx_state |
23 |
|
prev_SID_frames_lost |
0 |
|
buf_p_rx |
0 |
|
dec_lag6.c |
old_T0 |
40 |
preemph.c |
mem_pre |
0 |
pstfilt2.c |
mem_syn_pst0:9 |
All set to 0 |
res20:39 |
All set to 0 |
Figure 2: Simplified block diagram of the CELP synthesis model
Figure 3: Simplified block diagram of the GSM enhanced full rate encoder
Figure 4: Simplified block diagram of the GSM enhanced full rate decoder