1
0
1
15
1
N + N z
H(z) =
2
D z
-
SLAS548C
– OCTOBER 2008 – REVISED APRIL 2011
continuously calculates the energy of the recorded signal. If the calculated energy is less than the set noise
threshold, then the AGC does not increase the input gain to achieve the target level. However, to handle
audible artifacts which can occur when the energy of the input signal is close to the noise threshold, the AGC
checks if the energy of the recorded signal is less than the noise threshold for a time greater than the noise
debounce time. Similarly, the AGC starts increasing the input-signal gain to reach the target level when the
calculated energy of the input signal is greater than the noise threshold. Again, to avoid audible artifacts when
the input-signal energy is close to noise threshold, the energy of the input signal must continuously exceed
the noise threshold value for the signal-debounce time. If the debounce times are kept small, then audible
artifacts can result by rapid enabling and disabling the AGC function. At the same time, if the debounce time
is kept too large, then the AGC may take time to respond to changes in levels of input signals with respect to
the noise threshold. Both noise and signal-debounce time can be disabled.
The AGC noise-threshold flag is a read-only flag indicating that the input signal has levels lower than the
noise threshold, and thus is detected as noise (or silence). In such a condition, the AGC applies a gain of 0
dB.
Gain applied by AGC is a ready-only register setting which gives a real-time feedback to the system on the
gain applied by the AGC to the recorded signal. This, along with the target setting, can be used to determine
the input signal level. In a steady-state situation
Target Level (dB ) = Gain Applied by AGC (dB) + Input Signal Level (dB)
When the AGC noise threshold flag is set, then the status of gain applied by AGC is not valid.
The AGC saturation flag is a read-only flag indicating that the ADC output signal has not reached its target
level. However, the AGC is unable to increase the gain further because the required gain is higher than the
maximum allowed PGA gain. Such a situation can happen when the input signal has low energy and the
noise threshold is also set low. When the AGC noise threshold flag is set, the status of AGC saturation flag
should be ignored.
The ADC saturation flag is a read-only flag indicating an overflow condition in the ADC channel. On
overflow, the signal is clipped and distortion results. This typically happens when the AGC target level is kept
high and the energy in the input signal increases faster than the attack time.
An AGC low-pass filter is used to help determine the average level of the input signal. This average level is
compared to the programmed detection levels in the AGC to provide the correct functionality. This low-pass
filter is in the form of a first-order IIR filter. Two 8-bit registers are used to form the 16-bit digital coefficient as
shown on the register map. In this way, a total of 6 registers are programmed to form the three IIR
coefficients. The transfer function of the filter implemented for signal level detection is given by
(1)
Where:
Coefficient N0 can be programmed by writing into page 4 / register 2 and page 4 / register 3.
Coefficient N1 can be programmed by writing into page 4 / register 4 and page 4 / register 5.
Coefficient D1 can be programmed by writing into page 4 / register 6 and page 4 / register 7.
N0, N1, and D1 are 16-bit 2s-complement numbers and their default values implement a low-pass filter
with cutoff at 0.002735
× ADC_fS .
See
Table 3 for various AGC programming options. AGC can be used only if the analog microphone input is
routed to the ADC channel.
Table 3. AGC Parameter Settings
Control Register
Function
Bit
Left ADC
Right ADC
AGC enable
Page 0 / register 86
Page 0 / register 94
D(7)
Target Level
Page 0 / register 86
Page 0 / register 94
D(6:4)
Hysteresis
Page 0 / register 87
Page 0 / register 95
D(7:6)
Noise threshold
Page 0 / register 87
Page 0 / register 95
D(5:1)
Max PGA applicable
Page 0 / register 88
Page 0 / register 96
D(6:0)
Time constants (attack time)
Page 0 / register 89
Page 0 / register 97
D(7:0)
Time constants (decay time)
Page 0 / register 90
Page 0 / register 98
D(7:0)
Debounce time (noise)
Page 0 / register 91
Page 0 / register 99
D(4:0)
28
Copyright
2008–2011, Texas Instruments Incorporated