ANSI-C Code for GSM Half Rate Speech Codec

Specification: 46006

🟢Approvedv800
Rel-8
Relevance:7/10

Summary

This document specifies the ANSI-C code for the GSM half rate speech codec, which is necessary for a bit-exact implementation of the half rate speech transcoder, Voice Activity Detector, comfort noise, Discontinuous Transmission, and example solutions for substituting and muting of lost frames.

Specification Intelligence

This is a Technical Document in the Unknown Series series, focusing on Technical Document. The document is currently in approved by tsg and under change control and is under formal change control.

Classification

Type: Technical Document
Subject: Unknown Series
Series: 46.xxx
Target: Technical Implementers

Specifics

Status: Change Control

Version

800.0.0
Release 800
0 technical • 0 editorial

Full Document v800

3GPP TS 46.006 v. 8.0.0

Technical Specification

3rd Generation Partnership Project;

Technical Specification Group Services and System Aspects;

Half rate speech;

ANSI-C code for the GSM half rate speech codec

(Release 8)

 

 

                                                                          

The present document has been developed within the 3rd Generation Partnership Project (3GPP TM) and may be further elaborated for the purposes of 3GPP.    
The present document has not been subject to any approval process by the 3GPP Organizational Partners and shall not be implemented. 
This Specification is provided for future development work within 3GPP only. The Organizational Partners accept no liability for any use of this Specification.
Specifications and reports for implementation of the 3GPP TM system should be obtained via the 3GPP Organizational Partners' Publications Offices.

 

 


 

Keywords

GSM, speech, codec

 

3GPP

Postal address

 

3GPP support office address

650 Route des Lucioles - Sophia Antipolis

Valbonne - FRANCE

Tel.: +33 4 92 94 42 00 Fax: +33 4 93 65 47 16

Internet

http://www.3gpp.org

 

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.

 

© 2008, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC).

All rights reserved.

 

UMTS™ is a Trade Mark of ETSI registered for the benefit of its members

3GPP™ is a Trade Mark of ETSI registered for the benefit of its Members and of the 3GPP Organizational Partners
LTE™ is a Trade Mark of ETSI currently being registered for the benefit of its Members and of the 3GPP Organizational Partners

GSM® and the GSM logo are registered and owned by the GSM Association

 


Contents

Foreword................................................................................................................................................ 4

1....... Scope........................................................................................................................................... 5

2....... References.................................................................................................................................... 5

3....... Definitions and abbreviations......................................................................................................... 5

3.1......... Definitions............................................................................................................................................................................ 5

3.2......... Abbreviations....................................................................................................................................................................... 6

4....... C code structure............................................................................................................................ 6

4.1......... Directory structure.............................................................................................................................................................. 6

4.2......... Program execution.............................................................................................................................................................. 7

4.3......... Code hierarchy..................................................................................................................................................................... 7

5....... ANSI‑C code for the GSM half rate speech codec......................................................................... 12

Annex A (informative):....... Change History...................................................................................... 13

 


This Technical Specification has been produced by the 3rd Generation Partnership Project (3GPP).

The contents of the present document are subject to continuing work within the TSG and may change following formal TSG approval. Should the TSG modify the contents of the present document, it will be re-released by the TSG with an identifying change of release date and an increase in version number as follows:

Version x.y.z

where:

x    the first digit:

1    presented to TSG for information;

2    presented to TSG for approval;

3    or greater indicates TSG approved document under change control.

y    the second digit is incremented for all changes of substance, i.e. technical enhancements, corrections, updates, etc.

z    the third digit is incremented when editorial only changes have been incorporated in the document.

The present document specifies the half rate speech traffic channels for the digital cellular telecommunications system. The present document is part of a series covering the half rate speech traffic channels as described below:

GSM 06.02          "Digital cellular telecommunications system (Phase 2+); Half rate speech; Half rate speech processing functions".

GSM 06.06          "Digital cellular telecommunications system (Phase 2+); Half rate speech; ANSI‑C code for the GSM half rate speech codec".

GSM 06.07          "Digital cellular telecommunications system (Phase 2+); Half rate speech; Test sequences for the GSM half rate speech codec".

GSM 06.20          "Digital cellular telecommunications system (Phase 2+); Half rate speech; Half rate speech transcoding".

GSM 06.21          "Digital cellular telecommunications system (Phase 2+); Half rate speech; Substitution and muting of lost frames for half rate speech traffic channels".

GSM 06.22          "Digital cellular telecommunications system (Phase 2+); Half rate speech; Comfort noise aspects for half rate speech traffic channels".

GSM 06.41          "Digital cellular telecommunications system (Phase 2+); Half rate speech; Discontinuous Transmission (DTX) for half rate speech traffic channels".

