ANSI-C Code for GSM Half Rate Speech Codec
Specification: 46006
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
Specifics
Version
Full Document v800
3GPP TS 46.006 V8.0.0 (2008-12) |
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.    |
|
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 |
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 |
Version Control
Version Control
Toto je jediná verze této specifikace.
Download & Access
46006-800
Technical Details
AI Classification
Version Information
Document Info
Keywords & Refs
Partners
File Info
3GPP Spec Explorer - Enhanced specification intelligence