EN 301 245 V4.0.1 (1997-12) European Standard (Telecommunications series)

Digital cellular telecommunications system (Phase 2); Enhanced (EFR) speech transcoding (GSM 06.60 version 4.0.1)

R GLOBAL SYSTEM FOR MOBILE COMMUNICATIONS

European Telecommunications Standards Institute GSM 06.60 version 4.0.1 2 EN 301 245 V4.0.1 (1997-12)

Reference DEN/SMG-110660P (bj00200o.PDF)

Keywords EFR, digital cellular telecommunications system, Global System for Mobile communications (GSM), speech

ETSI Secretariat

Postal address F-06921 Sophia Antipolis Cedex - FRANCE

Office address 650 Route des Lucioles - Sophia Antipolis Valbonne - FRANCE Tel.: +33 4 92 94 42 00 Fax: +33 4 93 65 47 16 Siret N° 348 623 562 00017 - NAF 742 C Association à but non lucratif enregistrée à la Sous-Préfecture de Grasse (06) N° 7803/88

X.400 c= fr; a=atlas; p=etsi; s=secretariat

Internet [email protected] http://www.etsi.fr

Copyright Notification

No part may be reproduced except as authorized by written permission. The copyright and the foregoing restriction extend to reproduction in all media.

© European Telecommunications Standards Institute 1997. All rights reserved. GSM 06.60 version 4.0.1 3 EN 301 245 V4.0.1 (1997-12)

Contents

Intellectual Property Rights...... 4 Foreword ...... 4 1 Scope...... 5 2 Normative references ...... 5 3 Definitions, symbols and abbreviations...... 6 3.1 Definitions ...... 6 3.2 Symbols ...... 7 3.3 Abbreviations...... 13 4 Outline description...... 13 4.1 Functional description of audio parts...... 13 4.2 Preparation of speech samples ...... 14 4.2.1 PCM format conversion ...... 14 4.3 Principles of the GSM enhanced full rate speech encoder...... 14 4.4 Principles of the GSM enhanced full rate speech decoder...... 16 4.5 Sequence and subjective importance of encoded parameters...... 16 5 Functional description of the encoder...... 16 5.1 Pre-processing...... 16 5.2 Linear prediction analysis and quantization...... 17 5.2.1 Windowing and auto-correlation computation ...... 17 5.2.2 Levinson-Durbin algorithm...... 18 5.2.3 LP to LSP conversion...... 18 5.2.4 LSP to LP conversion...... 20 5.2.5 Quantization of the LSP coefficients...... 21 5.2.6 Interpolation of the LSPs...... 22 5.3 Open-loop pitch analysis...... 22 5.4 Impulse response computation...... 23 5.5 Target signal computation...... 23 5.6 Adaptive codebook search ...... 23 5.7 Algebraic codebook structure and search ...... 25 5.8 Quantization of the fixed codebook gain ...... 27 5.9 Memory update...... 28 6 Functional description of the decoder...... 29 6.1 Decoding and speech synthesis...... 29 6.2 Post-processing...... 31 6.2.1 Adaptive post-filtering ...... 31 6.2.2 Up-scaling ...... 32 7 Variables, constants and tables in the C-code of the GSM EFR codec ...... 32 7.1 Description of the constants and variables used in the C code...... 32 8 Homing sequences ...... 35 8.1 Functional description...... 35 8.2 Definitions ...... 35 8.3 Encoder homing...... 37 8.4 Decoder homing...... 37 8.5 Encoder home state...... 38 8.6 Decoder home state...... 39 9 Bibliography...... 44 History...... 45 GSM 06.60 version 4.0.1 4 EN 301 245 V4.0.1 (1997-12)

Intellectual Property Rights

