Document toolboxDocument toolbox

(8.D.2.6) AGCAttackReleaseFract32

Overview

Multi-channel envelope detector in Fract32 with programmable attack and release times

Discussion

Envelope detector used in dynamics processor. The module accepts an N-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.

Type Definition

typedef struct _ModuleAGCAttackReleaseFract32 { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure FLOAT32 attackTime; // Speed at which the detector reacts to increasing levels. FLOAT32 releaseTime; // Speed at which the detector reacts to decreasing levels. fract32 attackCoeff; // Internal coefficient realizing the attack time. fract32 releaseCoeff; // Internal coefficient realizing the release time. fract32* envStates; // Vector of sample-by-sample states of the envelope detectors; each column is the state for a channel. } ModuleAGCAttackReleaseFract32Class;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

attackTime

float

parameter

0

2

0.01:1000

msec

releaseTime

float

parameter

0

100

0.01:1000

msec

attackCoeff

fract32

derived

1

0.01036

Unrestricted

 

releaseCoeff

fract32

derived

1

0.0002083

Unrestricted

 

envStates

fract32*

state

1

[1 x 1]

Unrestricted

 

Pins

Input Pins

Name: in

Description: audio input

Data type: fract32

Channel range: 1

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: audio output

Data type: fract32

MATLAB Usage

File Name: agc_attack_release_fract32_module.m

M=agc_attack_release_fract32_module(NAME, NCHAN) Envelope detector with programmable attack and release time constants. Arguments: NAME - name of the module. NCHAN - initial number of channels. Copyright 2009 to 2014. DSP Concepts, Inc. All Rights Reserved.

Â