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.