IPRs essential or potentially essential to the present document may have been declared to ETSI. The information pertaining to these essential IPRs, if any, is publicly available for ETSI members and non-members, and can be found in ETR 314: "Intellectual Property Rights (IPRs); Essential, or potentially Essential, IPRs notified to ETSI in respect of ETSI standards", which is available free of charge from the ETSI Secretariat. Latest updates are available on the ETSI Web server (http://www.etsi.fr/ipr).

Pursuant to the ETSI Interim IPR Policy, no investigation, including IPR searches, has been carried out by ETSI. No guarantee can be given as to the existence of other IPRs not referenced in ETR 314 (or the updates on http://www.etsi.fr/ipr) which are, or may be, or may become, essential to the present document.

Foreword

This European Standard (Telecommunications series) has been produced by the Special Mobile Group (SMG) Technical Committee of the European Telecommunications Standards Institute (ETSI).

This EN describes the detailed mapping between input blocks of 160 speech samples in 13-bit uniform PCM format to encoded blocks of 244 bits and from encoded blocks of 244 bits to output blocks of 160 reconstructed speech samples within the digital cellular telecommunications system.

This EN corresponds to GSM technical specification, GSM 06.60, version 5.1.2.

National transposition dates

Date of adoption of this EN: 19 December 1997

Date of latest announcement of this EN (doa): 31 March 1998

Date of latest publication of new National Standard or endorsement of this EN (dop/e): 30 September 1998

Date of withdrawal of any conflicting National Standard (dow): 30 September 1998 GSM 06.60 version 4.0.1 5 EN 301 245 V4.0.1 (1997-12)

1 Scope

This EN describes the detailed mapping between input blocks of 160 speech samples in 13-bit uniform PCM format to encoded blocks of 244 bits and from encoded blocks of 244 bits to output blocks of 160 reconstructed speech samples. The sampling rate is 8 000 sample/s leading to a bit rate for the encoded bit stream of 12,2 kbit/s. The coding scheme is the so-called Algebraic Code Excited Linear Prediction Coder, hereafter referred to as ACELP.

This EN also specifies the conversion between A-law PCM and 13-bit uniform PCM. Performance requirements for the audio input and output parts are included only to the extent that they affect the transcoder performance. This part also describes the codec down to the bit level, thus enabling the verification of compliance to the part to a high degree of confidence by use of a set of digital test sequences. These test sequences are described in GSM 06.54 [7] and are available on disks.

In case of discrepancy between the requirements described in this EN and the fixed point computational description (ANSI-C code) of these requirements contained in GSM 06.53 [6], the description in GSM 06.53 [6] will prevail.

The transcoding procedure specified in this EN is applicable for the enhanced full rate speech traffic channel (TCH) in the GSM system.

In GSM 06.51 [5], a reference configuration for the speech transmission chain of the GSM enhanced full rate (EFR) system is shown. According to this reference configuration, the speech encoder takes its input as a 13-bit uniform PCM signal either from the audio part of the Mobile Station or on the network side, from the PSTN via an 8-bit/A-law to 13-bit uniform PCM conversion. The encoded speech at the output of the speech encoder is delivered to a channel encoder unit which is specified in GSM 05.03 [3]. In the receive direction, the inverse operations take place.

2 Normative references

This EN incorporates by dated and undated reference, provisions from other publications. These normative references are cited at the appropriate places in the text and the publications are listed hereafter. For dated references, subsequent amendments to or revisions of any of these publications apply to this EN only when incorporated in it by amendment or revision. For undated references, the latest edition of the publication referred to applies.

[1] GSM 01.04 (ETR 100): "Digital cellular telecommunications system (Phase 2); Abbreviations and acronyms".

[2] GSM 03.50 (ETS 300 540): "Digital cellular telecommunications system (Phase 2); Transmission planning aspects of the speech service in the GSM Public Land Mobile Network (PLMN) system".

[3] GSM 05.03 (ETS 300 575): "Digital cellular telecommunications system (Phase 2); Channel coding".

[4] GSM 06.32 (ETS 300 580-6): "Digital cellular telecommunications system (Phase 2); Voice Activity Detection (VAD)".

[5] GSM 06.51 (EN 301 243): "Digital cellular telecommunications system (Phase 2); Enhanced Full Rate (EFR) speech processing functions General description".

[6] GSM 06.53 (EN 301 244): "Digital cellular telecommunications system (Phase 2); ANSI-C code for the GSM Enhanced Full Rate (EFR) speech codec".

[7] GSM 06.54 (EN 301 250): "Digital cellular telecommunications system (Phase 2); Test vectors for the GSM Enhanced Full Rate (EFR) speech codec".

[8] ITU-T Recommendation G.711 (1988): "Coding of analogue signals by pulse code modulation Pulse code modulation (PCM) of voice frequencies".

[9] ITU-T Recommendation G.726: "40, 32, 24, 16 kbit/s adaptive differential pulse code modulation (ADPCM)". GSM 06.60 version 4.0.1 6 EN 301 245 V4.0.1 (1997-12)

3 Definitions, symbols and abbreviations

3.1 Definitions

For the purposes of this EN, the following definitions apply:

adaptive codebook: The adaptive codebook contains excitation vectors that are adapted for every subframe. The adaptive codebook is derived from the long term filter state. The lag value can be viewed as an index into the adaptive codebook.

adaptive postfilter: This filter is applied to the output of the short term synthesis filter to enhance the perceptual quality of the reconstructed speech. In the GSM enhanced full rate codec, the adaptive postfilter is a cascade of two filters: a formant postfilter and a tilt compensation filter.

algebraic codebook: A fixed codebook where algebraic code is used to populate the excitation vectors (innovation vectors).The excitation contains a small number of nonzero pulses with predefined interlaced sets of positions.

closed-loop pitch analysis: This is the adaptive codebook search, i.e., a process of estimating the pitch (lag) value from the weighted input speech and the long term filter state. In the closed-loop search, the lag is searched using error minimization loop (analysis-by-synthesis). In the GSM enhanced full rate codec, closed-loop pitch search is performed for every subframe.

direct form coefficients: One of the formats for storing the short term filter parameters. In the GSM enhanced full rate codec, all filters which are used to modify speech samples use direct form coefficients.

fixed codebook: The fixed codebook contains excitation vectors for speech synthesis filters. The contents of the codebook are non-adaptive (i.e., fixed). In the GSM enhanced full rate codec, the fixed codebook is implemented using an algebraic codebook.

fractional lags: A set of lag values having sub-sample resolution. In the GSM enhanced full rate codec a sub-sample resolution of 1/6th of a sample is used.

frame: A time interval equal to 20 ms (160 samples at an 8 kHz sampling rate).

integer lags: A set of lag values having whole sample resolution.

interpolating filter: An FIR filter used to produce an estimate of sub-sample resolution samples, given an input sampled with integer sample resolution.

inverse filter: This filter removes the short term correlation from the speech signal. The filter models an inverse frequency response of the vocal tract.

lag: The long term filter delay. This is typically the true pitch period, or a multiple or sub-multiple of it.

Line Spectral Frequencies: (see Line Spectral Pair)

Line Spectral Pair: Transformation of LPC parameters. are obtained by decomposing the inverse filter transfer function A(z) to a set of two transfer functions, one having even symmetry and the other having odd symmetry. The Line Spectral Pairs (also called as Line Spectral Frequencies) are the roots of these polynomials on the z-unit circle).

LP analysis window: For each frame, the short term filter coefficients are computed using the high pass filtered speech samples within the analysis window. In the GSM enhanced full rate codec, the length of the analysis window is 240 samples. For each frame, two asymmetric windows are used to generate two sets of LP coefficients. No samples of the future frames are used (no lookahead).

LP coefficients: Linear Prediction (LP) coefficients (also referred as (LPC) coefficients) is a generic descriptive term for describing the short term filter coefficients. GSM 06.60 version 4.0.1 7 EN 301 245 V4.0.1 (1997-12)

open-loop pitch search: A process of estimating the near optimal lag directly from the weighted speech input. This is done to simplify the pitch analysis and confine the closed-loop pitch search to a small number of lags around the open-loop estimated lags. In the GSM enhanced full rate codec, open-loop pitch search is performed every 10 ms.

residual: The output signal resulting from an inverse filtering operation.

short term synthesis filter: This filter introduces, into the excitation signal, short term correlation which models the impulse response of the vocal tract.

perceptual weighting filter: This filter is employed in the analysis-by-synthesis search of the codebooks. The filter exploits the noise masking properties of the formants (vocal tract resonances) by weighting the error less in regions near the formant frequencies and more in regions away from them.

subframe: A time interval equal to 5 ms (40 samples at an 8 kHz sampling rate).

vector quantization: A method of grouping several parameters into a vector and quantizing them simultaneously.

zero input response: The output of a filter due to past inputs, i.e. due to the present state of the filter, given that an input of zeros is applied.

zero state response:The output of a filter due to the present input, given that no past inputs have been applied, i.e., given the state information in the filter is all zeroes.

3.2 Symbols

For the purposes of this EN, the following symbols apply:

Az() The inverse filter with unquantized coefficients  Az() The inverse filter with quantified coefficients

()= 1 Hz  Az() The speech synthesis filter with quantified coefficients

ai The unquantized linear prediction parameters (direct form coefficients)  ai The quantified linear prediction parameters

m The order of the LP model 1

Bz() The long-term synthesis filter

Wz() The perceptual weighting filter (unquantized coefficients) γγ 12, The perceptual weighting factors

FzE() Adaptive pre-filter

T The nearest integer pitch lag to the closed-loop fractional pitch lag of the subframe β The adaptive pre-filter coefficient (the quantified pitch gain)  γ =Az(/n ) Hzf()  Az(/γ ) d The formant postfilter GSM 06.60 version 4.0.1 8 EN 301 245 V4.0.1 (1997-12)

γ n Control coefficient for the amount of the formant post-filtering γ d Control coefficient for the amount of the formant post-filtering

Hz() t Tilt compensation filter γ t Control coefficient for the amount of the tilt compensation filtering

µγ=k' t1 A tilt factor, with k1' being the first reflection coefficient hn() f The truncated impulse response of the formant postfilter

L hnf() h The length of

ri() hn() h The auto-correlations of f  Az(/γ ) n The inverse filter (numerator) part of the formant postfilter  1 / Az(/γ ) d The synthesis filter (denominator) part of the formant postfilter   Az(/γ ) rn() The residual signal of the inverse filter n hz() t Impulse response of the tilt compensation filter β ()n sc The AGC-controlled gain scaling factor of the adaptive postfilter α The AGC factor of the adaptive postfilter

Hzh1() Pre-processing high-pass filter

wnI(), wnII () LP analysis windows

()I wnI() L1 Length of the first part of the LP analysis window

()I wnI() L2 Length of the second part of the LP analysis window

()II wnII () L1 Length of the first part of the LP analysis window

()II wnII () L2 Length of the second part of the LP analysis window rk() ac The auto-correlations of the windowed speech sn'( )

wi() lag Lag window for the auto-correlations (60 Hz bandwidth expansion) f 0 The bandwidth expansion in Hz

fs The sampling frequency in Hz rk'() ac The modified (bandwidth expanded) auto-correlations GSM 06.60 version 4.0.1 9 EN 301 245 V4.0.1 (1997-12)

() EiLD The prediction error in the ith iteration of the Levinson algorithm k i The ith reflection coefficient

a()i j The jth direct form coefficient in the ith iteration of the Levinson algorithm

' Fz1() Symmetric LSF polynomial

' Fz2() Antisymmetric LSF polynomial ′ Fz() =− Fz1() Polynomial 1 with root z 1 eliminated ′() Fz2 z = 1 Fz2() Polynomial with root eliminated q i The line spectral pairs (LSPs) in the cosine domain

q An LSP vector in the cosine domain

q ()n i The quantified LSP vector at the ith subframe of the frame n ω i The line spectral frequencies (LSFs)

Txm() A m th order Chebyshev polynomial

fi12(), fi () The coefficients of the polynomials Fz1()and Fz2()

'' ′() ′() fifi12(), () The coefficients of the polynomials Fz1 and Fz2

fi() The coefficients of either Fz1() or Fz2()

Cx() Sum polynomial of the Chebyshev polynomials ω x Cosine of angular frequency λ k Recursion coefficients for the Chebyshev polynomial evaluation f i The line spectral frequencies (LSFs) in Hz

ft=[]ff f 12 10The vector representation of the LSFs in Hz

()1 ()2 z ()n,z ()n The mean-removed LSF vectors at frame n

()1 ()2 r ()n, r ()n The LSF prediction residual vectors at frame n

p()n The predicted LSF vector at frame n

()2 − r ()n1 The quantified second residual vector at the past frame GSM 06.60 version 4.0.1 10 EN 301 245 V4.0.1 (1997-12)

k f The quantified LSF vector at quantization index k E LSP The LSP quantization error = wii,,,,110LSP-quantization weighting factors d f f i The distance between the line spectral frequencies i+1 and i−1

hn() The impulse response of the weighted synthesis filter O k The correlation maximum of open-loop pitch analysis at delay k

Oi,,,=13 ti,,,=13 ti The correlation maxima at delays i

()Mt,, i=13 ,, M ti,,,=13 ii The normalized correlation maxima i and the corresponding delays i Az(/γ ) HzWz() ()= 1 AzAz() ( /γ ) 2 The weighted synthesis filter γ Az(/1 ) The numerator of the perceptual weighting filter γ 1/(/Az 2 )The denominator of the perceptual weighting filter

T1 The nearest integer to the fractional pitch lag of the previous (1st or 3rd) subframe

sn'( ) The windowed speech signal

snw() The weighted speech signal  sn() Reconstructed speech signal ′ sn() The gain-scaled post-filtered signal  snf() Post-filtered speech signal (before scaling)

xn() The target signal for adaptive codebook search

t x2 xn2(), The target signal for algebraic codebook search

resLP () n The LP residual signal

cn() The fixed codebook vector

vn() The adaptive codebook vector ∗ yn()=() vn hn () The filtered adaptive codebook vector yn() k The past filtered excitation

un() The excitation signal GSM 06.60 version 4.0.1 11 EN 301 245 V4.0.1 (1997-12)

() un The emphasized adaptive codebook vector  un'( ) The gain-scaled emphasized excitation signal T op The best open-loop lag

tmin Minimum lag search value

tmax Maximum lag search value Rk() Correlation term to be maximized in the adaptive codebook search Rk() b24 The FIR filter for interpolating the normalized correlation term

Rk() Rk() t The interpolated value of for the integer delay k and fraction t b 60 The FIR filter for interpolating the past excitation signal un() to yield the adaptive codebook vector vn() A k Correlation term to be maximized in the algebraic codebook search at index k C A k The correlation in the numerator of k at index k E A Dk The energy in the denominator of k at index k

dHx=t xn() hn() 2 The correlation between the target signal 2 and the impulse response , i.e., backward filtered target h()0 H The lower triangular Toepliz convolution matrix with diagonal and lower diagonals hh()139,, ( )

Φ= t hn() HH The matrix of correlations of

dn() The elements of the vector d φ (,ij ) The elements of the symmetric matrix Φ

c k The innovation vector A C The correlation in the numerator of k

mi The position of the i th pulse ϑ i The amplitude of the i th pulse N p The number of pulses in the fixed codebook excitation A ED The energy in the denominator of k GSM 06.60 version 4.0.1 12 EN 301 245 V4.0.1 (1997-12)

() resLTP n The normalized long-term prediction residual dn() bn() The sum of the normalized vector and normalized long-term prediction residual () resLTP n sn() b The sign signal for the algebraic codebook search

' dn() Sign extended backward filtered target φ' (,ij ) The modified elements of the matrix Φ , including sign information

t () z , zn The fixed codebook vector convolved with hn()

En() The mean-removed innovation energy (in dB)

E The mean of the innovation energy ~ En() The predicted energy

[]bb bb 1234 The MA prediction coefficients  Rk() The quantified prediction error at subframe k

EI The mean innovation energy

Rn() The prediction error of the fixed-codebook gain quantization E Q The quantization error of the fixed-codebook gain quantization  en() The states of the synthesis filter 1/ Az()

enw() The perceptually weighted error of the analysis-by-synthesis search η The gain scaling factor for the emphasized excitation g c The fixed-codebook gain

' gc The predicted fixed-codebook gain  gc The quantified fixed codebook gain

g p The adaptive codebook gain g p The quantified adaptive codebook gain

γ =gg/' ' gc c c A correction factor between the gain gc and the estimated one gc γ γ gc The optimum value for gc GSM 06.60 version 4.0.1 13 EN 301 245 V4.0.1 (1997-12)

γ sc Gain scaling factor

3.3 Abbreviations

For the purposes of this EN, the following abbreviations apply. Further GSM related abbreviations may be found in GSM 01.04 [1].

ACELP Algebraic Code Excited Linear Prediction AGC Adaptive Gain Control CELP Code Excited Linear Prediction FIR Finite Impulse Response ISPP Interleaved Single-Pulse Permutation LP Linear Prediction LPC Linear Predictive Coding LSF Line Spectral Frequency LSP Line Spectral Pair LTP Long Term Predictor (or Long Term Prediction) MA Moving Average

4 Outline description

This EN is structured as follows:

Section 4.1 contains a functional description of the audio parts including the A/D and D/A functions. Section 4.2 describes the conversion between 13-bit uniform and 8-bit A-law samples. Sections 4.3 and 4.4 present a simplified description of the principles of the GSM EFR encoding and decoding process respectively. In subclause 4.5, the sequence and subjective importance of encoded parameters are given.

Section 5 presents the functional description of the GSM EFR encoding, whereas clause 6 describes the decoding procedures. Section 7 describes variables, constants and tables of the C-code of the GSM EFR codec.

4.1 Functional description of audio parts

The analogue-to-digital and digital-to-analogue conversion will in principle comprise the following elements:

1) Analogue to uniform digital PCM

