I'm trying to make a quick-and-dirty voltage-controlled volume control circuit, using a minimal number of components.
A microcontroller is outputting two 5V p-p, 625 kHz PWM signals: an audio waveform and a volume control voltage. Instead of building a full VCA circuit, I'm trying to do something simpler:
First, filter the volume PWM output to get a DC signal. Then use the digital (unfiltered) audio PWM signal to switch the volume signal. The result should be the audio PWM waveform, with its amplitude scaled down to the level of the volume signal. Lastly, filter it to get an analog audio output.
My question: what circuit should I use to do the switching? Tried a 74HC4066, and it kinda works, but I don't want to use an entire 4066 for just one switch. I was also thinking about an optocoupler, but I'd need one with very high bandwidth. How about a MOSFET like the 2N7000? I don't know much about MOSFET switching circuits though.
Any other ideas? A software implementation is my last resort, I want to avoid degrading the audio signal as much as possible.
Best Answer
Yes, you can adjust the top of the PWM signal to effectively get volume adjustment. However, there are two problems with this:
I think a better scheme is to incorporate the volume control into the micro and produce the PWM already scaled to the desired volume. You can hook up a pot straight to the A/D input of the micro to give it volume input, and the rest is simple firmware. This has another advantage in that you can implement log volume if you want to. Log pots for the analog solution are getting harder to find nowadays, or more expensive when you do find them. Again, a digital processor can do this easily.