VOIP Codecs
PCMU (64kbps) is the uncompressed signal that is transmitted at PSTN. So it will give you the best quality as long as your network throughput supports it. This is the preferred codec for wifi connection. However, 3g network cannot consistently sustain 64kbps and will suffer from packet loss resulting in jitter.
| Codec | Bandwidth/kbps | Comments |
| G.711 | 64 | Delivers precise speech transmission. Very low processor requirements. Needs at least 128 kbps for two-way. |
| G.722 | 48/56/64 | Adapts to varying compressions and bandwidth is conserved with network congestion. |
| G.723.1 | 5.3/6.3 | High compression with high quality audio. Can use with dial-up. Lot of processor power. |
| G.726 | 16/24/32/40 | An improved version of G.721 and G.723 (different from G.723.1) |
| G.729 | 8 | Excellent bandwidth utilization. Error tolerant. MAY REQUIRE LICENSING. |
| GSM | 13 | High compression ratio. Free and available in many hardware and software platforms. Same encoding is used in GSM cellphones (improved versions are often used nowadays). |
| iLBC | 15 | Robust to packet loss. Free |
| Speex | 2.15 / 44 | Minimizes bandwidth usage by using variable bit rate. |
Codecs
Now that we understand the basics, let’s proceed to explaining the differences between the common codecs which can be used to encapsulate the Audio in a VoIP call. The following table shows the audio quality expected, the CPU resources required to encode and decode the audio, the base size of the audio packets, and total bandwidth consumption after taking into consideration the overhead.
| Codec | Audio Quality | CPU Resources | Base Size | Total Size (Base + Overhead) |
|---|---|---|---|---|
| G711 | Good | Very Low | 64 kbps | 95.2 kbps |
| G722 | Very Good | Low | 64 kbps | 95.2 kbps |
| GSM | Acceptable | Average | 13 kbps | 44.2 kbps |
| G729 | Average | High | 8 kbps | 39.2 kbps-licensing may be needed. |
Note that the above bandwidth consumption is in kilobits per second. You will need to divide by 8 in order to get the equivalent in kilobytes per second. Using the above data, we can come up with the following stats:
| Codec | Kilobits per second | Kilobytes per second | Kilobytes per minute | Megabytes per hour |
|---|---|---|---|---|
| G711 | 95.2 | 11.9 | 714 | 41.8 |
| G722 | 95.2 | 11.9 | 714 | 41.8 |
| GSM | 44.2 | 5.525 | 331.5 | 19.4 |
| G729* | 39.2 | 4.9 | 294 | 17.2 |
Here are some notes and suggestions for the application of specific codecs:
- The above are the stats for one audio stream. A VoIP call will use one audio stream for each leg (or endpoint). Thus a call between 2 persons will use double the bandwidth shown above.
- *G729 is the codec which consumes the least bandwidth and has a relatively good audio quality. However that comes with 2 drawbacks:
- Its efficiency comes at a cost, which is CPU usage. It is more CPU intensive to encode audio in such a low size while maintaining the quality.
- G729 is a proprietary codec. Because of this, the number of simultaneous G729 calls cannot exceed half your 3CX Phone System simultaneous call license. May require license.
- Because of this, G729 should only be used when really required, such as for external calls to VoIP Providers, calls across a bridge, or for remote extensions (basically all calls being done over the internet). You can configure the PBX to fall back to GSM if G729 calls cannot be made.
- Although G711 and G722 consume over twice as much bandwidth as the other codecs, most Local Area Networks are able to handle this bandwidth. Using the above table, a 1 hour call using G711 is equivalent to transferring a 41.8 MB file. If that causes an issue, you should consider upgrading your network.