− microphone;

− input level adjustment device;

− input anti-aliasing filter;

− sample-hold device sampling at 8 kHz;

− analogue−to−uniform digital conversion to 13−bit representation.

The uniform format shall be represented in two's complement.

2) Uniform digital PCM to analogue

− conversion from 13−bit/8 kHz uniform PCM to analogue;

− a hold device;

− reconstruction filter including x/sin( x ) correction;

− output level adjustment device; GSM 06.60 version 4.0.1 14 EN 301 245 V4.0.1 (1997-12)

− earphone or loudspeaker.

In the terminal equipment, the A/D function may be achieved either

− by direct conversion to 13-bit uniform PCM format;

− or by conversion to 8-bit/A-law compounded format, based on a standard A-law codec/filter according to ITU-T Recommendations G.711 [8] and G.714, followed by the 8-bit to 13-bit conversion as specified in subclause 4.2.1.

For the D/A operation, the inverse operations take place.

In the latter case it should be noted that the specifications in ITU-T G.714 (superseded by G.712) are concerned with PCM equipment located in the central parts of the network. When used in the terminal equipment, this EN does not on its own ensure sufficient out-of-band attenuation. The specification of out-of-band signals is defined in GSM 03.50 [2] in clause 2.

4.2 Preparation of speech samples

The encoder is fed with data comprising of samples with a resolution of 13 bits left justified in a 16-bit word. The three least significant bits are set to '0'. The decoder outputs data in the same format. Outside the speech codec further processing must be applied if the traffic data occurs in a different representation.

4.2.1 PCM format conversion

The conversion between 8-bit A-Law compressed data and linear data with 13-bit resolution at the speech encoder input shall be as defined in ITU-T Rec. G.711 [8].

ITU-T Rec. G.711 [8] specifies the A-Law to linear conversion and vice versa by providing table entries. Examples on how to perform the conversion by fixed-point arithmetic can be found in ITU-T Rec. G.726 [9]. Section 4.2.1 of G.726 [9] describes A-Law to linear expansion and subclause 4.2.7 of G.726 [9] provides a solution for linear to A-Law compression.

4.3 Principles of the GSM enhanced full rate speech encoder

The codec is based on the code-excited linear predictive (CELP) coding model. A 10th order linear prediction (LP), or short-term, synthesis filter is used which is given by:

==11 Hz()  , Az() +m  −i 1∑=azi i 1 (1)  =  = where aii,,,,1 m are the (quantified) linear prediction (LP) parameters, and m 10 is the predictor order. The long-term, or pitch, synthesis filter is given by: 11 = , Bz() 1− gz−T p (2) where T is the pitch delay and g p is the pitch gain. The pitch synthesis filter is implemented using the so-called adaptive codebook approach.

The CELP speech synthesis model is shown in figure 2. In this model, the excitation signal at the input of the short-term LP synthesis filter is constructed by adding two excitation vectors from adaptive and fixed (innovative) codebooks. The speech is synthesized by feeding the two properly chosen vectors from these codebooks through the short-term synthesis filter. The optimum excitation sequence in a codebook is chosen using an analysis-by-synthesis search procedure in which the error between the original and synthesized speech is minimized according to a perceptually weighted distortion measure. GSM 06.60 version 4.0.1 15 EN 301 245 V4.0.1 (1997-12)

The perceptual weighting filter used in the analysis-by-synthesis search technique is given by: Az(/γ ) Wz()= 1, Az(/γ ) 2 (3) Az() <<≤γγ where is the unquantized LP filter and 0121 are the perceptual weighting factors. The values γ = γ = 1 09. and 2 06. are used. The weighting filter uses the unquantized LP parameters while the formant synthesis filter uses the quantified ones.

