Actions

Difference between revisions of "IP audio Gain adjustment"

From Zenitel Wiki

(Gain adjustment and limiter)
(Gain adjustment and limiter: SIP gains corrected to +9dB/-6dB, which is the values in released SW. (+18dB/-9dB was only in a X-version))
Line 15: Line 15:
 
The default behaviour is now:  
 
The default behaviour is now:  
 
* Inter-AlphaCom and to IP stations: 0dB gain in and out (ie low audio level)
 
* Inter-AlphaCom and to IP stations: 0dB gain in and out (ie low audio level)
* Towards SIP: '''+18dB''' gain out towards SIP, '''-9db''' reduction for incomming audio.
+
* Towards SIP: '''+9dB''' gain out towards SIP, '''-6db''' reduction for incomming audio.
  
 
Also there is a limiter function. The limiter reduces the effective gain automatically if the signal after gain amplifier exceeds the limit for the connection.  
 
Also there is a limiter function. The limiter reduces the effective gain automatically if the signal after gain amplifier exceeds the limit for the connection.  
  
The default limit is 0dB for both directions. (Was  -3dB for outgoing audio, and -9db for audio incomming to backplane for versions 10.31 - 10.45).
+
The default limit is 0dB for both directions. (Was  -3dB for outgoing audio, and -9db for audio incomming to backplane for versions 10.31 - 10.45, see {{Bugzilla|18}}).
  
 
If this works fine, no need to read further.
 
If this works fine, no need to read further.

Revision as of 10:40, 10 November 2009

(New from DSP SW 01.11 / AMCD 10.31)

Audio levels and gain on AlphaCom IP audio connections may be changed using NVRAM programming. Defaults has been set, so that normal usage should work without any changes.

Background

Normal audio is encoded in AlphaCom internal digital audio format (SigmaDelta) with a fairly low level, compared to the max theoretical amplitude of the audio format. A headroom of factor 10 = 20dB is common.

For IP audio connections between AlphaComs, the SigmaDelta audio is converted to a standard format like G.722 or G.711. The gain is 1 = 0dB, in the sense that max SigmaDelta amplitude corresponds to max amplitude on the external format. The audio level on these connection will therefore be quite low.

In the telecom world, the standard audio level is much higher, headroom as small as 3dB is normal. Therefore AlphaCom audio needs to be amplified when sent to external SIP equipment.

Gain adjustment and limiter

The default behaviour is now:

  • Inter-AlphaCom and to IP stations: 0dB gain in and out (ie low audio level)
  • Towards SIP: +9dB gain out towards SIP, -6db reduction for incomming audio.

Also there is a limiter function. The limiter reduces the effective gain automatically if the signal after gain amplifier exceeds the limit for the connection.

The default limit is 0dB for both directions. (Was -3dB for outgoing audio, and -9db for audio incomming to backplane for versions 10.31 - 10.45, see BZ 18).

If this works fine, no need to read further.

The gain and limit can be programmed per node in NVRAM. No AlphaPro support is implemented so far. The NVRAM values can be used for testing. AlphaPro support will be added if there is a demand for it.

The NVRAM fields are:

module_profile.node_profile[<node-no>].audio_gain_in 
module_profile.node_profile[<node-no>].audio_gain_out
module_profile.node_profile[<node-no>].audio_limit_in
module_profile.node_profile[<node-no>].audio_limit_out

<node-no>: Selects the Alphacom or SIP device the setting applies to. For SIP, both registrar and trunk node number needs programming. <node-no> = own node control the gain towards all local IP stations.

Values: 0 (zero) means use default values as described above. Non-zero value: the specified value is used for the matching connections.

Gain is a 5 bit value; -10 to +10, corresponding to -30dB to +30dB gain.

Limit is a 4 bit value 1 to 12, corresponding to 3 to 36dB below max range. (Set value to 16 to get 0 dB limit)

Implementation notes

DSP/RTPd interface

Gain and limit are attributes to the 20xx and 21xx codec resources. The values are added as extra parameters to the "co2" and "con" messages. Examples for a SIP connection:

co2 0100 2000 g711u 6 1
co2 3000 2100 g711u FFFD 5

Limiter principles

For each sample, for every channel, the sample is scaled with the current gain. After scaling, two statistics are collected

  • max amplitude (absolute value)
  • count number of samples (absolute value) above the limit (clip-count)

Then a gain control job runs every 16 ms:

  • if more than one sample above the target limit in last period, reduce gain by 25% = -2.5dB. (This will happen every 16 ms until signal is within limit.)
  • otherwise, if gain is reduced, consider to increase gain:
  • Max amplitude must be less than 7/8 of limit for at least 3 seconds (stability timer) before starting to increase gain.
  • When increasing gain, the gain is raised by 4.5dB per second.
  • Current gain is never allowed to become larger than the target-gain.
  • When the signal (max-amplitude) has very low value, the 3 second stability timer is frozen (not reset). The assumption is that there is a speech pause. We do not want to increase the gain between every talk spurt of a conversation, only to reduce it again at the next sentence.
  • reset max amplitude and clip-count variables