Automatic gain control, input signal is the sine wave(pink). Output is blue.
Configure with D.C and pot.
Currently has max gain of 62 (~10mV input) to 29 (0.5V input).
Anything beyond that begins distorting due to amplifier limitations (and MOSFET asymmetric conduction)
Working: Gain is RfĂ·Ri, Ri low initially as MOSFET kept on by D.C source. As output amplitude increases, D.C is offset and MOSFET conduction reduces, gain reduces