Difference between revisions of "Information on Audio Codecs"

From TD-er's Wiki
Jump to navigationJump to search
Line 25: Line 25:
 
! Compression method
 
! Compression method
 
! Transfer rate
 
! Transfer rate
 +
! NEB
 
! Frame size
 
! Frame size
 
|-  
 
|-  
Line 30: Line 31:
 
|Pulse Code Modulation (PCM)   
 
|Pulse Code Modulation (PCM)   
 
|64 Kbps  
 
|64 Kbps  
 +
|87.2 Kbps
 
|20 ms
 
|20 ms
 
|-
 
|-
Line 35: Line 37:
 
|Adaptive Differential Pulse Code Modulation (ADPCM)
 
|Adaptive Differential Pulse Code Modulation (ADPCM)
 
|16-40 Kbps  
 
|16-40 Kbps  
 +
|55.2 Kbps
 
|
 
|
 
|-
 
|-
Line 40: Line 43:
 
|Low Delay Code Excited Linear Prediction (LD-CELP)   
 
|Low Delay Code Excited Linear Prediction (LD-CELP)   
 
|16 Kbps  
 
|16 Kbps  
 +
|31.5 Kbps
 
|0,625ms
 
|0,625ms
 
|-
 
|-
Line 45: Line 49:
 
|Conjugate Structure Algebraic Code Excited Linear Prediction (CD-ACELP)
 
|Conjugate Structure Algebraic Code Excited Linear Prediction (CD-ACELP)
 
|8 Kbps  
 
|8 Kbps  
 +
|31.2 Kbps
 
|10 ms
 
|10 ms
 
|-
 
|-
 
|G.723.1   
 
|G.723.1   
 
|Mulptiple Maximum Likehood Quantization (MPMLQ)   
 
|Mulptiple Maximum Likehood Quantization (MPMLQ)   
|6,3 Kbit/s  
+
|6.3 Kbit/s  
|37,5 ms
+
|21.9 Kbps
 +
|37.5 ms
 
|-
 
|-
 
|G.723  
 
|G.723  
 
|ACELP   
 
|ACELP   
 
|5,3 Kbps  
 
|5,3 Kbps  
 +
|20.8 Kbps
 
|
 
|
 
|-
 
|-
Line 60: Line 67:
 
|Global System for Mobile communications
 
|Global System for Mobile communications
 
|13 Kbps
 
|13 Kbps
 +
|
 
|20ms
 
|20ms
 
|-
 
|-
Line 65: Line 73:
 
|Patent-free audio compression
 
|Patent-free audio compression
 
|2.15-24.6 Kbps
 
|2.15-24.6 Kbps
 +
|
 
|20ms
 
|20ms
 
|-
 
|-
Line 70: Line 79:
 
|Patent-free audio compression
 
|Patent-free audio compression
 
|4-44.2 Kbps
 
|4-44.2 Kbps
 +
|
 
|20ms
 
|20ms
 
|-
 
|-
Line 75: Line 85:
 
|ADPCM
 
|ADPCM
 
|32 Kbps
 
|32 Kbps
 +
|
 
|
 
|
 
|-
 
|-
Line 80: Line 91:
 
|Internet Low Bandwidth Codec (free)
 
|Internet Low Bandwidth Codec (free)
 
|13,3 Kbps
 
|13,3 Kbps
 +
|
 
|30ms
 
|30ms
 
|-
 
|-
Line 85: Line 97:
 
|Internet Low Bandwidth Codec (free)
 
|Internet Low Bandwidth Codec (free)
 
|15,2 Kbps
 
|15,2 Kbps
 +
|27.7 Kbps
 
|20ms
 
|20ms
 
|-
 
|-
Line 90: Line 103:
 
|PCM
 
|PCM
 
|128 Kbps
 
|128 Kbps
 +
|
 
|
 
|
 
|-
 
|-
Line 95: Line 109:
 
|Enhanced Variable Rate Codec
 
|Enhanced Variable Rate Codec
 
|8 Kbps
 
|8 Kbps
 +
|
 
|
 
|
 
|-
 
|-

Revision as of 12:46, 6 February 2007

Codecs are used to convert an analog voice signal to digitally encoded version. Codecs vary in the sound quality, the bandwidth required, the computational requirements, etc.

Each service, program, phone, gateway, etc typically supports several different codecs, and when talking to each other, negotiate which codec they will use.


X-lite has various audio codecs implemented. The implemented audio codecs of the X-lite 3.0 version are DVI4, G.711 uLaw/aLaw, GSM, iLBC as (narrow band audio codecs) and BV-32, BV FEC, DVI4, L16 PCM (wide band audio codecs). Eyebeam version 1.5 has a wider range of codecs available.


G.711A & G.711U

G.711 is a codec primarily used in telephony, released in 1972. It samples the analogue voice input signal using pulse-code modulation (PCM) at a sampling rate of 8000 samples/second.

The G.711 standard has two algorithms: the A-law (mostly used in Europe) and the U-law algorithm (used in North America and Japan).

The G.711 codec encodes the pulse-code modulation samples (sampling rate of 8000 samples/second) to logarithmic 8-bit samples. This will lead to a (8000 times 8-bit=) 64 kbit/s bitstream. Note that this is the datastream without information send in the headers of the packages, so the actual datastream will be higher. Because the sampling rate of 8000 samples/second and the encoding to 8-bit samples are intrinsic properties of the codec, the bitstream can not exceed 64 kbit/s. If one wants to increase the quality of the voice by increasing the used bandwidth (> 64 kbit/s) one has to use another codec.

Various codecs compared

The following sites were used to build the following comparison:

Codec Compression method Transfer rate NEB Frame size
G.711 Pulse Code Modulation (PCM) 64 Kbps 87.2 Kbps 20 ms
G.726 Adaptive Differential Pulse Code Modulation (ADPCM) 16-40 Kbps 55.2 Kbps
G.728 Low Delay Code Excited Linear Prediction (LD-CELP) 16 Kbps 31.5 Kbps 0,625ms
G.729/G.729A Conjugate Structure Algebraic Code Excited Linear Prediction (CD-ACELP) 8 Kbps 31.2 Kbps 10 ms
G.723.1 Mulptiple Maximum Likehood Quantization (MPMLQ) 6.3 Kbit/s 21.9 Kbps 37.5 ms
G.723 ACELP 5,3 Kbps 20.8 Kbps
GSM Global System for Mobile communications 13 Kbps 20ms
Speex Narrowband (8kHz) Patent-free audio compression 2.15-24.6 Kbps 20ms
Speex Wideband (16kHz) Patent-free audio compression 4-44.2 Kbps 20ms
DVI4 ADPCM 32 Kbps
iLBC Internet Low Bandwidth Codec (free) 13,3 Kbps 30ms
iLBC Internet Low Bandwidth Codec (free) 15,2 Kbps 27.7 Kbps 20ms
L16 PCM PCM 128 Kbps
EVCR Enhanced Variable Rate Codec 8 Kbps

From the maximum voice quality point of view, when enough bandwidth is available, the best quality can be obtained by using the L16 PCM codec. This L16 PCM codec is the same as the G.711 codec, however the L16 PCM codec samples to 16 bits samples instead of the 8 bits samples in the case of the G.711 codec.

Asterisk will resample all codecs internally to 8000 samples/sec. This means using for example the Speex Wide-band (16 kHz sample-rate) or even Ultra-wide-band (32 kHz sample-rate) with Asterisk is useless.

Codecs with a frame-size other than 20 ms, appear to work bad with Asterisk. This may have to do with the IAX-protocol.