Tuesday, October 11, 2011
G.726, transcoding and smart codecs
DECT uses the G.726 codec to transmit the voice over the air, no matter what codec was negotiated on the SIP side. Ops that is not 100 % correct, in the new DECT standard (CatIQ), the air interface also supports other codecs like G.711 or G.722; but let’s forget about this for now and until CatIQ handsets are widely available.
G.726 is one of those good-old ITU codecs. It is in the same area like G.711, G.729, G.721 and also G.722 with constant bitrate, no matter if you are talking or not or if you are playing music on hold. It probably comes from the time when telephone calls were running on slots with fixed bitrates (TDM), and having a bit rate of 32 Kbit/s allowed to have actually two phone calls in one 64 Kbit/s second slot (that’s really 64000 bit/s, not 64 * 1024 as we would assume in the computer age). Anyway, for the air interface it makes a lot of sense to pick a fixed rate codec as well, because—guess what—DECT is also using TDM slots for the voice and transmitting bits over the air cost a lot of energy and spectrum, so limiting it somehow makes a lot of sense.
We can be happy that they chose 32 Kbit/s and not less. In GSM, they usually use only 13.2 Kbit/s where the voice quality really suffers. Even if you use a great microphone, compressing voice to that level will have to throw a lot of information away, so that cell phones using the GSM standard have little potential for good audio quality. Anyway, in DECT they decided to use another codec, and that codec was G.726. It compresses the voice not too much, and it is actually difficult to tell the difference to G.711, the codec that is still mostly used in digital voice. The G.726 is pretty friendly to the CPU, and it causes only very little delay with the encoding and decoding. The other reason to go for G.726 is that it is not as heavily patented as for example G.729. IMHO a great choice that many service providers should seriously consider!
There is one more reason why providers should consider G.726: Transcoding. If you are calling from a DECT device, you want to avoid that the voice has to be transcoded from G.726 into linear and then into G.711 or something else. This is because every transcoding step reduces the quality of the signal. Even if you are transcoding from a “bad” codec to a “good” codec, you are loosing information, and it will sound worse. Something like the 1 x 1 of the information science: You can only loose information, not add something.
Well, that might not be true forever, even in the codec world. Maybe one day we will have a codec that knows the speakers voice so well, that it can figure out what is being said and synthesize the missing spectrum. It would also be useful for filling up gaps when packets get lost—assuming the codec really knows what is being said. We have to be careful here: Maybe one day you are talking to the bank with the super codec, the bank guy asks you if you really want to purchase one million snom shares, you say “no” but right at that moment there is a lot of packet loss, and the smart codec kicks in and synthesizes a perfect “yes” and the deal is done. That’s where I prefer a dumb codec like G.726.