ExpanderCore
Overview
Upward and Downward Expander module with programmable attack and release time constants
Discussion
Envelope detector used in dynamics processor. The module accepts a mono channel buffer of amplitude and produces an output buffer the same size as the input. An envelope detector is applied to the input that has programmable attack and release times. The attack time applies when the current input value is larger than the state of the envelope detector. Similarly, the release time applies when the current input value is smaller than the state of the envelope detector. The expander increases or decreases the output gain based on the value and sign of ratio when the input energy level is below the threshold.
Type Definition
typedef struct _ModuleExpanderCore
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 plot; // When true, plots Gain and Static curves.
FLOAT32 attackTime; // Speed at which the expander reacts to increasing levels.
FLOAT32 releaseTime; // Speed at which the expander reacts to decreasing levels.
FLOAT32 threshold; // Input energy level at which the expander changes outpupt gain.
FLOAT32 ratio; // ratio of output energy to input energy, a negative value indicates an upward expander.
FLOAT32 kneeDepth; // Specifies the curvature of the smooth region connecting the two line segments
FLOAT32 maxGain; // maximun output gain
FLOAT32 minGain; // minimun output gain
FLOAT32 slope; // left slope of gain curve.
FLOAT32 attackCoeff; // Internal coefficient realizing the attack time.
FLOAT32 releaseCoeff; // Internal coefficient realizing the release time.
FLOAT32 envState; // Previous state of evelope detector
FLOAT32* kneePoly; // Derived variable for interpolating the soft knee for Gain Curve
FLOAT32* kneePolyS; // Derived variable for interpolating the soft knee for Static Curve
} ModuleExpanderCoreClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
plot | int | parameter | 0 | 0 | 0:1:1 | |
attackTime | float | parameter | 0 | 2 | 0.01:1:1000 | msec |
releaseTime | float | parameter | 0 | 100 | 0.01:1:1000 | msec |
threshold | float | parameter | 0 | -20 | -100:0.1:100 | dB |
ratio | float | parameter | 0 | 0.2 | -1:0.01:1 | dB/dB |
kneeDepth | float | parameter | 0 | 3 | 0:0.1:20 | |
maxGain | float | parameter | 0 | 20 | 0:0.1:100 | dB |
minGain | float | parameter | 0 | -20 | -100:0.1:0 | dB |
slope | float | derived | 1 | 4 | Unrestricted | |
attackCoeff | float | derived | 1 | 0.01036 | Unrestricted | |
releaseCoeff | float | derived | 1 | 0.0002083 | Unrestricted | |
envState | float | derived | 1 | 0 | Unrestricted | |
kneePoly | float* | derived | 1 | [1 x 3] | Unrestricted | |
kneePolyS | float* | derived | 1 | [1 x 3] | Unrestricted |
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: expander_core_module.m
M=expander_core_module(NAME)
Upward and Downward Expander module with programmable attack and release time constants.
Arguments:
NAME - name of the module.
Author: Darrel Judd