Simple PWM volume controller. Could it work?

Hello I have once read in a book (which of course I can't find anymore) about a direct PWM volume controller. The idea is that you simply take the audio and chop it with a high frequency, variable duty cycle signal. Then you use some type of low pass filter, to get rid of the high frequency component, and that's it: the output signal equals the input signal (theoretically no distortions), scaled by the PWM ratio.

The schematic could be something like this:

4066 analog switch C / || input *-----/ ------------||---+----* output | || | | \ | R / 200khz | \ ---------------- | | PWM generator| GND ---------------- | | | | V | --\/\/\/-- Volume potentiometer

The advantage is that you can add any number of channels on the same PWM signal (I need 5), and they are completely synchronized. I would like to implement such a volume controller, do you think it could work? (if anyone knows a similar design, I would appreciate it, no point in reinventing the wheel.) I was thinking of using a 555 for the PWM generator, but I don't think it's a good idea, because I don't have the full range 0-100%. Especially the lower limit, there must be a setting on the potentiometer that gives 0 V on the PWM output, no audio is getting through, silence. Also, what do you think about the output filter? Choosing for the simple RC filter values that give no more than 3dB drop at 20 KHz, gives a 22 dB reduction of the 200 kHz signal. Strictly speaking, the 200 KHz signal would be exactly 22 dB below the audio signal. If the 200 KHz signal gets into amps and speakers, is there any danger? Because then I would have to use a more complex filter, and i want a low cost solution. Should I aply any bias on the 4066, to get low distortions? Thank you.

Reply to
Stelian Ene
Loading thread data ...

You should either apply bias to the 4066 or you should use another switch that can accept +/- supplies.

You should use more than an RC filter on the output -- I'd at least use a pair of RC's, or better yet an active filter if I had the board space. You should also think seriously about whether there's any high-frequency noise on the signal going into the switch that may get aliased down into your audio range, and whether you need to low-pass the stuff going into the control.

Reply to
Tim Wescott

I recall discussion of this technique in a Popular Electronics article, circa late '70's to 1980 (when I was in college), in the context of VCA's and VCF's for music synthesizers. Yes, this will work, but there are problems. One I recall is the excessively narrow pulse width you need for the lower end of the volume scale (hearing is logarithmic, so just like a regular linear potentiometer used as a volume control, most of your volume change will be over the low end of the PWM control).

That's a good idea, but your circuit shows a high-pass filter. Swap the R and C and it should work much better as a low-pass filter. :)

I'd use an integrator and a comparator as a Schmitt trigger circuit to generate a triangle wave, then run that and your "volume control" voltage into the inputs of a comparator. This output would then be the PWM for the 4066. There could be variations in the generated waveform, but running it and a DC voltage into a comparater is a standard technique to generate PWM.

Not if it's at a low enough level. Assuming the amp passes it, it would heat up and posssibly burn out the tweeter voice coil. If it's a ceramic tweeter, it will just make all the dogs in the area wail.

Yes, you should insure that the audio signal stays within the power and ground pins of the 4066, most preferably midway between. You can run it from a dual-voltage +7.5V and -7.5V power supply, with the ground going to the audio ground. Your PWM circuit could run on this same supply, or you could use a voltage translater circuit (it would take a transisor or two) to get the PWM to the +7.5 and =7.5V of the

4066 input. There are better analog switches that run on +/-15V, and have other features that would be advantageous in this application (faster switching, less charge injection), but of course they cost more than the 4066. Check out
formatting link
for one manufacturer.
Reply to
Ben Bradley

The idea is fine, but that circuit is tricky as drawn. Eliminate the capacitor, and it's cleaner. Then of course add the lowpass filter downstream.

Better, actually, would be a SPDT switch, switching the output between the input signal and ground. A better switch than the ancient 4066 would be good, too. HC4053, or a higher-end Maxim mux maybe.

This of course gives output that's linear on duty cycle, and audio prefers a log shape, which implies very low duty cycles on the low end.

This trick has been used in precision analog multipliers and square-root circuits for ages.

John

Reply to
John Larkin

There are much better switches, which inject far less charge into the audio channel than a 4066. You could also consider an EPOT, which allows direct digital control of a resistor/potentiometer.

Reply to
Adrian Jansen

Ok, I did some simulations, and 2 sequential RC filters, matched on the same cut-off frequency, give an attenuation of 43dB at 200Khz, and a phase distortion of 60 deg at 20 kHz (a single cell gives 30 deg). What would the effects of phase distortions (equal on all channels) at high frequencies could be?

Hmm... never thought about it :) This is certainly an issue.

Do you mean the control pin of each switch or the dc volume control of the PWM generator? I don't think the control pins are vulnerable to H.F. noises because they have low impedance and short circuit lengths (unlike the audio input). Instead I was thinking of adding an inverter series with each control pin, to get a lower crosstalk between the channels via the common PWM signal.

