A classic old circuit from the wayback machine. If you really want to build something from scratch, this will work. FYI, adafruit, ebay, et al have low cost AGC modules. Some are based on a single-chip AGC part made by Maxim.
1. A transformer will work, but you don't need one. Each of the...