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?