3

I'm facing issue with a Asterisk-based ToIP infrastructure. Sometimes my phone received 'empty' RTP (payload entirely filled with 5d).

I browsed RFC (3551, 3389) and can't find/understand relevant answers.

I have found that two web pages that have the same issue as me:

https://www.wireshark.org/lists/ethereal-users/200402/msg00142.html

http://www.giacomovacca.com/2013/05/the-sound-of-silence-encoded-with-g711.html

So:

  • Is anybody know where is the official answer?
  • Who decided that filling 0x55 or 0xd5 will make no sound?
  • Also, who could explain to me why 0x55 or 0xd5 make 0?

Thanks!

Greeg
  • 31
  • 1
  • 2

1 Answers1

5

This comes from G.711 audio codec PCM procedure.

G.711 defines two logarithmic codecs used for PCM (Pulse Code Modulation) audio data: a-law and u-law. Codec algorithms are based on the perceptual properties of the human ear - weak signals are masked by strong ones.

After compression (from 14 bit sample in u-law and 13 bit sample in a-law) to 8 bits, the last 7 bits except the sign bit inverted. Uninverted bit called the sign bit. This bit inversion increases the one’ s bit density in transmission systems that help timing and clock recovery circuits in the receiver.

Ideal channel noise makes bits toggle between 01111111 (0x7F) and 11111111 (0xFF) in u-law and between 01010101 (0x55) and 11010101 (0xD5) in a-law. We usually use exactly a-law encoding.

In codec specification negative sound samples are 1's complemented to align dynamic ranges of positive and negative numbers. Compressed negative and positive values of equal magnitude are distinguished by the sign bit.

More detail description with PCM examples you can read there

Also you can read specification.