Jun 22, 2008

CODECs , Micro-CODECs , and still more CODECs

I frequently find myself in discussions about CODECs and call quality. It seems that many people have little understanding of CODECs , and even fewer have a good understanding of CODEC translation or what may REALLY be happening when they send out a micro-CODEC such as GSM or ilbc from their asterisk box, softphone or ATA.

This is mostly a translation from an old post that I made in Spanish on the subject.

The majority of carries support some flavor of g711 and g729. Therefore , when a person sends a call in a CODEC such as g723, GSM or ilbc, it is more probably they will have CODEC translation occur in the chain of that call.

Does not matter? You think so? Really huh....

Your provider offers g723, g729 and g711 for example. You want to use ilbc. Your asterisk can translate CODECS, because you are thinking more of saving bandwidth, you send calls to your provider via g723. Perhaps what you do not understand is that your provider is going to translate that call from the G723 that you send to g729 or g711 before sending it to the PSTN.

In the example above , you can see that the call will have a couple of different stages of CODEC translation. One very important thing to understand is always to use the most common CODECs. You must think of each stage of CODEC translation in the ENTIRE chain, not just on your end. If your call happens to be to a GSM cell phone you call will later also be CODEC translated again to some flavor of GSM, adding yet another step of CODEC translation.

It is better to use CODECs that your provider can support up to the gateway, with no translation, but when that is not possible, you should NEVER translate from a micro-CODEC to a micro-CODEC, unless you are sure that your privider is not translating again later in the chain. The only CODECs that are not micro-CODECs are g711 u (ulaw , or PCMU) and g711a (alaw or PCMA). Also Micro-CODECs have an inherent higher level of latency, are more greatly affected by packet loss and jitter, and every CODEC translation in the chain adds more latency still.

If a person or company tells you they offer "Carrier Class Services" , they should offer g711a or g711u, or it is simply not carrier class. They are the only CODECs that offer the same quality as the PSTN.

Keep in mind, each micro-CODEC adds its own unique set of distortions, artifacts, and errors in the voice quality. If you go through two micro-CODECs , the call may have such poor quality it can be unintelligible.