Back at the previous job, I supplied customers with literature, samples, and excellent applications help regarding the use of DCPs (digitally controlled potentiometers). I remembered a zany idea I'd had back then when I saw a recent press release from Microchip about its new series of DCPs (the MCP41HVX1). The parts would work with signal voltages of ±18V and could settle to a new setting in around 5ÎĽs — perfect for audio.

My zany idea was this: Use the pot to adjust the level of audio (not especially unique) but do that based on its level (somewhat more unique). The intent here is to make an automatic level control (ALC) or an automatic gain control (AGC), two slight variations on a well-known circuit function.
Normally, this is done in a purely analog function. You monitor the audio level with a circuit that produces a DC voltage proportional to the average level of the audio. A precision full-wave rectifier circuit followed by a simple RC filter will work, though you have to tinker with the time constant to optimize performance. Then, use that control voltage to act upon some sort of a voltage variable gain control cell. That can be done several different ways.
You could use an incandescent lamp or an LED shining on a CdS photocell as a voltage-controlled variable resistor. Or you can use an N-channel JFET similarly. It's fairly linear as long as you keep the drain-to-source voltage quite low. Use either of these as part of an op-amp gain stage. There's the Gilbert cell. There are (or were) a few ICs available that were intended as combination microphone preamps and AGCs.

My plan was to use a small microcontroller (MCU) that had a built-in ADC and SPI port. I'd use the ADC to monitor and digitize the audio. Or if there were bandwidth/processing speed limitations in the MCU, I'd add a similar circuit to that one described above to rectify and filter the audio and then digitize what would be a slowly varying DC voltage. I could probably use a much shorter time constant than in the all analog version. Then, the SPI bus would tell the DCP what setting to go to.
This would eventually become part of some guitar stompbox widget that I was (or perhaps still am) working on. Some advantages of this design: I'm not dependent on a sole manufacturer of an AGC IC. I can tweak the “RC” time constant called out above via software changes as needed — adjusting attack and release time would be very easy.
A disadvantage: I'd have to write code. Unless I can get Max Maxfield or Rich Quinnell to do that part for me.
So, let me know if this would work or not.
Brad,
  The idea is really awesome, but it will be more of hardware controlled gain.  To adjust the gain, everytime I would have to rotate the pot.  It will be very difficult to adjust the gain using software.
@ Brad – Clever idea, Brad. Anything with a multiplier in it gets my attention.
I am presently using the MCP4131-103 (10 kohm) as a gain adjustment in a pulse generator isolation amplifier. My only concern about its performance was whether it would bandwidth-limit (or in this case, risetime-limit) the response because of parasitic IC capacitance. It seems to be okay in my case (at a couple of microseconds risetime, at 5 A out), though I would like to see Microchip and others provide some dynamic parameter specs on these kinds of devices so that we can use them in faster (and faster) circuits.
Ultimately, the fastest variable-gain circuits are translinear circuits (Barrie Gilbert, again) as used in oscilloscopes.
Brad,
Even Microchip suggests gain adjustment through it its digipot ics in its app notes for opamps.
However, you may not get a smoothly varying cotrol as these are taps on a larger resistor, though equispaced.
It would be more convenient to have a good FET in the feedback loop and adjust its  gate voltage and hence drain-source resistance by PWM or DAC from a microcontroller. This would give the much needed seamless audio level control.
Vasan,
  But I believe that using the DAC and generating a PWM control signal would be a costly solution..
Brad is a good idea,
Jkasan, it would make the whole using a PGA control is a power circuit to output amplified?
Maybe the control is more easy.
@JK – I could do this with the JFET, of course – I'm just looking at different ways to do this, and maybe find a way that doesn't require selecting and matching FETs – assuming I want to make several channels and have them perform the same way.
Yep – Barrie's multiplier ckt is pretty sweet. I was looking for something lower cost and not as high performance (as I didn't need especially high performance).
amrutah,
DACs are nowadays built-in inside mcus. This way, the pricing is shared by the chip on the whole.
PWM is the cheapest way of generating analog voltage just with an RC network and a buffer amp. It has its own shortcomings, though.
Maciel,
PGAs are good. But they do not provide continuously variable gains. You may get x1,x2,x4,x8 and so on.
Nowadays ADCs and MCUs are with PGAs inside.
Brad,
I missed it. Multi-channel gain adjustments may result in variations if FETs are unmatched.
What is the step resolution of gain you are targetting?
Correct JKASAN,
Even with a control curve would be too inaccurate to use them,
The best solution is then MCU+DIGITAL POT + Â OPAMP + POWER DRIVER?
Â
Â
@JK – Probably 1 or 2dB per step – wouldn't need to be especially fine steps and wouldn't need to be that many steps – just intended for a guitar gadget.
Brad,
May be what I am going to suggest is not a right one.
Is it possible that a common voltage is generated combining each channel output and fed to the amplifier as a ??common mode voltage?? This would normalize all channels to the same dB.
I am referring to a technique used in ECG amplifier – it is for getting better CMRR , though.
Â
Maciel,
The combination you mentioned could be anytime the right one as it gives the much needed flexibility. You could implement digital filters on the fly. Calibration can be done without any trimpots to turn. However, if you ask me about the clarity of sound and user experience, I would always support a full analog system as its performance is unbeatable in many ways.
I love my AM valve radio.
@Jayaraman you have a point here but there are still plenty of good reasons why some like digital pot, the space constraints and reliability issues of a analog system is just an immediate issues. Today a common volume-control interface for modern devices like gadgets buttons, this provides an inexpensive, useable solution without a bulky mechanical pot and much reliable.
@Jayaraman, DCP offer a much greater advantages for audio volume control applications, especially in mobile devices like smartphones or even AM/FM radios, it can replace those bulky mechanical pots and meet those mechanical tracking issue found in analog system.Â
Â
Â
Â
Â
I remember when the digital pots came out and they started to get me thinking of the fun stuff to develop. The software development stopped me as well. Going back years further, I was involved with developmental concepts using optics for feedback for a lamp. I will put this down as part of my blog list to do.