GSM 06.42          "Digital cellular telecommunications system (Phase 2+); Half rate speech; Voice Activity Detector (VAD) for half rate speech traffic channels".


The present document contains an electronic copy of the ANSI‑C code for the GSM half rate codec. The ANSI‑C code is necessary for a bit exact implementation of the half rate speech transcoder (GSM 06.20 [2]), Voice Activity Detector (GSM 06.42 [6]), comfort noise (GSM 06.22 [4]), Discontinuous Transmission (GSM 06.41 [5]) and example solutions for substituting and muting of lost frames (GSM 06.21 [3]).

The following documents contain provisions which, through reference in this text, constitute provisions of the present document.

·       References are either specific (identified by date of publication, edition number, version number, etc.) or non‑specific.

·       For a specific reference, subsequent revisions do not apply.

·         For a non-specific reference, the latest version applies.  In the case of a reference to a 3GPP document (including a GSM document), a non-specific reference implicitly refers to the latest version of that document in the same Release as the present document.

[1]                          GSM 01.04: "Digital cellular telecommunication system (Phase 2+); Abbreviations and acronyms".

[2]                          GSM 06.20: "Digital cellular telecommunications system (Phase 2+); Half rate speech; Half rate speech transcoding".

[3]                          GSM 06.21: "Digital cellular telecommunications system (Phase 2+); Half rate speech; Substitution and muting of lost frame for half rate speech traffic channels".

[4]                          GSM 06.22: "Digital cellular telecommunications system (Phase 2+); Half rate speech; Comfort noise aspects for half rate speech traffic channels".

[5]                          GSM 06.41: "Digital cellular telecommunications system (Phase 2+); Half rate speech; Discontinuous Transmission (DTX) for half rate speech traffic channels".

[6]                          GSM 06.42: "Digital cellular telecommunications system (Phase 2+); Half rate speech; Voice Activity Detector (VAD) for half rate speech traffic channels".

[7]                          GSM 06.07: "Digital cellular telecommunications system (Phase 2+); Half rate speech; Test sequences for the GSM half rate speech codec".

[8]                          American National Standards Institute ANSI 9899 (1990): "Programming Language ‑ C (ISO)".

3.1        Definitions

Definition of terms used in the present document can be found in GSM 06.20 [2], GSM 06.21 [3], GSM 06.22 [4], GSM 06.41 [5] and GSM 06.42 [6].

3.2        Abbreviations

For the purposes of the present document, the following abbreviations apply:

ANSI                     American National Standards Institute

DS‑HD                  Double Sided High Density

ETS                        European Telecommunication Standard

GSM                      Global System for Mobile communications

I/O                         Input/Output

ROM                     Read Only Memory

For abbreviations not given in this clause, see GSM 01.04 [1].

This clause gives an overview of the structure of the bit‑exact C code and provides an overview of the contents and organization of the electronic attachment accompanying the present document.

The C code has been verified on the following systems:

‑     Sun Microsystem's 1) workstations and Sun Microsystems acc;

‑     IBM 2) PC/AT compatible computers and Borlands Turbo‑C 3) compiler;

‑     VAX 4) and Digital Equipment Corporations CC.

ANSI‑C 9899 [8] was selected as the programming language because portability was desirable.

