A method and system for automatic gain control is provided. The automatic gain
control may be used, for example, with a microphone and voice codec of a speakerphone
telephone. In an exemplary embodiment, an amplification gain lookup table stores
the gain values. The power of the input signal is estimated and the appropriate
gain value is selected as a function of the estimated power of the input signal.
The gain value is applied to the input signal to provide an automatic gain controlled
output signal. In another embodiment, the gain lookup table may be adapted to compensate
for the non-linearity of the microphone and voice codec of the speakerphone. In
this alternate embodiment, the output power of the automatic gain controlled signal
is estimated and compared to a reference signal to generate an error signal. The
error signal may be scaled and used to update and dynamically adapt the gain values
in the gain lookup table.