The coder operates on speech frames of 20 ms corresponding to 160 samples at the sampling frequency of 8 000 sample/s. At each 160 speech samples, the speech signal is analysed to extract the parameters of the CELP model (LP filter coefficients, adaptive and fixed codebooks' indices and gains). These parameters are encoded and transmitted. At the decoder, these parameters are decoded and speech is synthesized by filtering the reconstructed excitation signal through the LP synthesis filter.

The signal flow at the encoder is shown in figure 3. LP analysis is performed twice per frame. The two sets of LP parameters are converted to line spectrum pairs (LSP) and jointly quantified using split matrix quantization (SMQ) with 38 bits. The speech frame is divided into 4 subframes of 5 ms each (40 samples). The adaptive and fixed codebook parameters are transmitted every subframe. The two sets of quantified and unquantized LP filters are used for the second and fourth subframes while in the first and third subframes interpolated LP filters are used (both quantified and unquantized). An open-loop pitch lag is estimated twice per frame (every 10 ms) based on the perceptually weighted speech signal.

Then the following operations are repeated for each subframe:

The target signal xn() is computed by filtering the LP residual through the weighted synthesis filter WzHz()() with the initial states of the filters having been updated by filtering the error between LP residual and excitation (this is equivalent to the common approach of subtracting the zero input response of the weighted synthesis filter from the weighted speech signal).

The impulse response, hn() of the weighted synthesis filter is computed.

Closed-loop pitch analysis is then performed (to find the pitch lag and gain), using the target xn() and impulse response hn(), by searching around the open-loop pitch lag. Fractional pitch with 1/6th of a sample resolution is used. The pitch lag is encoded with 9 bits in the first and third subframes and relatively encoded with 6 bits in the second and fourth subframes.

The target signal xn() is updated by removing the adaptive codebook contribution (filtered adaptive

codevector), and this new target, xn2(), is used in the fixed algebraic codebook search (to find the optimum innovation). An algebraic codebook with 35 bits is used for the innovative excitation.

The gains of the adaptive and fixed codebook are scalar quantified with 4 and 5 bits respectively (with moving average (MA) prediction applied to the fixed codebook gain).

Finally, the filter memories are updated (using the determined excitation signal) for finding the target signal in the next subframe.

The bit allocation of the codec is shown in table 1. In each 20 ms speech frame, 244 bits are produced, corresponding to a bit rate of 12.2 kbit/s. More detailed bit allocation is available in table 6. Note that the most significant bits (MSB) are always sent first. GSM 06.60 version 4.0.1 16 EN 301 245 V4.0.1 (1997-12)

Table 1: Bit allocation of the 12.2 kbit/s coding algorithm for 20 ms frame

Parameter 1st & 3rd subframes 2nd & 4th subframes total per frame

2 LSP sets 38

Pitch delay 9 6 30 Pitch gain 4 4 16 Algebraic code 35 35 140 Codebook gain 5 5 20 Total 244

4.4 Principles of the GSM enhanced full rate speech decoder

The signal flow at the decoder is shown in figure 4. At the decoder, the transmitted indices are extracted from the received bitstream. The indices are decoded to obtain the coder parameters at each transmission frame. These parameters are the two LSP vectors, the 4 fractional pitch lags, the 4 innovative codevectors, and the 4 sets of pitch and innovative gains. The LSP vectors are converted to the LP filter coefficients and interpolated to obtain LP filters at each subframe. Then, at each 40-sample subframe:

- the excitation is constructed by adding the adaptive and innovative codevectors scaled by their respective gains;

- the speech is reconstructed by filtering the excitation through the LP synthesis filter.

Finally, the reconstructed speech signal is passed through an adaptive postfilter.

4.5 Sequence and subjective importance of encoded parameters

The encoder will produce the output information in a unique sequence and format, and the decoder must receive the same information in the same way. In table 6, the sequence of output bits s1 to s244 and the bit allocation for each parameter is shown.

The different parameters of the encoded speech and their individual bits have unequal importance with respect to subjective quality. Before being submitted to the channel encoding function the bits have to be rearranged in the sequence of importance as given in table6 in 05.03 [3].

5 Functional description of the encoder

In this clause, the different functions of the encoder represented in figure 3 are described.

5.1 Pre-processing

Two pre-processing functions are applied prior to the encoding process: high-pass filtering and signal down-scaling.

Down-scaling consists of dividing the input by a factor of 2 to reduce the possibility of overflows in the fixed-point implementation.

The high-pass filter serves as a precaution against undesired low frequency components. A filter with a cut off frequency of 80 Hz is used, and it is given by: −+−−12 =0.. 92727435 18544941zz 0 . 92727435 Hzh1() −−12. 1−+ 19059465..zz 0 9114024 (4)

Down-scaling and high-pass filtering are combined by dividing the coefficients at the numerator of Hzh1() by 2. GSM 06.60 version 4.0.1 17 EN 301 245 V4.0.1 (1997-12)

5.2 Linear prediction analysis and quantization

Short-term prediction, or linear prediction (LP), analysis is performed twice per speech frame using the auto-correlation approach with 30 ms asymmetric windows. No lookahead is used in the auto-correlation computation.

The auto-correlations of windowed speech are converted to the LP coefficients using the Levinson-Durbin algorithm. Then the LP coefficients are transformed to the Line Spectral Pair (LSP) domain for quantization and interpolation purposes. The interpolated quantified and unquantized filter coefficients are converted back to the LP filter coefficients (to construct the synthesis and weighting filters at each subframe).

5.2.1 Windowing and auto-correlation computation

LP analysis is performed twice per frame using two different asymmetric windows. The first window has its weight concentrated at the second subframe and it consists of two halves of Hamming windows with different sizes. The window is given by:

  πn  054.− 0 .46cos  , nL=−01 , ,()I ,  L()I−1 1 wn()= 1 I π −()I +()nL1 =+−()III () () 054. 0 .46 cos  ,,,. nL112 L L 1 L()I−1  2 (5) ()I = ()I = The values L1 160 and L2 80 are used. The second window has its weight concentrated at the fourth subframe and it consists of two parts: the first part is half a Hamming window and the second part is a quarter of a cosine function cycle. The window is given by:

(6) ()II = ()II = where the values L1 232 and L2 8 are used.

Note that both LP analyses are performed on the same set of speech samples. The windows are applied to 80 samples from past speech frame in addition to the 160 samples of the present speech frame. No samples from future frames are used (no lookahead). A diagram of the two LP analysis windows is depicted below. w (n) w (n) I II

t

frame n-1 frame n 5 ms 20 ms frame (160 samples) sub frame (40 samples) GSM 06.60 version 4.0.1 18 EN 301 245 V4.0.1 (1997-12)

Figure 1: LP analysis windows

The auto-correlations of the windowed speech snn'( ),=0 , , 239 , are computed by:

239 =−= rkac ()∑ snsnk '()'( ), k 010 , , , nk= (7) and a 60 Hz bandwidth expansion is used by lag windowing the auto-correlations using the window:

 2 1 2πfi wi()=−exp0 , i=110 , , , lag   2 fs  (8) = = where f0 60 Hz is the bandwidth expansion and f s 8000 Hz is the sampling frequency. Further, rac ()0 is multiplied by the white noise correction factor 1.0001 which is equivalent to adding a noise floor at -40 dB.

5.2.2 Levinson-Durbin algorithm = == The modified auto-correlations rr'()ac0 1 . 0001 ac () 0 and rkrkwkk'()ac ac () lag (), 110 , , are used to = obtain the direct form LP filter coefficients akk,,,,110 by solving the set of equations.

10 ()−=− = ∑ark ''(),,,.ac i k rac i i 110 k=1 (9)

The set of equations in (9) is solved using the Levinson-Durbin algorithm. This algorithm uses the following recursion: = ErLD()00 ac '() for i=110 to do ()i −1= a01 i−1− karijEi=−∑ ()i 1'( − ) / ( −1 ) i []j =0j ac LD ()i = aki i for ji=−11 to do ()()i =+i−11 ()i− aaj j kai ij− end =−2 − EiLD() (11 kEi i ) LD ( ) end

==()10  The final solution is given as aajj,,, j110.

The LP filter coefficients are converted to the line spectral pair (LSP) representation for quantization and interpolation purposes. The conversions to the LSP domain and back to the LP filter coefficient domain are described in the next clause.

5.2.3 LP to LSP conversion = The LP filter coefficients akk,,,110, are converted to the line spectral pair (LSP) representation for quantization and interpolation purposes. For a 10th order LP filter, the LSPs are defined as the roots of the sum and difference polynomials:

' =+−−11 1 Fz1() Az () z Az ( ) (10) GSM 06.60 version 4.0.1 19 EN 301 245 V4.0.1 (1997-12) and

' =−−−11 1 Fz2() Az () z Az ( ), (11)

' ' respectively. The polynomial Fz1() and Fz2() are symmetric and anti-symmetric, respectively. It can be proven ' that all roots of these polynomials are on the unit circle and they alternate each other. Fz1() has a root =−ωπ = ' ==ω z 1() and Fz2() has a root z 10(). To eliminate these two roots, we define the new polynomials:

=+' −1 Fz11() Fz ()/(1 z ) (12) and

=−' −1 Fz22() Fz ()/(1 z ). (13)

±ωj Each polynomial has 5 conjugate roots on the unit circle ()ei, therefore, the polynomials can be written as

=−+−−12 Fz1() ∏()12 qzi z = i13,, , 9 (14) and

=−+−−12 Fz2() ∏()12 qzi z = i24,, , 10 , (15)

=()ω ω where qiicos with i being the line spectral frequencies (LSF) and they satisfy the ordering property <<<<<ωω ω π 0 12 10. We refer to q i as the LSPs in the cosine domain.

Since both polynomials Fz1() and Fz2() are symmetric only the first 5 coefficients of each polynomial need to be computed. The coefficients of these polynomials are found by the recursive relations (for i =0 to 4): += + − fi111()1 aimi+− a fi (), += − + fi212()1 aimi+− a fi () , (16) where m = 10 is the predictor order.

The LSPs are found by evaluating the polynomials Fz1() and Fz2() at 60 points equally spaced between 0 and π and checking for sign changes. A sign change signifies the existence of a root and the sign change interval is then divided 4 times to better track the root. The Chebyshev polynomials are used to evaluate Fz1() and Fz2(). In this {} method the roots are found directly in the cosine domain qi . The polynomials Fz1() or Fz2() evaluated at jω ze= can be written as:

FeCx()ω=2−j5ω (), with: =+ + + + + CxTxfTxfTxfTxfTxf()54 () ()()123452 ()() 3 ()() 2 ()() 1 ()/ , (17) GSM 06.60 version 4.0.1 20 EN 301 245 V4.0.1 (1997-12)

=ω =  where Txm() cos( m ) is the m th order Chebyshev polynomial, and fi(), i 15 , ,, are the coefficients of Cx() either Fz1() or Fz2(), computed using the equations in (16). The polynomial is evaluated at a certain value = ω of x cos( ) using the recursive relation: for k =41 down to λλλ= −+− kkk25xfk++12() end =−+λλ Cx() x12 f ()/,52 λ = 1 λ = 0. with initial values 5 and 6 The details of the Chebyshev polynomial evaluation method are found in P. Kabal and R.P. Ramachandran [6].

5.2.4 LSP to LP conversion {} Once the LSPs are quantified and interpolated, they are converted back to the LP coefficient domain ak . The conversion to the LP domain is done as follows. The coefficients of Fz1() or Fz2() are found by expanding  equations (14) and (15) knowing the quantified and interpolated LSPs qii, = 110, , . The following recursive relation is used to compute fi1(): for i =15 to =− − + − fi12111()2122 qi− fi ( ) fi ( ) for ji=−11 down to =− −+− fj11() fj ()212 q 2111i− fj ( ) fj ( ) end end f()01= f()−=10 fi() with initial values 1 and 1 . The coefficients 2 are computed similarly by replacing q21i− by q2i .

+ −1 − −1 Once the coefficients fi1() and fi2() are found, Fz1() and Fz2() are multiplied by 1 z and 1 z , ' ' respectively, to obtain Fz1() and Fz2(); that is:

'=+−= fi111() fi () fi (115 ), i , ,, ' =−− 115 = fi222() fi () fi ( ), i , ,. (18)

Finally the LP coefficients are found by:

 ''+= =05.().(),fi12 05 fi i 1 ,,, 5 ai 0.( 5fifii'' 11−− ).( 0 5 11 − ), = 6 ,,. 10 12 (19)

=+'' Az()() F12 () z F ()/ z 2 ' This is directly derived from the relation , and considering the fact that Fz1() and ' Fz2() are symmetric and anti-symmetric polynomials, respectively. GSM 06.60 version 4.0.1 21 EN 301 245 V4.0.1 (1997-12)

5.2.5 Quantization of the LSP coefficients

The two sets of LP filter coefficients per frame are quantified using the LSP representation in the frequency domain; that is:

==fs  fiarccos()qii ,110 , , , 2π (20) = where fi are the line spectral frequencies (LSF) in Hz [0,4000] and fs 8000 is the sampling frequency. The LSF ft=[]ff f vector is given by 12 10, with t denoting transpose.

A 1st order MA prediction is applied, and the two residual LSF vectors are jointly quantified using split matrix ()1 ()2 quantization (SMQ). The prediction and quantization are performed as follows. Let z ()n and z ()n denote the ()1 ()2 mean-removed LSF vectors at frame n . The prediction residual vectors r ()n and r ()n are given by:

rzp()11()nnn=− () () (), and ()22=− () rzp()nnn () (), (21) where p()n is the predicted LSF vector at frame n . First order moving-average (MA) prediction is used where:

pr()nn=−065 . ()2 () 1 (22)

()2 − where r ()n1 is the quantified second residual vector at the past frame.

()1 ()2 The two LSF residual vectors r and r are jointly quantified using split matrix quantization (SMQ). The matrix ()rr()(12 ) is split into 5 submatrices of dimension 2 x 2 (two elements from each vector). For example, the first ()1 ()1 (2 ) ()2 submatrix consists of the elements rr1,,2 r1, and r2 . The 5 submatrices are quantified with 7, 8, 8+1, 8, and 6 bits, respectively. The third submatrix uses a 256-entry signed codebook (8-bit index plus 1-bit sign).

A weighted LSP distortion measure is used in the quantization process. In general, for an input LSP vector f and a k quantified vector at index k , f , the quantization is performed by finding the index k which minimizes:

10 2 =−k EfwfwLSP∑[] i i i i . = i 1 (23) = The weighting factors wii,,,110, are given by 1547. wdd=−3347. for <450, iii450 =−08. − 18. ()450 diotherwise, 1050 (24) =− = = where dfii+−11 f i with f0 0 and f11 4000 . Here, two sets of weighting coefficients are computed for the two LSF vectors. In the quantization of each submatrix, two weighting coefficients from each set are used with their corresponding LSFs. GSM 06.60 version 4.0.1 22 EN 301 245 V4.0.1 (1997-12)

5.2.6 Interpolation of the LSPs

The two sets of quantified (and unquantized) LP parameters are used for the second and fourth subframes whereas the first and third subframes use a linear interpolation of the parameters in the adjacent subframes. The interpolation is q()n performed on the LSPs in the q domain. Let 4 be the LSP vector at the 4th subframe of the present frame n , − q()n q()n1 2 be the LSP vector at the 2nd subframe of the present frame n , and 4 the LSP vector at the 4th subframe − of the past frame n 1. The interpolated LSP vectors at the 1st and 3rd subframes are given by:

()nn=+ (−1 ) () n qq1405. 05. q2, qqq()nnn=+05.  () 05.  (). 324 (25)

The interpolated LSP vectors are used to compute a different LP filter at each subframe (both quantified and unquantized coefficients) using the LSP to LP conversion method described in subclause 5.2.4.

5.3 Open-loop pitch analysis

Open-loop pitch analysis is performed twice per frame (each 10 ms) to find two estimates of the pitch lag in each frame. This is done in order to simplify the pitch analysis and confine the closed-loop pitch search to a small number of lags around the open-loop estimated lags.

Open-loop pitch estimation is based on the weighted speech signal snw() which is obtained by filtering the input Az(/γ ) Wz()= 1 Az(/γ ) speech signal through the weighting filter 2. That is, in a subframe of size L , the weighted speech is given by:

10 10 =+γγi −−i − = − swi()() n sn∑∑ a1 sni () ai2 sw (),,,. ni n01 L == i1 i1 (26)

Open-loop pitch analysis is performed as follows. In the first step, 3 maxima of the correlation:

79 =− Osnsnkk∑ww() ( ) = n0 (27) are found in the three ranges: i = 3: 18,,, 35 i = 2: 36,,, 71 i =1: 72,, 143 .

2−= Oi,,,=13 ∑sntiwi(),1, ,3 The retained maxima ti , are normalized by dividing by n , respectively. The ()Mt,, i=13 ,, Top normalized maxima and corresponding delays are denoted by ii . The winner, , among the three normalized correlations is selected by favouring the delays with the values in the lower range. This is performed by Top weighting the normalized correlations corresponding to the longer delays. The best open-loop delay is determined as follows: GSM 06.60 version 4.0.1 23 EN 301 245 V4.0.1 (1997-12)

= Ttop 1 = MT()op M1 > if M2 085. M() Top = MT()op M2 = Ttop 2 end > if M3 085. M() Top = MT()op M3 = Ttop 3 end

This procedure of dividing the delay range into 3 clauses and favouring the lower clauses is used to avoid choosing pitch multiples.

5.4 Impulse response computation

=γ γ HzWz()() Az (/12 )/[] Az()(/ Az ) The impulse response, hn(), of the weighted synthesis filter is computed each subframe. This impulse response is needed for the search of adaptive and fixed codebooks. The impulse γ response hn() is computed by filtering the vector of coefficients of the filter Az(/1 ) extended by zeros through  γ the two filters 1/ Az() and 1/(/Az 2 ).

5.5 Target signal computation

The target signal for adaptive codebook search is usually computed by subtracting the zero input response of the =γ γ HzWz()() Az (/12 )/[] Az()(/ Az ) weighted synthesis filter from the weighted speech signal snw(). This is performed on a subframe basis.

An equivalent procedure for computing the target signal, which is used in this standard, is the filtering of the LP residual  signal resLP () n through the combination of synthesis filter 1/ Az() and the weighting filter γγ Az(/12 )/(/ Az ). After determining the excitation for the subframe, the initial states of these filters are updated by filtering the difference between the LP residual and excitation. The memory update of these filters is explained in subclause 5.9.

The residual signal resLP () n which is needed for finding the target vector is also used in the adaptive codebook search to extend the past excitation buffer. This simplifies the adaptive codebook search procedure for delays less than the subframe size of 40 as will be explained in the next clause. The LP residual is given by:

10 =+ − resLP() n s () n∑ a i s(). n i = i 1 (28)

5.6 Adaptive codebook search

Adaptive codebook search is performed on a subframe basis. It consists of performing closed-loop pitch search, and then computing the adaptive codevector by interpolating the past excitation at the selected fractional pitch lag. GSM 06.60 version 4.0.1 24 EN 301 245 V4.0.1 (1997-12)

The adaptive codebook parameters (or pitch parameters) are the delay and gain of the pitch filter. In the adaptive codebook approach for implementing the pitch filter, the excitation is repeated for delays less than the subframe length. In the search stage, the excitation is extended by the LP residual to simplify the closed-loop search.

3 3 []17, 94 In the first and third subframes, a fractional pitch delay is used with resolutions: 1/6 in the range 6 6 and integers only in the range [95, 143]. For the second and fourth subframes, a pitch resolution of 1/6 is always used in the −+3 3 []TT154,1 range 6 6, where T1 is nearest integer to the fractional pitch lag of the previous (1st or 3rd) subframe, bounded by 18...143.

Closed-loop pitch analysis is performed around the open-loop pitch estimates on a subframe basis. In the first (and third) T ±3 subframe the range op , bounded by 18...143, is searched. For the other subframes, closed-loop pitch analysis is performed around the integer pitch selected in the previous subframe, as described above. The pitch delay is encoded with 9 bits in the first and third subframes and the relative delay of the other subframes is encoded with 6 bits.

The closed-loop pitch search is performed by minimizing the mean-square weighted error between the original and synthesized speech. This is achieved by maximizing the term:

39 ∑=xny()k () n Rk()=n0 , 39 ∑=ynynkk() () n0 (29) where xn() is the target signal and ynk() is the past filtered excitation at delay k (past excitation convolved with hn()). Note that the search range is limited around the open-loop pitch as explained earlier. yn() The convolution k is computed for the first delay tmin in the searched range, and for the other delays in the search kt=+1,..., t range min max , it is updated using the recursive relation: =−+− ynkk() y−1 ( n1 ) ukhn ( )(), (30) =− +  where un(), n (143 11 ),, 39 , is the excitation buffer. Note that in search stage, the samples = un(), n 039 , , , are not known, and they are needed for pitch delays less than 40. To simplify the search, the LP residual is copied to un() in order to make the relation in equation (30) valid for all delays.

− 3 3 1 Once the optimum integer pitch delay is determined, the fractions from 6 to 6 with a step of 6 around that integer are tested. The fractional pitch search is performed by interpolating the normalized correlation in equation (29) and searching for its maximum. The interpolation is performed using an FIR filter b24 based on a Hamming windowed () ()= sin xx function truncated at ± 23 and padded with zeros at ± 24 ( b24 24 0 ). The filter has its cut-off frequency Rk() − 3 3 (-3 dB) at 3 600 Hz in the over-sampled domain. The interpolated values of for the fractions 6 to 6 are obtained using the interpolation formula:

3 3 ()=−()( +⋅+++−+⋅= ) ( )( )  Rkt ∑∑ Rk i b24 t i616605 Rk ib24 t i,,,, t ii==0 0 (31)

1 2 2 1 =  3 − − where t 05,,corresponds to the fractions 0, 6 , 6 , 6 , 6 , and 6 , respectively. Note that it is necessary to tt−+44,, compute the correlation terms in equation (29) using a range min max to allow for the proper interpolation. GSM 06.60 version 4.0.1 25 EN 301 245 V4.0.1 (1997-12)

Once the fractional pitch lag is determined, the adaptive codebook vector vn() is computed by interpolating the past excitation signal un() at the given integer delay k and phase (fraction) t :

9 9 ()=−−+⋅+−++−+⋅= = vn∑∑ un()()( k ib60 t i616603905 un k ib )()60 t i,,,,,,. n t ii==0 0 (32) b () The interpolation filter 60 is based on a Hamming windowed sin xx function truncated at ± 59 and padded with b()60= 0 zeros at ± 60 ( 60 ). The filter has a cut-off frequency (-3 dB) at 3 600 Hz in the over-sampled domain.

The adaptive codebook gain is then found by:

39 ∑xnyn()() g =≤≤n=0,.,bounded by 0 g 12 p 39 p ∑ynyn()() n=0 (33) =∗ where yn() vn () hn () is the filtered adaptive codebook vector (zero state response of HzWz()() to vn()).

The computed adaptive codebook gain is quantified using 4-bit non-uniform scalar quantization in the range [0.0,1.2].

5.7 Algebraic codebook structure and search

The algebraic codebook structure is based on interleaved single-pulse permutation (ISPP) design. In this codebook, the innovation vector contains 10 non-zero pulses. All pulses can have the amplitudes +1 or -1. The 40 positions in a subframe are divided into 5 tracks, where each track contains two pulses, as shown in table 2.

Table 2: Potential positions of individual pulses in the algebraic codebook.

Track Pulse positions 1i0, i5 0, 5, 10, 15, 20, 25, 30, 35 2i1, i6 1, 6, 11, 16, 21, 26, 31, 36 3i2, i7 2, 7, 12, 17, 22, 27, 32, 37 4i3, i8 3, 8, 13, 18, 23, 28, 33, 38 5i4, i9 4, 9, 14, 19, 24, 29, 34, 39

Each two pulse positions in one track are encoded with 6 bits (total of 30 bits, 3 bits for the position of every pulse), and the sign of the first pulse in the track is encoded with 1 bit (total of 5 bits).

For two pulses located in the same track, only one sign bit is needed. This sign bit indicates the sign of the first pulse. The sign of the second pulse depends on its position relative to the first pulse. If the position of the second pulse is smaller, then it has opposite sign, otherwise it has the same sign than in the first pulse.

All the 3-bit pulse positions are Gray coded in order to improve robustness against channel errors. This gives a total of 35 bits for the algebraic code.

The algebraic codebook is searched by minimizing the mean square error between the weighted input speech and the weighted synthesized speech. The target signal used in the closed-loop pitch search is updated by subtracting the adaptive codebook contribution. That is: =− = xn2() xngyn () (), n039 , ,, p (34) =∗ g where yn() vn () hn () is the filtered adaptive codebook vector and p is the quantified adaptive codebook gain. If ck is the algebraic codevector at index k , then the algebraic codebook is searched by maximizing the term: GSM 06.60 version 4.0.1 26 EN 301 245 V4.0.1 (1997-12)

2t 2 ()C ()dck A==k kE cctΦ Dk k k (35)

dHx=t xn() hn() where 2 is the correlation between the target signal 2 and the impulse response , H is a the lower h()0 hh()139,, ( ) Φ= t triangular Toepliz convolution matrix with diagonal and lower diagonals , and HH is hn() the matrix of correlations of . The vector d (backward filtered target) and the matrix Φ are computed prior to the codebook search. The elements of the vector d are computed by

39 =−= dn()∑ x2 ()( ihi n ), n 039 , ,, in= (36) and the elements of the symmetric matrix Φ are computed by:

39 φ(,ij )=−−≥∑ hn ( ihn )( j ),( j i ). = nj (37)

The algebraic structure of the codebooks allows for very fast search procedures since the innovation vector ck contains only a few nonzero pulses. The correlation in the numerator of Equation (35) is given by: − Np1 =ϑ Cdm∑ii() i=0 (38) ϑ m i N p where i is the position of the i th pulse, is its amplitude, and is the number of pulses (Np = 10 ). The energy in the denominator of equation (35) is given by: − − − Np 1 Np 2Np 1 =+φϑϑφ EmmDiiijij∑ (,)2∑ ∑ (, mm ). = = =+ i0 i0ji1 (39)

To simplify the search procedure, the pulse amplitudes are preset by the mere quantization of an appropriate signal. In this case the signal bn(), which is a sum of the normalized dn() vector and normalized long-term prediction residual () resLTP n : res() n dn() bn()=+=LTP ,,,,n 039 39 () () 39 () () ∑∑==resLTP i res LTP i didi ii0 0 (40) is used. This is simply done by setting the amplitude of a pulse at a certain position equal to the sign of bn() at that position. The simplification proceeds as follows (prior to the codebook search). First, the sign signal sn()=sign[] bn () dn'()= dnsn () () b and the signal b are computed. Second, the matrix Φ is modified by φφ'(,ij )= s () is ( j ) (, ij ) including the sign information; that is, bb . The correlation in equation (38) is now given by: − Np1 =' Cdm∑()i i=0 (41) GSM 06.60 version 4.0.1 27 EN 301 245 V4.0.1 (1997-12) and the energy in equation (39) is given by:

− − − Np 1 Np 2Np 1 =+φφ'' EmmmmDiiij∑ (,)2∑∑ (,). = = =+ i0 i0ji1 (42)

Having preset the pulse amplitudes, as explained above, the optimal pulse positions are determined using an efficient non-exhaustive analysis-by-synthesis search technique. In this technique, the term in equation (35) is tested for a small percentage of position combinations.

First, for each of the five tracks the pulse positions with maximum absolute values of bn() are searched. From these the global maximum value for all the pulse positions is selected. The first pulse i0 is always set into the position corresponding to the global maximum value.

Next, five iterations are carried out in which the position of pulse i1 is set to one of the five maxima in the track. The rest of the pulses are searched in pairs by sequentially searching each of the pulse pairs {i2,i3}, {i4,i5}, {i6,i7} and {i8,i9} in nested loops. Every pulse has 8 possible positions, i.e., there are four 8x8-loops, resulting in 256 different combinations of pulse positions for each iteration.

In each iteration all the 9 pulse starting positions are cyclically shifted, so that the pulse pairs are changed and the pulse i1 is placed in a local maximum of a different track. The rest of the pulses are searched also for the other positions in the tracks. At least one pulse is located in a position corresponding to the global maximum and one pulse is located in a position corresponding to one of the 5 local maxima.

A special feature incorporated in the codebook is that the selected codevector is filtered through an adaptive pre-filter FzE() which enhances special spectral components in order to improve the synthesized speech quality. Here the filter =−β−T FzE()11 ( z ) is used, where T is the nearest integer pitch lag to the closed-loop fractional pitch lag of the β β subframe, and is a pitch gain. In this standard, is given by the quantified pitch gain bounded by [0.0,1.0]. Note that prior to the codebook search, the impulse response hn() must include the pre-filter FzE(). That is, =+−β = hn() hn () hn ( T ), n T , ,39 .

The fixed codebook gain is then found by:

xzt g = 2 c t zz (43) where x2 is the target vector for fixed codebook search and z is the fixed codebook vector convolved with hn(),

n zn()=−=∑ ci () hn() i,,,. n 039 i=0 (44)

5.8 Quantization of the fixed codebook gain

The fixed codebook gain quantization is performed using MA prediction with fixed coefficients. The 4th order MA prediction is performed on the innovation energy as follows. Let En() be the mean-removed innovation energy (in dB) at subframe n , and given by:

 N−1 = 1 22− En()10log gciEc∑ () , N =  i0 (45) GSM 06.60 version 4.0.1 28 EN 301 245 V4.0.1 (1997-12)

= = where N 40 is the subframe size, ci() is the fixed codebook excitation, and E 36 dB is the mean of the innovation energy. The predicted energy is given by:

4 ~ =− En() ∑ bRni () i = i 1 , (46)

[][bb bb = 068058034019.... ]  where 1234 are the MA prediction coefficients, and Rk() is the quantified ' prediction error at subframe k . The predicted energy is used to compute a predicted fixed-codebook gain gc as in ~ ' equation (45) (by substituting En() by En() and gc by gc ). This is done as follows. First, the mean innovation energy is found by:

 N−1  = 1 2  EI 10 log ∑cj ( ) N j=0  (47)

' and then the predicted gain gc is found by:

~ +− g' =10005.(En() E EI ). c (48)

' A correction factor between the gain gc and the estimated one gc is given by:

γ =gg/' gc c c . (49)

Note that the prediction error is given by: ~ Rn()=−= En () En()20 log (γ ). gc (50) γ The correction factor gc is quantified using a 5-bit codebook. The quantization table search is performed by minimizing the error:

Eg=−( γ g').2 Qcgcc (51)

γ gg =γ ' Once the optimum value gc is chosen, the quantified fixed codebook gain is given by cgcc.

5.9 Memory update

An update of the states of the synthesis and weighting filters is needed in order to compute the target signal in the next subframe.

After the two gains are quantified, the excitation signal, un(), in the present subframe is found by: un()=+ g vn() gcn (), n =039 , ,, pc (52) g  where p and gc are the quantified adaptive and fixed codebook gains, respectively, vn() the adaptive codebook vector (interpolated past excitation), and cn() is the fixed codebook vector (algebraic code including pitch − sharpening). The states of the filters can be updated by filtering the signal resLP () n u () n (difference between GSM 06.60 version 4.0.1 29 EN 301 245 V4.0.1 (1997-12)

 γγ residual and excitation) through the filters 1 Az() and Az(/12 ) Az (/ ) for the 40-sample subframe and saving the states of the filters. This would require 3 filterings. A simpler approach which requires only one filtering is as   follows. The local synthesized speech, sn(), is computed by filtering the excitation signal through 1 Az(). The − =− output of the filter due to the input resLP () n u () n is equivalent to en() sn () sn(). So the states of the  =  γγ synthesis filter 1 Az() are given by en(), n 30 , , 39 . Updating the states of the filter Az(/12 ) Az (/ ) can be done by filtering the error signal en() through this filter to find the perceptually weighted error enw(). However, the signal enw() can be equivalently found by: en()=− xngyngzn ()  () − (). wpc (53)

Since the signals xn(),() yn, and zn() are available, the states of the weighting filter are updated by computing =  enw() as in equation (53) for n 30,, 39 . This saves two filterings.

6 Functional description of the decoder

The function of the decoder consists of decoding the transmitted parameters (LP parameters, adaptive codebook vector, adaptive codebook gain, fixed codebook vector, fixed codebook gain) and performing synthesis to obtain the reconstructed speech. The reconstructed speech is then post-filtered and upscaled. The signal flow at the decoder is shown in figure 4.

6.1 Decoding and speech synthesis

The decoding process is performed in the following order:

Decoding of LP filter parameters: The received indices of LSP quantization are used to reconstruct the two quantified LSP vectors. The interpolation described in subclause 5.2.6 is performed to obtain 4 interpolated LSP vectors (corresponding to 4 subframes). For each subframe, the interpolated LSP vector is converted to LP filter coefficient a domain k , which is used for synthesizing the reconstructed speech in the subframe.

The following steps are repeated for each subframe:

1) Decoding of the adaptive codebook vector: The received pitch index (adaptive codebook index) is used to find the integer and fractional parts of the pitch lag. The adaptive codebook vector vn() is found by interpolating the past excitation un() (at the pitch delay) using the FIR filter described in subclause 5.6.

2) Decoding of the adaptive codebook gain: The received index is used to readily find the quantified adaptive g codebook gain, p from the quantization table.