The code representation is contained in a MS‑DOS 5) file (called Disk and contained in archive en_300967v080001p0.ZIP which accompanies the present document.

4.1        Directory structure

A listing of the directories is given in table 1.

Table 1: Directory structure listing

Directory name

Contents

Size (bytes)

\c

C files and headers

1 215 563

\d

example binary data input and output files

72 400

\exec

executables and makefiles

5 509

\utils

utility programs and the "reid" program

49 531

readme.txt

usage description of files

9 116

 

The C code file (called Disk and contained in archive en_300967v080001p0.ZIP) which accompanies the present document has one main directory and four subdirectories. The top directory has in it the file readme.txt which explains the installation procedure, along with some miscellaneous descriptive information regarding the code.

Below this directory, are the four subdirectories. The "c" subdirectory contains all the source code and header files. This directory alone is essential, the others aid in the building, or testing of the code. All ROM data is in this source directory. After installation, this directory can be made read only.

The "d" subdirectory contains all the speech coder installation verification data files. All of the data files are written/read as 16 bit words, so these may require byte swapping on the target platform. All data and text files are formatted such that they are correct for an IBM PC/AT compatible.

Final verification is to be performed using the GSM half rate test sequences described in GSM 06.07 [7].

The "utils" subdirectory contains miscellaneous utilities which may be useful in the installation of the software. Two programs are provided to transform text files: topcwild and tosnwild. The program topcwild takes UNIX text files and converts them to pc text files. tosnwild does the opposite. The program swapbin is also in this directory. This performs byte swapping on a binary data file. A fourth program, reid, is also contained in this sub directory. This is the residual error insertion program which also provides the format conversion between the encoder output file format and the decoder input file format.

The "exec" subdirectory contains the makefiles for the various platforms. Once the software is installed, this directory will have a compiled version of gsm_hr (the bit‑exact C executable), programs from the "utils" directory, and all the object files.

The program gsm_hr is the name of the GSM half rate codec executable file.

4.2        Program execution

The GSM half rate speech codec is implemented as two separate programs:

‑     (gsm_hr) speech codec;

‑     (reid) encoder/decoder interface.

The gsm_hr program operates in one of two modes:

‑     (0) encoding only;

‑     (1) decoding only.

For encoding, the input is a binary speech file (*.inp) and the output is a binary encoded parameter file (*.cod). For decoding, the input is a binary parameter files (*.dec) and the output is a binary synthesized speech file (*.out). Note that the format for the parameter input file required for decoding (*.dec) is not the same as the format of the parameter output file generated by encoding (*.cod). The reid program will translate an *.cod file into an *.dec file (select error‑free mode, EP0).

See the file readme.txt for more information on how to run the gsm_hr and reid programs.

4.3        Code hierarchy

Figures 1 to 7 are call graphs that show the functions used in the speech codec.

The encode call graph is broken down into six separate call graphs. Those clauses, which are large, are separated from the primary encode call tree and given their own call tree. Each vertical column represents a call level. For example, main() is at level 0, encode() at level 1, speechEncoder() at level 2, openLoopLagSearch() at level 3, getCCThreshold() at level 4, etc. The basic operations are not counted as extending the depth, therefore the deepest level is this software is level 6.

Some items have been omitted from this call graph. All standard C functions: printf(), fwrite(), etc. have been omitted. Also, no basic operations (add(), L_add(), mac(), etc.) or double precision extended operations (e.g. L_mpy_ls()) appear in the graphs.


Figure 1: Speech decoder call graph

Figure 2: Speech encoder call graph


Figure 3: Speech encoder LPC quantization call graph

Figure 4: Speech encoder open‑loop lag search call graph

Figure 5: Speech encoder subframe processing call graph

Figure 6: Comfort noise call graph

Figure 7: Voice Activity Detector (VAD) call graph

NOTE:      This clause is contained in archive en_300967v080001p0.ZIP which accompanies the present document.


 

Change history

SMG No.

TDoc. No.

CR. No.

Section affected

New version

Subject/Comments

SMG#16

 

 

 

4.0.3

ETSI Publication

SMG#17

332/95

119/96

A001

A002

 

4.1.0

HR C-code

GSM half rate Codec Homing Procedure

SMG#23

97-737

A002

 

4.1.1

UAP60 and Supplementary notes on 06.06 Call Graph Changes

SMG#20

 

 

 

5.0.0

Release 1996 version

SMG#20

 

 

 

5.0.1

ETSI version change

SMG#22

430/97

A002

 

5.1.0

UAP 60

SMG#23

97-737

A003

 

5.1.1

UAP60 and Supplementary notes on 06.06 Call Graph Changes

SMG#27

 

 

 

6.0.0

Release 1997 version

SMG#28

 

 

 

6.0.1

ETSI Publication

SMG#29

 

 

 

7.0.0

Release 1998 version

 

 

 

 

7.0.1

Version update to 7.0.1 for Publication

SMG#31

 

 

 

8.0.0

Release 1999 version

 

 

 

 

8.0.1

Update to Version 8.0.1 for Publication

 

 

Change history

Date

TSG #

TSG Doc.

CR

Rev

Subject/Comment

Old

New

03-2001

11

 

 

 

Version for Release 4

 

4.0.0

06-2002

16

 

 

 

Version for Release 5

4.0.0

5.0.0

12-2004

26

 

 

 

Version for Release 6

5.0.0

6.0.0

06-2007

36

 

 

 

Version for Release 7

6.0.0

7.0.0

12-2008

42

 

 

 

Version for Release 8

7.0.0

8.0.0

 



1)       Registered trade mark of Sun Microsystems

2)       Registered trade mark of International Business Machines

3)       Registered trade mark of Borland

4)       Registered trade mark of Digital Equipment Corporation

5)       Registered trade mark of Microsoft

Version Control

Version Control

Toto je jediná verze této specifikace.

v800

Download & Access

Technical Details

AI Classification

Category: 7. Testování a interoperabilita
Subcategory: 7.1 Conformance Testing
Function: Test specification

Version Information

Release: Rel-8
Version: 800
Series: 46_series
Published: 2008-12

Document Info

Type: Technical Specification
TSG: Services and

Keywords & Refs

Keywords:
MACGSM

Partners

Contributors:
ETSITTCCCSA+3

File Info

File: 46006-800
Processed: 2025-06-22

3GPP Spec Explorer - Enhanced specification intelligence