1、 ETSI TS 126 230 V14.0.0 (2017-04) Digital cellular telecommunications system (Phase 2+) (GSM); Universal Mobile Telecommunications System (UMTS); Cellular text telephone modem; Transmitter bit exact C-code (3GPP TS 26.230 version 14.0.0 Release 14) floppy3TECHNICAL SPECIFICATION GLOBAL SYSTEM FOR M
2、OBILE COMMUNICATIONSRETSI ETSI TS 126 230 V14.0.0 (2017-04)13GPP TS 26.230 version 14.0.0 Release 14Reference RTS/TSGS-0426230ve00 Keywords GSM,UMTS 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
3、C Association but non lucratif enregistre la 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/
4、or print versions of the present document shall 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
5、kept on a specific network drive within ETSI 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 https:/portal.etsi.org/TB/ETSIDeliverableStatus
6、.aspx If you find errors in the present document, please 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 photocopy
7、ing and microfilm except as authorized by written permission 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 2017.
8、 All rights reserved. DECTTM, PLUGTESTSTM, UMTSTMand 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 registe
9、red and owned by the GSM Association. ETSI ETSI TS 126 230 V14.0.0 (2017-04)23GPP TS 26.230 version 14.0.0 Release 14Contents 0 Scope 4g31 Normative references . 4g32 Definitions and Abbreviations 4g33 C code structure 4g33.1 Contents of the C source code 5g33.2 Program execution 5g33.3 Code hierarc
10、hy . 9g33.3.1 Initialization routines 9g33.3.2 Signal Processing Functions . 10g33.4 Description of global constants used in the C-code 11g33.5 Type Definitions . 12g33.6 Functions of the C Code . 12g3Annex A (informative): Change history . 26g3History 27g3ETSI ETSI TS 126 230 V14.0.0 (2017-04)33GPP
11、 TS 26.230 version 14.0.0 Release 14Foreword This Technical Specification has been produced by T1P1. The contents of the present document are subject to continuing work within the 3GPP TSG and may change following formal 3GPP approval. Should the 3GPP TSG modify the contents of this TS, it will be r
12、e-released by the 3GPP 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 3GPP for information; 2 presented to 3GPP for approval; 3 Indicates 3GPP approved document under change control. y the second dig
13、it 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 specification; ETSI ETSI TS 126 230 V14.0.0 (2017-04)43GPP TS 26.230 version 14.0.0 Release 140 Scope Thi
14、s Technical Standard (TS) contains an electronic copy of the ANSI-C code for the Cellular Text Telephone Modem (CTM) for reliable transmission of text telephone text via the speech channel of cellular networks. While CTM is generally usable with text in UCS coding, the example application linked to
15、CTM in this document is limited to use the signals and character set of the Baudot type. 1 Normative references This TS 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
16、 listed hereafter. For dated references, subsequent amendments to or revisions of any of these publications apply to this TS only when incorporated in it by amendment or revision. For undated references, the latest edition of the publication referred to applies. 1 3GPP TS 26.226: “Cellular text tele
17、phone modem; General description“. 2 ISO/IEC 10646-1: “Information technology Universal Multiple-Octet Coded Character Set (UCS) Part 1: Architecture and Basic Multilingual Plane“. 2 Definitions and Abbreviations For the purposes of this TS, the following abbreviations apply: CTM Cellular Text Telep
18、hone Modem FEC Forward Error Correction FSK Frequency Shift Key HCO Hearing Carry Over, (individual may be able to hear, but cannot speak) Alternating transmission of speech and text. PCM Pulse Code Modulation RX Receive TX TransmitTTY Text Telephone UCS Universal Multiple-Octet Coded Character Set
19、UTF UCS transformation format VAD Voice Activity Detection VCO Voice Carry Over, Alternating transmission of speech and text 3 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 C code attached to t
20、his document. The C code has been verified on the following system. - Sun Microsystems workstations with SUN SolarisTMoperating system and the the Gnu C Compiler (gcc version 2.7.2.3) and GNU Make 3.77; The C code has also been successfully compiled and used in the following environment, with the ex
21、ception that it cannot be guaranteed that the upper part of the UCS code table in file ucs_functions.c will be compiled correctly since it depends on the codepage setting of the environment. - IBM PC/AT compatible computers with WindowsTMNT 4.0 operating system and Microsoft Visual C+ 6.0TMcompiler.
22、 ETSI ETSI TS 126 230 V14.0.0 (2017-04)53GPP TS 26.230 version 14.0.0 Release 143.1 Contents of the C source code The distributed files with suffix “c“ contain the source code and the files with suffix “h“ are the header files. All these files are in the root level of the ZIP-archive. Makefiles are
23、provided for the platforms in which the C code has been verified (listed above). They are called “Makefile” for GNU Make and “Makefile.vc” for Microsoft Visual C+TM. For the Sun Microsystems platform, an example shell script for a transmission via two signal adaptation modules is given in “test_nego
24、tiation“. For the Microsoft WindowsTMplatform, no shell script or batch program is provided. The software can be compiled using the commands make all or gmake all in case of Gnu Make nmake /f Makefile.vc in case of Microsoft Visual C+. The executables are compiled into the directory ./solaris (in ca
25、se of Gnu Make) or into the actual directory in case of Microsoft Visual C+TM. The directory ./patterns provides the file baudot.pcm that serves as input signal for the test script test_negotiation. All output data of test_negotiation will be stored into the directory ./output. If required, this dir
26、ectory will be created by test_negotiation automatically. 3.2 Program execution The CTM signal adaptation module is implemented in the execuable adaptation_switch (in case of Sun SolarisTMplatform) or adaptation_switch.exe (in case of the Micorsoft WindowsTMplatform). The program should be called li
27、ke: adaptation_switch -ctmin -ctmout -baudotin -baudotout using the following parameters: -ctmin input file with CTM signal -ctmout output file for CTM signal -baudotin input file with Baudot Tones -baudotout output file for Baudot Tones -textout output text file from CTM receiver (optional) -numsam
28、ples number of samples to process (optional) -nonegotiation disables the negotiation (optional) All files contain 16-bit linear encoded PCM audio samples, which are swapped according to the platforms endian type (Sun Microsystems platforms use big endian, Intel platforms use little endian). An examp
29、le file baudot.pcm containing a Baudot Code modem signal (big endian) is provided in the subdirectory ./patterns. Due to the fact that the signal adaptation module expects a successful negotiation before Baudot Code signals can be converted to CTM signals, the signal adaptation module has to be exec
30、uted several times in two instances in order to execute a successful negotiation. For the Sun Microsystems platform, a shell script test_negotiation is provided for executing the following structure: ETSI ETSI TS 126 230 V14.0.0 (2017-04)63GPP TS 26.230 version 14.0.0 Release 14- ctm_forward - baudo
31、t.pcm -| | -| |- baudot_out.pcm | adapt#1 | | adapt#2 | /dev/null Enquiry Burst generated! Enquiry Burst generated! Enquiry Burst generated! CTM from far-end detected! Enquiry From Far End Detected! Enquiry From Far End Detected! Enquiry From Far End Detected! Enquiry Burst generated! CTM from far-e
32、nd detected! CTM from far-end detected! Enquiry From Far End Detected! in case that inChar is not valid (e.g. inChar=0) ETSI ETSI TS 126 230 V14.0.0 (2017-04)143GPP TS 26.230 version 14.0.0 Release 14char convertTTYcode2char(Shortint ttyCode); Purpose: Conversion from TTY code into Character Defined
33、 in: baudot_functions.c Input Variables: ttyCode Baudot code (must be within the range 0.63) or -1 if there is nothing to convert Return Value: character (or 0 if ttyCode is not valid) char convertUCScode2char(UShortint ucsCode); Purpose: Conversion from UCS code into character (Universal Multiple-O
34、ctet Coded Character Set, Row 00 of the Multilingual plane according to ISO/IEC 10646-1). This routine only handles characters in the range 0255 since that is all that is required for demonstration of Baudot support. Defined in: ucs_functions.c Input Variables: ucsCode UCS code index, must be within
35、 the range 0.255 Return Value: character (or 0 if ucsCode is not valid) void conv_encoder_exec(conv_encoder_t* ptr_state, Shortint* in, Shortint inbits, Shortint* out); Purpose: Execution of the convolutional encoder for error protection Defined in: conv_encoder.c Input Variables: in Vector with net
36、 bits inbits Number of valid net bits in vector in Output variables: out Vector with the encoded gross bits. The gross bits are either 0 or 1. The vector out must have at least CHC_RATE*inbits elements. Input/output variables: *ptr_state state variable of the encoder void conv_encoder_init(conv_enco
37、der_t* ptr_state); Purpose: Initialization of the convolutional encoder Defined in: conv_encoder.c Output Variables: *ptr_state Initialized state variable of the encoder ETSI ETSI TS 126 230 V14.0.0 (2017-04)153GPP TS 26.230 version 14.0.0 Release 14void ctm_receiver(fifo_state_t* ptr_signal_fifo_st
38、ate, fifo_state_t* ptr_output_char_fifo_state, Bool* ptr_early_muting_required, rx_state_t* rx_state); Purpose: Runs the CTM Receiver for a block of (nominally) 160 samples. Due to the internal synchronization, the number of processed samples might vary between 156 and 164 samples. The input of the
39、samples and the output of the decoded characters is handled via fifo buffers, which have to be initialized externally before using this function (see fifo.h for details). Defined in: ctm_receiver.c input/output variables *ptr_signal_fifo_state fifo state for the input samples *ptr_output_char_fifo_s
40、tate fifo state for the output characters *ptr_early_muting_required returns whether the original audio signal must not be forwarded. This is to guarantee that the preamble or resync sequence is detected only by the first CTM device, if several CTM devices are cascaded subsequently. rx_state pointer
41、 to the variable containing the receiver states void ctm_transmitter(UShortint ucsCode, Shortint* txToneVec, tx_state_t* tx_state, Shortint *ptrNumBitsStillToModulate, Bool sineOutput); Purpose: Runs the CTM Transmitter for a block of 160 output samples, representing 8 gross bits. The bits, which ar
42、e modulated into tones, are taken from an internal fifo buffer. If the fifo buffer is empty, zero-valued samples are generated. The fifo buffer is filled with channel-encoded and interleaved bits, which are generated internally by coding the actual input character. With each call of this function on
43、e or less input characters can be coded. If there is no character to for transmission, one of the following codes has be used: - 0x0016 : indicates that there is no character to transmit and that the transmitter should stay in idle mode, if it is currently already in idle mode. If the transmitter is
44、 NOT in idle mode, it might generate symbols in order to keep an active burst running. The CTM burst is terminated if five symbols have been generated consecutively. - 0xFFFF: although there is no character to transmit, a CTM burst is initiated in order to signal to the far-end side that CTM is supp
45、orted. The burst starts with the symbol and will be continued with symbols if there are no regular characters handed over during the next calls of this function. The CTM burst is terminated if five symbols have been transmitted consecutively. ETSI ETSI TS 126 230 V14.0.0 (2017-04)163GPP TS 26.230 ve
46、rsion 14.0.0 Release 14In order to avoid an overflow of the internal fifo buffer, the variable *ptrNumBitsStillToModulate should be checked before calling this function. Defined in: ctm_transmitter.c input variables: ucsCode UCS code of the character or one of the code 0x0016 or 0xFFFF sineOutput mu
47、st be false in regular mode; if true, a pure sine output signal is generated output variables: txToneVec output signal (vector of 160 samples) input/output variables: tx_state pointer to the variable containing the transmitter states void diag_deinterleaver(Shortint *out, Shortint *in, Shortint num_
48、valid_bits, interleaver_state_t *intl_state); Purpose: Corresponding deinterleaver to diag_interleaver. An arbitrary number of bits can be interleaved, depending of the length of the vector “in“. The vector “out“, which must have the same length than “in“, contains the interleaved samples. All state
49、s (memory etc.) of the interleaver are stored in the variable *intl_state. Therefore, a pointer to this variable must be handled to this function. This variable initially has to be initialized by the function init_interleaver, which offers also the possibility to specify the dimensions of the deinterleaver matrix. Defined in: diag_deinterleaver.c void diag_interleaver(Shortint *out, Shortint *in, Shortint num_bits, interleaver_state_t *intl_state)