3) Decoding of the innovative codebook vector: The received algebraic codebook index is used to extract the positions and amplitudes (signs) of the excitation pulses and to find the algebraic codevector cn(). If the integer part of the pitch lag is less than the subframe size 40, the pitch sharpening procedure is applied which translates =+β − β g into modifying cn() by cn() cn () cn ( T ), where is the decoded pitch gain, p , bounded by [0.0,1.0].

4) Decoding of the fixed codebook gain: The received index gives the fixed codebook gain correction factor γ g′ gc . The estimated fixed codebook gain c is found as described in subclause 5.7. First, the predicted energy is found by: GSM 06.60 version 4.0.1 30 EN 301 245 V4.0.1 (1997-12)

4 ~ =− En() ∑ bRni () i = i 1 (54)

and then the mean innovation energy is found by:

 N−1  = 1 2  EI 10 log ∑cj ( ) N j=0  (55) g′ The predicted gain c is found by:

~ +− ' = 005.(En() E EI ) gc 10 . . (56)

The quantified fixed codebook gain is given by:

gg =γ ' cgcc (57)

5) Computing the reconstructed speech: The excitation at the input of the synthesis filter is given by: un()=+ gvn () gcn () pc (58)

Before the speech synthesis, a post-processing of excitation elements is performed. This means that the total excitation is modified by emphasizing the contribution of the adaptive codebook vector:

