8 Homing sequences

06.603GPPEnhanced full rate speech transcodingTS

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_speech0:319

All set to 0

old_exc0:153

All set to 0

old_wsp0:142

All set to 0

mem_syn0:9

All set to 0

mem_w0:9

All set to 0

mem_w00:9

All set to 0

mem_err0:9

All set to 0

ai_zero11:50

All set to 0

hvec0:39

All set to 0

lsp_old0, lsp_old_q0

30000

lsp_old1, lsp_old_q1

26000

lsp_old2, lsp_old_q2

21000

lsp_old3, lsp_old_q3

15000

lsp_old4, lsp_old_q4

8000

lsp_old5, lsp_old_q5

0

lsp_old6, lsp_old_q6

‑8000

lsp_old7, lsp_old_q7

‑15000

lsp_old8, lsp_old_q8

‑21000

lsp_old9, lsp_old_q9

‑26000

levinson.c

old_A0

4096

old_A1: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_q0:9

All set to 0

q_gains.c

past_qua_en0:3

All set to ‑2381

pred0

44

pred1

37

pred2

22

pred3

12

dtx.c

txdtx_hangover

7

txdtx_N_elapsed

0x7fff

txdtx_ctrl

0x0003

old_CN_mem_tx0:5

All set to 0

lsf_old_tx0:60

1384

lsf_old_tx0:61

2077

lsf_old_tx0:62

3420

lsf_old_tx0:63

5108

lsf_old_tx0:64

6742

lsf_old_tx0:65

8122

lsf_old_tx0:66

9863

lsf_old_tx0:67

11092

lsf_old_tx0:68

12714

lsf_old_tx0:69

13701

gain_code_old_tx0: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_buf0:9

All set to 0

dec_12k2.c

old_exc0:153

All set to 0

mem_syn0:9

All set to 0

lsp_old0

30000

lsp_old1

26000

lsp_old2

21000

lsp_old3

15000

lsp_old4

8000

lsp_old5

0

lsp_old6

‑8000

lsp_old7

‑15000

lsp_old8

‑21000

lsp_old9

‑26000

prev_bf

0

state

0

agc.c

past_gain

4096

d_plsf_5.c

past_r2_q0:9

All set to 0

past_lsf_q0, lsf_p_CN0,

lsf_old_CN0,lsf_new_CN0

1384

past_lsf_q1, lsf_p_CN1,

lsf_old_CN1,lsf_new_CN1

2077

past_lsf_q2, lsf_p_CN2,

lsf_old_CN2,lsf_new_CN2

3420

past_lsf_q3, lsf_p_CN3,

lsf_old_CN3,lsf_new_CN3

5108

past_lsf_q4, lsf_p_CN4,

lsf_old_CN4,lsf_new_CN4

6742

past_lsf_q5, lsf_p_CN5,

lsf_old_CN5,lsf_new_CN5

8122

past_lsf_q6, lsf_p_CN6,

lsf_old_CN6,lsf_new_CN6

9863

past_lsf_q7, lsf_p_CN7,

lsf_old_CN7,lsf_new_CN7

11092

past_lsf_q8, lsf_p_CN8,

lsf_old_CN8,lsf_new_CN8

12714

past_lsf_q9, lsf_p_CN9,

lsf_old_CN9,lsf_new_CN9

13701

d_gains.c

pbuf0:4

All set to 410

gbuf0: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_en0:3

All set to ‑2381

pred0

44

pred1

37

pred2

22

pred3

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_rx0:60

1384

lsf_old_rx0:61

2077

lsf_old_rx0:62

3420

lsf_old_rx0:63

5108

lsf_old_rx0:64

6742

lsf_old_rx0:65

8122

lsf_old_rx0:66

9863

lsf_old_rx0:67

11092

lsf_old_rx0:68

12714

lsf_old_rx0:69

13701

gain_code_old_rx0: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_pst0:9

All set to 0

res20: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