# Auto Audio Gain Control IC for normalized audio from line level input

The problem I am having is like this: I am using an aux cord line level output from a smartphone to a MSGEQ7 chip which samples the frequencies and splits it into 7 channels which can be seen as an analog voltage from 0V to Vin based on that frequencies strength. 63Hz, 160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz and 16kHz. (Sparkfun info) I am using an Arduino to then take the output and display it on 7 bar graphs.

Now the problem... Unless the output is at around 80% volume, any song playing will either not be strong enough to be displayed, or too far over and will be clipping the top of each bar graph. Unfortunately I don't own an oscilloscope so I can't give the peak to peak voltage. This would be ok if I could always leave the volume at 80% but in this case its much easier to turn down the voltage on my phone rather than going over to the speakers and turning down or up the preamp knob. Ideally at any input volume the signal would be either boosted or decreased to the sweet spot.

I've researched a bunch of different solutions from diode/npn circuits to multi op-amp circuits, to Compandor (compressor/expander) chips like the NE570 (but far too expensive), but I'm not sure what would actually work for my solution. I don't need high fidelity, but I also don't want to lose sensitivity for high and low frequencies. (Is this normalization or dynamic range compression?) I have used the Adafruit auto-gain microphone which uses a MAX9814 which offers an output of 2V peak to peak and a DC offset of 1.25V and it works great, but I'd also like to be able to use an aux cord in.

• Welcome to EE.SE. What you are learning is that your ear has a logarithmic response to volume but your micro's input is linear. You need to get a logarithmic amplifier between your signal and your analog input. – Transistor Jun 30 '17 at 18:06
• Precisely. How would the amplifier be controlled? Would there have to be some type of feedback to control gain? – Mariano Elia Jun 30 '17 at 19:12
• Have a look at giangrandi.ch/electronics/vu-meter/vu-meter.shtml which shows a passive VU meter. If you were to omit the capacitor would it do what you want? – Transistor Jun 30 '17 at 19:24
• In what way is the NE570/71 too expensive? - It is only a couple of dollars, not much more than the Maxim part. It is obsolete though. The MAX9814 only has 20dB of control range in its AGC. – Kevin White Jun 30 '17 at 20:47
• Well the NE570 is $7.56 CAD (compared to$2.34) which is more than I'm willing to spend. if there is a solution which costs far less I'd be more interesting exploring it vs. the other. – Mariano Elia Jul 2 '17 at 3:54