un()+>025 . β gvn (), g 05.  = pp un()   ≤ un(), gp05. (59)

Adaptive gain control (AGC) is used to compensate for the gain difference between the non-emphasized () () excitation un and emphasized excitation un The gain scaling factor η for the emphasized excitation is computed by:  >  39 2 gp 05.  ∑ un() n=0  39 , η= ∑ un2()  n=0   ≤  10. gp 05. (60)  The gain-scaled emphasized excitation signal un'( ) is given by:  =η un'( ) un() (61)

The reconstructed speech for the subframe of size 40 is given by:

10  =−  − = sn() u'( n ) ∑ asni (), i n 039 ,,. i=1 (62) a where i are the interpolated LP filter coefficients.  The synthesized speech sn() is then passed through an adaptive postfilter which is described in the following clause. GSM 06.60 version 4.0.1 31 EN 301 245 V4.0.1 (1997-12)

6.2 Post-processing

Post-processing consists of two functions: adaptive post-filtering and signal up-scaling.

6.2.1 Adaptive post-filtering

The adaptive postfilter is the cascade of two filters: a formant postfilter, and a tilt compensation filter. The postfilter is updated every subframe of 5 ms.

The formant postfilter is given by:  Az(/γ ) Hz()= n f  γ Az(/d ) (63)  where Az() is the received quantified (and interpolated) LP inverse filter (LP analysis is not performed at the decoder), γ γ and the factors n and d control the amount of the formant post-filtering.

