
October 2013 – Ed.1.0
EQUITEL E400 Family – Control and communications protocol
Page 24
PCM sample (without sign) G.711-A data (without sign)
P10 P9 P8 P7 P6 P5 P4 P3 P2 P1 P0 G6 G5 G4 G3 G2 G1 G0
0 0 0 0 0 0 0 A B C D 0 0 0 A B C D
0 0 0 0 0 0 1 A B C D 0 0 1 A B C D
0 0 0 0 0 1 A B C D - 0 1 0 A B C D
0 0 0 0 1 A B C D - - 0 1 1 A B C D
0 0 0 1 A B C D - - - 1 0 0 A B C D
0 0 1 A B C D - - - - 1 0 1 A B C D
0 1 A B C D - - - - - 1 1 0 A B C D
1 A B C D - - - - - - 1 1 1 A B C D
To obtain the value of the G.711-A data corresponding to a sample, we take the module of the latter (11 bits
P
10
…P
0
) and, according to the value of the most relevant bits, we will take the corresponding 4 bits (A, B, C, D)
to form the G.711-A data.
If the PCM sample is negative, the resulting G.711-A data will also be negative, so it will be coded in 2's
complement.
As we can see in the table, the samples with a lower value are encoded without reducing their resolution.
However, for samples with a higher module we have disregarded the less significant bits.
Finally, the obtained data must be masked making a XOR operation bit by bit with the number 0x55
(01010101b).
After obtaining the 160 data G.711-A (160 bytes) we proceed to form the RTP packet that will be sent the
network, using the UDP protocol.
The RTP protocol, defined in RFC 3550, is a communication standard for audio and video over IP networks,
allowing the receivers to compensate the jitter and the packets disorder that can occur in the network.
It consists basically on the standardization of the packets length, the information delivery order and a header
based on the content type we need to encapsulate.
In our case, the packets must be formed as follows to send encoded audio according to G.711-A:
Bit
0
7
15
23
31
V P
X
CC M
PT Sequence
TimeStamp
SSRC
D0 D1 D2 D3
…
D158 D157 D158 D159
The header is formed by 4 32-bit words containing the following fields:
V (Version): 2 bits representing RTP protocol version in use. It has to be always equal to 2.
P (Padding bit): Bit indicating if the packet has been filled in with void data due to aligning purposes. In
our case it must always be 0.
X (Xtension bit): Bit indicating whether the header is extended. This applies to other type of content. In
our case it has to be always 0.
CC (CSRC Count): 4 bits showing the number of CSRC fields following the header. The CSRC fields are not
used in this type of contents so these 4 bits will always be 0.
M (Market): A bit whose use is defined according to the type of content. In the case of audio in G.711-A,
this bit is always 0.
PT (Payload Type): 7 bits indicating the data transported by the RTP packet. It is the one allowing the
Kommentare zu diesen Handbüchern