Digitally controlled "volume control"

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here's the idea, to wire up an R2R network, followed by an inverting op-amp stage. There's some resistor in the feedback loop and a resistor between the R2R and the inverting input. The gain of the op-amp is fixed and effectively I control the loudness of the audio signal by how much I attenuate the input signal to the resistor of the inverting input using the R2R network.

I thought to feed the audio signal into the R2R resistors, the more resistors that get fed the signal the stronger the signal will be. However I am not sure what to feed a resistor that I don't want to get signal? Short it to GND? DC? What else?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can certainly build your own, but there are chips out there that do this for you.

Some are voltage controlled gain, and can be controlled with a pot, DAC, filtered PWM, etc.

Others have a digital input to control the gain.

One can, of course, also use a digital pot to simply building this on your own.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A PGA (I think that is what they call them) is an option, however using my existing hardware, how should implement the R2R network to control my audio signal? I guess I input the audio to the resistors and short with MOSFETS resistors that I don't want to have input signal? Or perhaps introduce high impedance using LDRs?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A multiplying dac such as the venerable dac0800 can be used as a gain control. Rather than r2r, it would be easier to implement a weighted resistor network as the resistor from 0v to the inverting input.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm not sure I understand how is this being used to set gain of an analog audio signal I have ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A programmable gain amp has gain, but I bet you want a programmable attenuator. If you already have a nice line level audio stream coming out of the cd, its normalized to use the full range of the dac, and the peaks are all the way up. You want to turn em down. Search for "log dac"

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

'Google' for "digital potentiometer".

There's lots to choose from. The Microchip MCP41010, for example, is an SPI connected device that costs less than 6 shekel.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I once saw a very interesting and creative way of (mis-)using a DAC to control analog voltages, i.e. use it as an audio level controller.
Normally you would apply a fixed reference voltage to the DAC, and a digital value to its input which it happily converts into the analogue equivalent of the digital value with respect to the fixed reference voltage.
Now, if you instead apply the audio voltage as the reference voltage, you can digitally control the output level by applying a digital value to the DAC input. Add an up/down counter at the input and you're all set with audio level control!

I don't know if this would work as well with a simple R2R network with the audio level applied to the "upper end" of the network, but it's worth a try.

Einstein was right: "Two things are unlimited: the universe and the human stupidity. But i'm not quite sure about the former..."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's how multiplying d/a converters work. The analog output is the product of the reference (analog input) and the digital input. Multiply anything by digital 0 and the out is 0. Multiply anything by 0b1111 1111 and its wide open.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, if that's common knowledge, then my previous reply is just another sign of my ignorance in way too many subjects. I was just astonished that a reference voltage could be something dynamic, not just a static and high-precision voltage reference.

Einstein was right: "Two things are unlimited: the universe and the human stupidity. But i'm not quite sure about the former..."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have the DAC802 (if I remember correctly) on the way as well as some (cheap) devices from ADI. Looks pretty easy to use. I wanted to build the same device using resistors and some MOSFETS, don't know why it could not work?