Hz() Hz() Finally, the filter t compensates for the tilt in the formant postfilter f and is given by: − Hz()=− (1µ z1 ) t (64) µγ=k' where t1 is a tilt factor, with k1' being the first reflection coefficient calculated on the truncated   ()L=22 hn() Az(/γγ )/ Az(/ ) himpulse response, f , of the filter nd. k1' is given by: −− Lih 1 ==+rh()1 k1' ;()()()rihff∑ h jhj i rh()0 = j0 (65)  The post-filtering process is performed as follows. First, the synthesized speech sn() is inverse filtered through   Az(/γ )   1 / Az(/γ ) n to produce the residual signal rn(). The signal rn() is filtered by the synthesis filter d .  1 / Az(/γ ) hz() Finally, the signal at the output of the synthesis filter d is passed to the tilt compensation filter t sn () resulting in the post-filtered speech signal f .  Adaptive gain control (AGC) is used to compensate for the gain difference between the synthesized speech signal sn() sn () γ and the post-filtered signal f . The gain scaling factor sc for the present subframe is computed by:

39 ∑sn2() γ =n=0 sc 39 2 ∑snf () = n 0 (66) ′ The gain-scaled post-filtered signal sn() is given by: sn′()=β () nsn() sc f (67) β ()n where sc is updated in sample-by-sample basis and given by: GSM 06.60 version 4.0.1 32 EN 301 245 V4.0.1 (1997-12)

βαβαγ()nn=−+− (11 ) ( ) sc sc sc (68) α where is a AGC factor with value of 0.9. γ = 07. γ = 075. The adaptive post-filtering factors are given by: n , d and  08.,k '> 0 γ =  1 t 0, otherwise . (69)

6.2.2 Up-scaling

Up-scaling consists of multiplying the post-filtered speech by a factor of 2 to compensate for the down-scaling by 2 which is applied to the input signal.

7 Variables, constants and tables in the C-code of the GSM EFR codec

The various components of the 12,2 kbit/s GSM enhanced full rate codec are described in the form of a fixed-point bit-exact ANSI C code, which is found in GSM 06.53 [6]. This C simulation is an integrated software of the speech codec, VAD/DTX, comfort noise and bad frame handler functions. In the fixed-point ANSI C simulation, all the computations are performed using a predefined set of basic operators.

Two types of variables are used in the fixed-point implementation. These two types are signed integers in 2's complement representation, defined by:

Word16 16 bit variables

Word32 32 bit variables

The variables of the Word16 type are denoted var1, var2, ..., varn, and those of type Word32 are denoted L_var1, L_var2, ..., L_varn.

7.1 Description of the constants and variables used in the C code

The ANSI C code simulation of the codec is, to a large extent, self-documented. However, a description of the variables and constants used in the code is given to facilitate the understanding of the code. The fixed-point precision (in terms of Q format, double precision (DP), or normalized precision) of the vectors and variables is given, along with the vectors dimensions and constant values.

Table 3 gives the coder global constants and table 4 describes the variables and vectors used in the encoder routine with their precision. Table 5 describes the fixed tables in the codec. GSM 06.60 version 4.0.1 33 EN 301 245 V4.0.1 (1997-12)

Table 3: Codec global constants

Parameter Value Description L_TOTAL 240 size of speech buffer L_WINDOW 240 size of LP analysis window L_FRAME 160 size of speech frame L_FRAME_BY2 80 half the speech frame size L_SUBFR 40 size of subframe M 10 order of LP analysis MP1 11 M+1 AZ_SIZE 44 4*M+4 PIT_MAX 143 maximum pitch lag PIT_MIN 18 minimum pitch lag L_INTERPOL 10 order of sinc filter for interpolating the excitations is 2*L_INTERPOL*6+1 PRM_SIZE 57 size of vector of analysis parameters SERIAL_SIZE 245 number of speech bits + bfi MU 26214 tilt compensation filter factor (0.8 in Q15) AGC_FAC 29491 automatic gain control factor (0.9 in Q15)

Table 4: Description of the coder vectors and variables

Parameter Size Precision Description speech -80..159 Q0 speech buffer wsp -143..159 Q0 weighted speech buffer exc -(143+11)..159 Q0 LP excitation F_gamma1 0..9 Q15 spectral expansion factors F_gamma2 0..9 Q15 spectral expansion factors lsp_old 0..9 Q15 LSP vector in past frame lsp_old_q 0..9 Q15 quantified LSP vector in past frame mem_syn 0..9 Q0 memory of synthesis filter mem_w 0..9 Q0 memory of weighting filter (applied to input) mem_wO 0..9 Q0 memory of weighting filter (applied to error) error -10..39 Q0 error signal (input minus synthesized speech) r_1 & r_h 0..10 normalized DP correlations of windowed speech (low and hi) A_t 11x4 Q12 LP filter coefficients in 4 subframes Aq_t 11x4 Q12 quantified LP filter coefficients in 4 subframes Ap1 0..10 Q12 LP coefficients with spectral expansion Ap2 0..10 Q12 LP coefficients with spectral expansion lsp_new 0..9 Q15 LSP vector in 4th subframe lsp_new_q 0..9 Q15 quantified LSP vector in 4th subframe lsp_mid 0..9 Q15 LSP vector in 2nd subframe lsp_mid_q 0..9 Q15 quantified LSP vector in 2nd subframe code 0..39 Q12 fixed codebook excitation vector h1 0..39 Q12 impulse response of weighted synthesis filter xn 0..39 Q0 target vector in pitch search xn2 0..39 Q0 target vector in algebraic codebook search dn 0..39 scaled max backward filtered target vector < 8192 y1 0..39 Q0 filtered adaptive codebook vector y2 0..39 Q12 filtered fixed codebook vector zero 0..39 zero vector res2 0..39 long-term prediction residual gain_pit scalar Q12 adaptive codebook gain gain_code scalar Q0 algebraic codebook gain GSM 06.60 version 4.0.1 34 EN 301 245 V4.0.1 (1997-12)

