Hello, I need a little advise for a little project. I need to build a smart(with automatic gain control) amplifier with the following characteristic: When the output voltage swing exceeds an external limit set by the user (Vref), amplifier decreases its gain such that the output voltage swing remains aroud Vref. The circuit is supposed to be operating up to 20 kHz and maximum gain should be 40. Supply voltages are +5 and -5 volts. Min Vref=100mV and maximum deviation can be 5%. Thank you for your help.