AGCLimiterCore
Overview
Gain computer used to realize soft-knee peak limiters
Discussion
The limiter core provides a peak amplitude follower and input/output gain transfer function for use in AGC systems. It is designed to take as its input the output of the AbsModule. The module outputs the time varying gain on the mono output pin which is typically used as input to the AGCMultiplierModule. The peak following amplitude detector and the gain transfer function are calculated at the sample rate, which aids in reducing the gain of fast transients.
The module stores the gain computed for the last sample in the block to the currentGain state variable. This variable can be examined to track the behavior of the limiter.
Type Definition
typedef struct _ModuleAGCLimiterCore
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
FLOAT32 threshold; // Amplitude level at which the AGC Limiter Core reduces its output gain value
FLOAT32 gain; // Value used to scale the output of the AGC Limiter Core
FLOAT32 slope; // Internal derived variable which holds the slope of the compression curve
FLOAT32 kneeDepth; // Knee depth controls the sharpness of the transition between no limiting and limiting
FLOAT32 ratio; // Slope of the output attenuation when the signal is above threshold - derived from the standard compression ratio parameter by the formula slope = 1.0 - (1.0/ratio)
FLOAT32 attackTime; // Envelope detector attack time constant
FLOAT32 decayTime; // Envelope detector decay time constant
FLOAT32 currentGain; // Instantaneous gain computed by the block
FLOAT32 sharpnessFactor; // Internal derived variable which is used to implement the soft knee
FLOAT32 attackCoeff; // Internal derived variable which implements the attackTime
FLOAT32 decayCoeff; // Internal derived variable which implements the decayTime
FLOAT32 envState; // Holds the instantaneous state of the envelope detector
} ModuleAGCLimiterCoreClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
threshold | float | parameter | 0 | -20 | -60:0 | dB |
gain | float | parameter | 0 | 0 | -24:24 | dB |
slope | float | derived | 0 | 0.75 | 0:100 | dB/dB |
kneeDepth | float | parameter | 0 | 2 | 0.1:60 | dB |
ratio | float | parameter | 0 | 4 | 0.1:100 | |
attackTime | float | parameter | 0 | 20 | 0.01:1000 | msec |
decayTime | float | parameter | 0 | 100 | 0.01:1000 | msec |
currentGain | float | state | 0 | 0 | Unrestricted | dB |
sharpnessFactor | float | derived | 1 | 0.5 | Unrestricted | |
attackCoeff | float | derived | 1 | 0.001041 | Unrestricted | |
decayCoeff | float | derived | 1 | 0.0002083 | Unrestricted | |
envState | float | state | 1 | 0 | Unrestricted | dB |
Pins
Input Pins
Name: in
Description: audio input
Data type: float
Channel range: 1
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: audio output
Data type: float
MATLAB Usage
File Name: agc_limiter_core_module.m
M=agc_limiter_core_module(NAME)
Creates a limiter gain computer with soft knee for use in Audio
Weaver. It is used in conjunction with the AGCMultiplier to
implement full limiter.
Arguments:
NAME - name of the module.