[an error occurred while processing this directive]
|
int agc(int sample, int *pDetector)
{
int temp, temp1; long int out;
// peak detector
temp = abs(sample);
*pDetector *= AGC_TIMING_CONST;
if (temp>*pDetector) *pDetector = temp;// int __norm(int) - returns exponent of input.
// count of non-significant zeros/ones.temp = __norm(*pDetector);
// gain - sharp
temp1 = sample << temp;// gain - precise
out = temp1 * AGC_TABLE[(*pDetector << temp) >> 8];return out >> 15;
}
в AGC_TABLE - 128 значений 1/x в Q15
E-mail: info@telesys.ru