Wave Arts VQE  1.00
Voice Quality Enhancement
Classes | Defines | Typedefs | Enumerations | Functions
AutoGain.h File Reference

Automatic Gain Control (AGC) More...

#include "EQ.h"

Go to the source code of this file.

Classes

struct  AutoGainParam
 AutoGain parameters. More...
struct  AutoGain
 AutoGain runtime structure. More...

Defines

#define kAutoGainClipDb   -3.0
#define kAutoGainOKDb   -21.0
#define kAutoGainLowDb   -36.0
#define kAutoGainIncrTime   1.0
#define kAutoGainDecrTime   0.200
#define kAutoGainIncr   0.05
#define kAutoGainIncrThresh   0.20

Typedefs

typedef void AutoGainSetGainFn (void *arg, int isIncr, float incr)
 Callback to adjust gain.

Enumerations

enum  AutoGainLevel {
  IGNORE_LEVEL, LOW_LEVEL, OK_LEVEL, CLIP_LEVEL,
  NUM_LEVEL
}

Functions

AutoGainAutoGainNew (AutoGainParam *param, AutoGainSetGainFn *fn, void *arg)
 Create AutoGain object.
void AutoGainDelete (AutoGain *p)
 Destructor.
void AutoGainProcessShort (AutoGain *p, short *input)
 Process short samples.
void AutoGainProcessFloat (AutoGain *p, float *input)
 Process float samples (-1.0 to +1.0)
void AutoGainProcessPeakVal (AutoGain *p, float peakVal)
 Process peak value.
void AutoGainSetThresh (AutoGain *p, float clipDb, float okDb, float lowDb)
 Set thresholds.
void AutoGainSetUpdateTimes (AutoGain *p, float incrTimeSec, float decrTimeSec)
 Set update times.
void AutoGainReset (AutoGain *p)
 Reset to initial condition.
void AutoGainGetDefaultParam (AutoGainParam *param)
 Get default parameters.

Detailed Description

Automatic Gain Control (AGC)


Define Documentation

#define kAutoGainClipDb   -3.0

decrease gain above this

#define kAutoGainDecrTime   0.200

min time between gain decreases

#define kAutoGainIncr   0.05

20 gain steps

#define kAutoGainIncrThresh   0.20

20% of buffers low without ok will increase

#define kAutoGainIncrTime   1.0

min time between gain increases

#define kAutoGainLowDb   -36.0

levels below this are ignored

#define kAutoGainOKDb   -21.0

increase gain between low and ok


Typedef Documentation

typedef void AutoGainSetGainFn(void *arg, int isIncr, float incr)

Callback to adjust gain.

Parameters:
arguser specified argument
[in]isIncrtrue if increment, false if decrement gain
[in]incrincrement, typically 0.01 to 0.10

The function should never decrease gain to 0 because this can mute! AutoGain never learns the actual volume level, it simply requests that it be raised or lowered by the incr amount specified in the parameters.


Enumeration Type Documentation

Enumerator:
IGNORE_LEVEL 

level below low

LOW_LEVEL 

level beween low and ok

OK_LEVEL 

level between ok and clip

CLIP_LEVEL 

level is above clip

NUM_LEVEL 

number of histogram bins


Function Documentation

void AutoGainGetDefaultParam ( AutoGainParam param)

Get default parameters.

Parameters:
[out]parampointer to parameter object to initialize

Caller must set up numChan, sampRate and framesPerBuf.

AutoGain* AutoGainNew ( AutoGainParam param,
AutoGainSetGainFn fn,
void *  arg 
)

Create AutoGain object.

Parameters:
[in]paramparameters
[in]fncallback function
[in]argargument to callback function

Returns AutoGain object.

void AutoGainProcessFloat ( AutoGain p,
float *  input 
)

Process float samples (-1.0 to +1.0)

Parameters:
pAutoGain object
inputpointer to samples
void AutoGainProcessPeakVal ( AutoGain p,
float  peakVal 
)

Process peak value.

Parameters:
pAutoGain object
peakValpeak value, 1.0 is 0 dBFS

Internal function to process peak value of buffer.

void AutoGainProcessShort ( AutoGain p,
short *  input 
)

Process short samples.

Parameters:
pAutoGain object
inputpointer to samples
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines