# Auto Gain control circuit idea

I am trying to make an Auto Gain control circuit.

Having any input source's voltage the same.

For example my latop outputs around 1.36Vrms @ 1khz and my iPhone outputs around 0.962Vrms @ 1khz

Regardless of input source I want the input voltage to be around the same as the laptops.

The idea is convert the input signal into a DC signal to essentially map it out. Compare the DC signal the Vref ~=500mV. The comparator will output from 0V to 1V, depending on that it will turn on the respective transistor. One transistor will be a voltage follower and will not doing anything if (V+ > V-) and if (V- > V+) then it will go to the respective transistor and go through an active op amp with a negative feedback containing a digital pot controlled by an ardunio. Using the negative feedback equation the arduino will calculate a value for the R2 resistor (Digital pot) and make it so the voltage will become 1.32Vrms using the equation R2/R1 + 1.

1 - I am not sure if this will work due to how an audio signal isn't a constant amplitude.

2 - For the full bridge rectifier since the voltage of the iphone out is already so small, I believe the Forward Voltage drop of the diode will ruin the idea of it.

3- Is this even possible?

simulate this circuit – Schematic created using CircuitLab

• Possible but distorted by compression noise. A suitable attack/decay times low pass filter must be selected using an OTA to control gain with a Vref for Vpeal Commented Jun 22, 2018 at 5:53
• Glad is possible, however I am still worried about the full bridge rectifier, if the voltage drop is lets say ~1.4V how would that work out? 0.962V * sqrt(2) = 1.36 -1.4 = -0.04? so I guess zero volts at the output?
– Leoc
Commented Jun 22, 2018 at 5:58
• They used to make AGC circuits before there were Arduinos and digital potentiometers. Maybe take a look around and see if you can locate an old circuit.
– JRE
Commented Jun 22, 2018 at 6:00
• A bridge rectifier is probably not a good way. What you'd want is more like an "ideal diode" made from a regular diode and an opamp.
– JRE
Commented Jun 22, 2018 at 6:01
• Ahh like a precision rectifier circuit? Oh I have tried looking for one can't really find any that explains it well sadly.
– Leoc
Commented Jun 22, 2018 at 6:03