Reply to
Stelian Ene

"Ben Bradley" wrote

I'm aware of this. I will try to design a stable linear PWM generator, and simply use a logarithmic potentiometer to control it.

What the ...!? :) I think I was to busy creating ascii art to actually look at the result !

I think the limit of the dogs hearing is about 60KHz, while bats can reach up to 100KHz.

Reply to
Stelian Ene

That really depends on the level of fidelity you're looking for. Audiophiles insist that the phase response of a system is important up to high frequency (sane ones say 20kHz or so, the nitrogen-dipped

0.99999% pure copper wire crowd says DC to light). If you're truly going for "inexpensive" you probably won't notice it.

I mean the audio input to the control, to block a presumed high-frequency signal.

Reply to
Tim Wescott

And as an additional note, if the load is a cap, you have a switched resister filter, i.e. a VCF.

Kevin Aylward snipped-for-privacy@anasoft.co.uk

formatting link
a very affordable Mixed-Mode Windows Simulator with Schematic Capture, Waveform Display, FFT's and Filter Design.

Reply to
Kevin Aylward

-snip-

Elektor electronics published a circuit for this in the 80's IIRC it was one of their bumper summer issues- I remember trying it and being singularly unimpressed- Try Googling for the project cds they pressed.

Reply to
Anthony C Smith

"Adrian Jansen" wrote

Any sugestions? Why is the charge injection important in this aplication?

Reply to
Stelian Ene

I'm not sure you understand the issue. To get 40dB of gain reduction (the bare minimum you need from a volume control), you need a duty cycle of 1%. Assume your basic switching frequency is something sufficiently supersonic that it is easy to filter out of the audio, perhaps 100kHz. Then the total cycle time is 10us. So, you're talking about an "on" pulse duration of

100ns. Have you looked at the turn-on and turn-off times of the 4066?

And, if you're controlling all this from a pot anyway, why bother? Why not just pass the audio through the pot? Or, if you need the pot to be remote, use a VCA.

Reply to
Walter Harley

In principle, this scheme can be made to work exceptionally well. For example, Barry Blesser used it in the big EMT studio limiter many years ago (can't recall the model number, sorry). It cost several thousand dollars, and worked flawlessly. Its circuit was also quite complex. IIRC, a much simpler incarnation of the same idea was used in at least one of the old guitar effects boxes from the 1970's. It was the Electro-Harmonix Black Finger, to the best of my memory. You may be able to find the schematic for it on the web somewhere.

Brian Aase

_______________________________________________________________________________ Posted Via Uncensored-News.Com - Accounts Starting At $6.95 -

formatting link
The Worlds Uncensored News Source

Reply to
user

Could generate a log sawtooth. Perhaps something like

V+ V+ | .-. | | | .-. | | R4 .------------------. | | '-' | | | | R2 | | | '-' | | |\| | | | '-|-\ ___ | | |\| | | >-o----|___|--o-----o----------------|-\ o----------+/ | R1 | | >- | |/| | | .----|+/ | | | | |/| | | --- | | | --- | o------->|-----o | | | | | .-. === Control V | | GND | | R3 '-' | === GND Make R1

Reply to
GPG

Reply to
Winfield Hill

Look in any of the manufacturers datasheets, eg Maxim, Linear Technologies, Analog Devices. They all make 'audio' CMOS switches, designed for low charge injection. They also make zero crossing switches, which internally sense the zeroes, and only switch there. But of course that wont work for a PWM gain control.

I have no idea what the noise requirements were in the OP's application, but in general if you want level control using PWM over a reasonable control range, eg 60 dB or so, think about what happens at the low level end, where switching the FETs injects several mV of effectively random noise into your signal path. Its instructive to hook up something like a 4066 and switch it, watching what happens on the signal lines with a 'scope. While you draw them as simple switches, the reality is different.

Reply to
Adrian Jansen

Technologies,

I have never tried this, but don't finite rise and fall times cause distortion?

Tam

Reply to
Tam/WB2TT

In article , Tam/WB2TT wrote: [CD4066 as PWM gain control for audio]

Yes but not, perhaps, as bad as you would think. The distortion happens when the switch is partially on. The system gain in this case is less that after the switching is finished so the distortion is deleveraged.

The CMOS switches are also non-linear with respect to any current flowing in them and the voltage of the signal channel. To minimize these effects, you want to not have any current flowing in the switch.

Reply to
Ken Smith

Thanks. I just wanted to know, in case I ever wanted to do this. I guess the worst case with a series switch would be if the switch was arranged so that the signal amplitude affected the threshold.

Tam

Reply to
Tam/WB2TT

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.