Table 5: Codec fixed tables

Parameter Size Precision Description grid [ ] 61 Q15 grid points at which Chebyshev polynomials are evaluated lag_h [ ] and lag_1 [ ] 10 DP higher and lower parts of the lag window table window_160_80 [ ] 240 Q15 1st LP analysis window window_232_8 [ ] 240 Q15 2nd LP analysis window table [ ] in Lsf_lsp ( ) 65 Q15 table to compute cos(x) in Lsf_lsp ( ) slope [ ] in Lsp_lsf ( ) 64 Q12 table to compute acos(x) in LSP_lsf ( ) table [ ] in Inv_sqrt ( ) 49 table used in inverse square root computation table [ ] in Log2 ( ) 33 table used in base 2 logarithm computation table [ ] in Pow2 ( ) 33 table used in 2 to the power computation mean_lsf [ ] 10 Q15 LSF means in normalized frequency [0.0, 0.5] dico1_lsf [ ] 128 x 4 Q15 1st LSF quantizer in normalized frequency [0.0, 0.5] dico2_lsf [ ] 256 x 4 Q15 2nd LSF quantizer in normalized frequency [0.0, 0.5] dico3_lsf [ ] 256 x 4 Q15 3rd LSF quantizer in normalized frequency [0.0, 0.5] dico4_lsf [ ] 256 x 4 Q15 4th LSF quantizer in normalized frequency [0.0, 0.5] dico5_lsf [ ] 64 x 4 Q15 5th LSF quantizer in normalized frequency [0.0, 0.5] qua_gain_pitch [ ] 16 Q14 quantization table of adaptive codebook gain qua_gain_code [ ] 32 Q11 quantization table of fixed codebook gain inter_6 [ ] in Interpol_6 ( ) 25 Q15 interpolation filter coefficients in Interpol_6 ( ) inter_6 [ ] in Pred_lt_6 ( ) 61 Q15 interpolation filter coefficients in Pred_lt_6 ( ) b [ ] 3 Q12 HP filter coefficients (numerator) in Pre_Process ( ) a [ ] 3 Q12 HP filter coefficients (denominator) in Pre_Process ( ) bitno [ ] 57 Q0 number of bits corresponding to transmitted parameters

Table 6: Source Encoder output parameters in order of occurrence and bit allocation within the speech frame of 244 bits/20 ms

Bits (MSB-LSB) Description s1 - s7 index of 1st LSF submatrix s8 - s15 index of 2nd LSF submatrix s16 - s23 index of 3rd LSF submatrix s24 sign of 3rd LSF submatrix s25 - s32 index of 4th LSF submatrix s33 - s38 index of 5th LSF submatrix subframe 1 s39 - s47 adaptive codebook index s48 - s51 adaptive codebook gain s52 sign information for 1st and 6th pulses s53 - s55 position of 1st pulse s56 sign information for 2nd and 7th pulses s57 - s59 position of 2nd pulse s60 sign information for 3rd and 8th pulses s61 - s63 position of 3rd pulse s64 sign information for 4th and 9th pulses s65 - s67 position of 4th pulse s68 sign information for 5th and 10th pulses s69 - s71 position of 5th pulse s72 - s74 position of 6th pulse s75 - s77 position of 7th pulse s78 - s80 position of 8th pulse s81 - s83 position of 9th pulse s84 - s86 position of 10th pulse s87 - s91 fixed codebook gain subframe 2 s92 - s97 adaptive codebook index (relative) s98 - s141 same description as s48 - s91 subframe 3 s142 - s194 same description as s39 - s91 subframe 4 s195 - s244 same description as s92 - s141 GSM 06.60 version 4.0.1 35 EN 301 245 V4.0.1 (1997-12)

8 Homing sequences

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. GSM 06.60 version 4.0.1 36 EN 301 245 V4.0.1 (1997-12)

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 GSM 06.60 version 4.0.1 37 EN 301 245 V4.0.1 (1997-12)

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. GSM 06.60 version 4.0.1 38 EN 301 245 V4.0.1 (1997-12)

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, All set to 0 x1, x0 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]. GSM 06.60 version 4.0.1 39 EN 301 245 V4.0.1 (1997-12)

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], 1384 lsf_old_CN[0],lsf_new_CN[0] past_lsf_q[1], lsf_p_CN[1], 2077 lsf_old_CN[1],lsf_new_CN[1] past_lsf_q[2], lsf_p_CN[2], 3420 lsf_old_CN[2],lsf_new_CN[2] past_lsf_q[3], lsf_p_CN[3], 5108 lsf_old_CN[3],lsf_new_CN[3] past_lsf_q[4], lsf_p_CN[4], 6742 lsf_old_CN[4],lsf_new_CN[4] past_lsf_q[5], lsf_p_CN[5], 8122 lsf_old_CN[5],lsf_new_CN[5] past_lsf_q[6], lsf_p_CN[6], 9863 lsf_old_CN[6],lsf_new_CN[6] past_lsf_q[7], lsf_p_CN[7], 11092 lsf_old_CN[7],lsf_new_CN[7] past_lsf_q[8], lsf_p_CN[8], 12714 lsf_old_CN[8],lsf_new_CN[8] past_lsf_q[9], lsf_p_CN[9], 13701 lsf_old_CN[9],lsf_new_CN[9] 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) GSM 06.60 version 4.0.1 40 EN 301 245 V4.0.1 (1997-12)

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 GSM 06.60 version 4.0.1 41 EN 301 245 V4.0.1 (1997-12)

adaptive codebook g p

v(n)

u(n) 1 ^ ^ fixed s(n) s'(n) codebook + A(z) post-filtering c(n) g c LP synthesis

Figure 2: Simplified block diagram of the CELP synthesis model GSM 06.60 version 4.0.1 42 EN 301 245 V4.0.1 (1997-12)

frame subframe

Pre-processing LPC analysis Open-loop pitch search Adaptive codebookInnovative codebook Filter memory search search update (twice per frame) (twice per frame) s(n)

Pre-processing compute targetx(n) compute target update filter for adaptive for m emories for A(z) codebook innovation next subframe ^ x (n) interpolation A(z) windowing for the 4 T x(n) pitch code and subfram es index 2 index autocorrelation o R[ ] LSP A(z) find best delay find best compute and gain innovation excitation

h(n) compute quantize Levinson- A(z) weighted LTP-gain Durbin speech LTP R[ ] (4 subframes) gain fixed A(z) index codebook compute gain adaptive quantization codebook find contribution A(z) LSP open-loop pitch

fixed codebook gain index A(z) compute h(n) LSP im pulse LSP quantization indices response ^ A(z) interpolation for the 4 subfram es LSP ^ A(z)

Figure 3: Simplified block diagram of the GSM enhanced full rate encoder GSM 06.60 version 4.0.1 43 EN 301 245 V4.0.1 (1997-12)

frame subframe post-processing

LSP indices decode LSP pitch decode index adaptive codebook

gains ^ ^ construct s(n) s'(n) indices decode post filter interpolation excitation of LSP for the code gains index 4 subframes synthesis decode filter innovative codebook

^ LSP A(z)

Figure 4: Simplified block diagram of the GSM enhanced full rate decoder GSM 06.60 version 4.0.1 44 EN 301 245 V4.0.1 (1997-12)

9 Bibliography

1) M.R. Schroeder and B.S. Atal, "Code-Excited Linear Prediction (CELP): High quality speech at very low bit rates,"' Proc. ICASSP'85, pp. 937-940, 1985.

2) Y. Tohkura and F. Itakura, "Spectral smoothing technique in PARCOR speech analysis-synthesis," IEEE Trans. on ASSP, vol. 26, no. 6, pp. 587-596, Dec. 1978.

3) L.R. Rabiner and R.W. Schaefer. Digital processing of speech signals. Prentice-Hall Int., 1978.

4) F. Itakura, "Line spectral representation of linear predictive coefficients of speech signals," J. Acoust. Soc. Amer, vol. 57, Supplement no. 1, S35, 1975.

5) F.K. Soong and B.H. Juang, "Line spectrum pair (LSP) and speech ", Proc. ICASSP'84, pp. 1.10.1-1.10.4, 1984.

6) P. Kabal and R.P. Ramachandran, "The computation of line spectral frequencies using Chebyshev polynomials", IEEE Trans. on ASSP, vol. 34, no. 6, pp. 1419-1426, Dec. 1986.

7) C. Laflamme, J-P. Adoul, R. Salami, S. Morissette, and P. Mabilleau, "16 kpbs wideband technique based on algebraic CELP" Proc. ICASSP'91, pp. 13-16. GSM 06.60 version 4.0.1 45 EN 301 245 V4.0.1 (1997-12)

History

Document history V4.0.0 August 1997 One-step Approval Procedure OAP 9750: 1997-08-15 to 1997-12-12

V4.0.1 December 1997 Publication

ISBN 2-7437-1845-5 Dépôt légal : Décembre 1997