Actions

Difference between revisions of "IP audio Gain adjustment"

From Zenitel Wiki

(Gain adjustment and limiter)
m (1 revision imported)
 
(22 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{A}}
 
(New from DSP SW 01.11 / AMCD 10.31)
 
(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.
+
Audio levels and gain on AlphaCom IP audio connections may be changed from AlphaPro. Defaults has been set, so that normal usage should work without any changes.
  
 
= Background =
 
= Background =
Line 15: Line 16:
 
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 -3dB for outgoing audio, and -15db for audio incomming to backplane.
+
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.
 
+
[[File:NetRoutingGain.png|500px|thumb|left|Gain and Limiter settings]]
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.
+
<br style="clear:both;" />
 
 
The NVRAM fields are: <br>
 
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.
 
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.
+
'''Gain''' can be set from -30dB to +30dB.
  
Limit is value 0 to 12, corresponding to 0 to 36dB below max range
+
'''Limit''' can be set from 3 to 36dB.
  
 
=Implementation notes=
 
=Implementation notes=
Line 44: Line 37:
 
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:
 
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 0100 2000 g711u '''3 0'''
  co2 3000 2100 g711u FFFD 5
+
  co2 3000 2100 g711u '''FFFE 0'''
 +
 
 +
==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
  
[[Category:AlphaCom E Software]]
+
[[Category:AMC Software]]
 +
[[Category:AlphaNet]]

Latest revision as of 14:46, 5 February 2018

AlphaCom icon 300px.png

(New from DSP SW 01.11 / AMCD 10.31)

Audio levels and gain on AlphaCom IP audio connections may be changed from AlphaPro. 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.

Gain and Limiter settings


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

Gain can be set from -30dB to +30dB.

Limit can be set from 3 to 36dB.

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 3 0
co2 3000 2100 g711u FFFE 0

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