1、 ETSI TS 1Digital cellular telecoANSI-C code for th(3GPP TS 46.0floppy3TECHNICAL SPECIFICATION146 053 V13.0.0 (2016communications system (Phathe GSM Enhanced Full Rate speech codec .053 version 13.0.0 Release 13GLOBAL SYSTEMOBILE COMMUN16-01) hase 2+); te (EFR) 13) TEM FOR ICATIONSRETSI ETSI TS 146
2、053 V13.0.0 (2016-01)13GPP TS 46.053 version 13.0.0 Release 13Reference RTS/TSGS-0446053vd00 Keywords GSM ETSI 650 Route des Lucioles F-06921 Sophia Antipolis Cedex - 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 enregistre l
3、a Sous-Prfecture de Grasse (06) N 7803/88 Important notice The present document can be downloaded from: http:/www.etsi.org/standards-search The present document may be made available in electronic versions and/or in print. The content of any electronic and/or print versions of the present document s
4、hall not be modified without the prior written authorization of ETSI. In case of any existing or perceived difference in contents between such versions and/or in print, the only prevailing document is the print of the Portable Document Format (PDF) version kept on a specific network drive within ETS
5、I Secretariat. Users of the present document should be aware that the document may be subject to revision or change of status. Information on the current status of this and other ETSI documents is available at http:/portal.etsi.org/tb/status/status.asp If you find errors in the present document, ple
6、ase send your comment to one of the following services: https:/portal.etsi.org/People/CommiteeSupportStaff.aspx Copyright Notification No part may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying and microfilm except as authorized by written per
7、mission of ETSI. The content of the PDF version shall not be modified without the written authorization of ETSI. The copyright and the foregoing restriction extend to reproduction in all media. European Telecommunications Standards Institute 2016. All rights reserved. DECTTM, PLUGTESTSTM, UMTSTMand
8、the ETSI logo are Trade Marks of ETSI registered for the benefit of its Members. 3GPPTM and LTE are Trade Marks of ETSI registered for the benefit of its Members and of the 3GPP Organizational Partners. GSM and the GSM logo are Trade Marks registered and owned by the GSM Association. ETSI ETSI TS 14
9、6 053 V13.0.0 (2016-01)23GPP TS 46.053 version 13.0.0 Release 13Intellectual 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-memb
10、ers, and can be found in ETSI SR 000 314: “Intellectual Property Rights (IPRs); Essential, or potentially Essential, IPRs notified to ETSI in respect of ETSI standards“, which is available from the ETSI Secretariat. Latest updates are available on the ETSI Web server (https:/ipr.etsi.org/). Pursuant
11、 to the ETSI 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 ETSI SR 000 314 (or the updates on the ETSI Web server) which are, or may be, or may become, essential to the present documen
12、t. Foreword This Technical Specification (TS) has been produced by ETSI 3rd Generation Partnership Project (3GPP). The present document may refer to technical specifications or reports using their 3GPP identities, UMTS identities or GSM identities. These should be interpreted as being references to
13、the corresponding ETSI deliverables. The cross reference between GSM, UMTS, 3GPP and ETSI identities can be found under http:/webapp.etsi.org/key/queryform.asp. Modal verbs terminology In the present document “shall“, “shall not“, “should“, “should not“, “may“, “need not“, “will“, “will not“, “can“
14、and “cannot“ are to be interpreted as described in clause 3.2 of the ETSI Drafting Rules (Verbal forms for the expression of provisions). “must“ and “must not“ are NOT allowed in ETSI deliverables except when used in direct citation. ETSI ETSI TS 146 053 V13.0.0 (2016-01)33GPP TS 46.053 version 13.0
15、.0 Release 13Contents Intellectual Property Rights 2g3Foreword . 2g3Modal verbs terminology 2g3Foreword . 4g31 Scope 5g32 References 5g33 Definitions and abbreviations . 5g33.1 Definitions 5g33.2 Abbreviations . 6g34 C code structure 6g34.1 Contents of the C source code disk 6g34.2 Program execution
16、 7g34.3 Code hierarchy . 7g3Annex A (informative): Change History 13g3History 14g3ETSI ETSI TS 146 053 V13.0.0 (2016-01)43GPP TS 46.053 version 13.0.0 Release 13Foreword This Technical Specification has been produced by the 3rdGeneration Partnership Project (3GPP). The present document provides the
17、bit exact definition of the Enhanced Full Rate (EFR) speech traffic codec for the digital cellular telecommunications system. An electronic attachment accompanies the present document, containing clause 5, the bit-exact ANSI-C code for the Enhanced Full Rate speech transcoder. The contents of the pr
18、esent 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.
19、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 di
20、git is incremented when editorial only changes have been incorporated in the document. ETSI ETSI TS 146 053 V13.0.0 (2016-01)53GPP TS 46.053 version 13.0.0 Release 131 Scope The present document contains an electronic copy of the ANSI-C code for the GSM Enhanced Full Rate codec. The ANSI-C code is n
21、ecessary for a bit exact implementation of the Enhanced Full Rate speech transcoder (GSM 06.60 3), Voice Activity Detection (GSM 06.82 7), comfort noise (GSM 06.62 5), Discontinuous Transmission (GSM 06.81 6) and example solutions for substituting and muting of lost frames (GSM 06.61 4). 2 Reference
22、s 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
23、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 cellu
24、lar telecommunications system (Phase 2+); Abbreviations and acronyms“. 2 GSM 06.54: “Digital cellular telecommunications system (Phase 2+); Test sequences for the GSM Enhanced Full Rate (EFR) speech codec“. 3 GSM 06.60: “Digital cellular telecommunications system (Phase 2+); Enhanced Full Rate (EFR)
25、 speech transcoding“. 4 GSM 06.61: “Digital cellular telecommunications system (Phase 2+); Substitution and muting of lost frame for Enhanced Full Rate (EFR) speech traffic channels“. 5 GSM 06.62: “Digital cellular telecommunications system (Phase 2+); Comfort noise aspects for Enhanced Full Rate (E
26、FR) speech traffic channels“. 6 GSM 06.81: “Digital cellular telecommunications system (Phase 2+); Discontinuous transmission (DTX) for Enhanced Full Rate (EFR) speech traffic channels“. 7 GSM 06.82: “Digital cellular telecommunications system (Phase 2+); Voice Activity Detector (VAD) for Enhanced F
27、ull Rate (EFR) speech traffic channels“. 3 Definitions and abbreviations 3.1 Definitions Definition of terms used in the present document can be found in GSM 06.60 3, GSM 06.61 4, GSM 06.62 5, GSM 06.81 6 and GSM 06.82 7. ETSI ETSI TS 146 053 V13.0.0 (2016-01)63GPP TS 46.053 version 13.0.0 Release 1
28、33.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/OutputROM Read Only Memory For abbr
29、eviations not given in this clause see GSM 01.04 1. 4 C code structure 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 archive en_300724v080000o0.ZIP which accompanies the present document. The C code has been ve
30、rified on the following systems: - Sun Microsystems 1)workstations and Sun Microsystems cc compiler and gcc compiler; - IBM 2)PC/AT compatible computers and Borland Turbo-C+ 3)compiler; - Hewlett Packards 4)workstations and HP cc compiler; ANSI-C 9899 was selected as the programming language because
31、 portability was desirable. 4.1 Contents of the C source code disk The C code disk has all of the files in the root level. In this disk, the files with suffix “c“ contain the source code and the files with suffix “h“ are the header files. The ROM data is contained mostly in files with suffix “tab“.
32、All text files are formatted such that they are correct for an IBM PC/AT compatible. The archive en_300724v080000o0.ZIP which accompanies the present document contains one speech coder installation verification data file, “spch_dos.inp“. The reference encoder output file is named “spch_dos.cod“, the
33、 reference decoder input file is named “spch_dos.dec“ and the reference decoder output file is named “spch_dos.out“. These four files are formatted such that they are correct for an IBM PC/AT compatible. The same files with reversed byte order of the 16 bit words are named “spch_unx.inp“, “spch_unx.
34、cod“, “spch_unx.“dec“ and “spch_unx.out“, respectively. In an IBM PC/AT compatible platform, the installation verification can be performed by running the batch file “ts_dos.bat“. In most UNIX platforms, the installation verification can be performed by running the batch file “ts_unx.bat“. Final ver
35、ification is to be performed using the GSM Enhanced Full Rate test sequences described in GSM 06.54 2. Makefiles are provided for the three platforms in which the C code has been verified (listed above). Once the software is installed, this directory will have compiled versions of coder and decoder
36、(the bit-exact C executables of the speech codec), ed_iface (interface program between coder and decoder) and all the object files. 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
37、Hewlett Packard ETSI ETSI TS 146 053 V13.0.0 (2016-01)73GPP TS 46.053 version 13.0.0 Release 13The programs coder and decoder are the GSM Enhanced Full Rate encoder and decoder executable files, respectively. A third program, ed_iface, is also contained in this directory. This is the program which p
38、rovides the format conversion between the encoder output file format and the decoder input file format. 4.2 Program execution The GSM enhanced full rate speech codec is implemented as three separate programs: - (coder) speech encoder; - (ed_iface) encoder/decoder interface; - (decoder) speech decode
39、r. For encoding using the coder program, the input is a binary speech file (*.inp) and the output is a binary encoded parameter file (*.cod). For decoding using the decoder program, the input is a binary parameter file (*.dec) and the output is a binary synthesized speech file (*.out). NOTE: The for
40、mat 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 ed_iface program will translate an *.cod file into a *.dec file. See the file readme.txt for more information on how to run the coder, ed_iface
41、 and decoder programs. 4.3 Code hierarchy Figures 1 to 5 are call graphs that show the functions used in the speech codec, including the functions of VAD, DTX, and comfort noise generation. The encode call graph is broken down into three separate call graphs, and the decode call graph is broken down
42、 into two separate call graphs. Those clauses which are large are separated from the primary call tree and given their own call tree. Each vertical column represents a call level. For example, main() is at level 0, Coder_12k2() at level 1, Int_lpc2() at level 2, Lsp_Az() at level 3, Get_lsp_pol() at
43、 level 4, etc. The basic operations are not counted as extending the depth, therefore the deepest level in this software is level 4. 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
44、(), etc.) or double precision extended operations (e.g. L_Extract() appear in the graphs. The reset functions of the encoder and decoder are only visible as the functions reset_enc and reset_dec, respectively. There are several subroutine calls from inside these functions. The time order in the call
45、 graphs is from the bottom upwards as the processing of a frame advances. ETSI ETSI TS 146 053 V13.0.0 (2016-01)83GPP TS 46.053 version 13.0.0 Release 13mainreset_encencoder_homing_frame_testPre_ProcessCoder_12k2CN_encodingAutocorrLag_windowLevinsonvad_computationtx_dtxWeight_AiResiduSyn_filtPitch_o
46、lperiodicity_updateAz_lspChebpsInt_lpc2Int_lpcLsp_AzGet_lsp_polLag_maxInv_sqrtPrm2bits_12k2Int2binQ_plsf_5Lsp_lsfupdate_lsf_p_CNaver_lsf_historyupdate_lsf_historyLsf_wtVq_subvecVq_subvec_sReorder_lsfLsf_lspsid_codeword_encodingFigure 1: Speech encoder call graph (see figures 2 and 3) ETSI ETSI TS 14
47、6 053 V13.0.0 (2016-01)93GPP TS 46.053 version 13.0.0 Release 13Coder_12k2compute_CN_excitation_gainEnc_lag6Pred_lt_6ConvolveG_pitchq_gain_pitchG_codeCopybuild_CN_codepseudonoisePitch_fr6Norm_CorrConvolveInv_sqrtInterpol_6code_10i40_35bitscor_h_xset_signcor_hsearch_10i40build_codeq_pq_gain_codeLog2P
48、ow2update_gain_code_history_txupdate_gcode0_CNaver_gain_code_historyFigure 2: Speech encoder subframe processing call graph ETSI ETSI TS 146 053 V13.0.0 (2016-01)103GPP TS 46.053 version 13.0.0 Release 13vad_hangovervad_decisionthreshold_adaptationtone_detectionspectral_comparisonpredictor_valuesene
49、rgy_computationstep_upcompute_rav1vad_computationacf_averagingschur_recursion Figure 3: Voice Activity Detector (VAD) call graph ETSI ETSI TS 146 053 V13.0.0 (2016-01)113GPP TS 46.053 version 13.0.0 Release 13D_plsf_5update_lsf_p_CNinterpolate_CN_lsfinterpolate_CN_paramLsf_lspReorder_lsfupdate_lsf_historymainreset_decdecoder_homing_frame_testPost_Filterrx_dtxInt_lpcLsp_AzDec_lag6Pred_lt_6dec_10i40_35bitsbuild_CN_coded_gain_codeupdate_gcode0_CNinterpolate_CN_paramupdate_gain_code_history_rxLog2Pow2Syn_filtagc2Inv_sqrtCopyDecoder_1