PWM filter

Started by StephenGiles, June 13, 2004, 12:56:53 PM

Previous topic - Next topic

StephenGiles

"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

Rob Strand

Compare that to the MXR envelope follower....
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Zero the hero

I was always afraid of asking it, but... wha exactly is Pulse Wave Modulation? I've found this word too many times without knowing what it means...

Mark Hammer

Quote from: Zero the heroI was always afraid of asking it, but... wha exactly is Pulse Wave Modulation? I've found this word too many times without knowing what it means...

Simple enough that when it gets explained, you will almost be embarrassed that you asked.

A triangle wave spends half its time going up and half its time going down.  A square wave spends half its time *being* up and the other half *being* down (with a very small amount of time used for *going* up and down).

If, without changing the frequency, you change how much time it spends *being* up then you automatically change how much time it spends being down.  So, if it spends 10% of the time being high, then the other 90% of the time in each cycle is spent being low.  As the proportion of time spend being high/low is varied the "width" of that time period on a scope will change.  This is why it is referred to as Pulse width modulation.

For an oscillator, changes in the width/time of the positive and negative half-cycles will produce different sorts of patterns of harmonics.  When that square/pulse wave is used to control other things, changes n the width of either the positive-going or negative-going half cycle will cause those other things to be "on" or "off" different amounts of time.

In the case of this filter for which the link is provided, the CMOS switch section is being turned on and off by the pulse generator.  As the pulse width gets wider, the switch stays closed for a longer period of time on each completed cycle of the clock (pulse-up/pulse-down).  In this instance, that switch is placed in parallel with a fixed resistor (220k).  The actual effective resistance is a combination of that fixed resistor and the average amount of time the switch stays closed.

What?

When the switch is open, the combined resistance is just a bit below 220k (megs and megs in parallel with 220k gets you just a bit less than 220k).  When the switch is closed, the combined resistance is whatever the switch resistance of the CMOS section is (usually well below 500R) in combination with 220k.  Leave the switch off for longer periods of time (narrower pulse width) and the resistance moves in the direction of 220k.

In this application the entire circuit behaves as if you had a standard 4-pole lowpass filter and a quadruple-ganged 220k pot  Two pot sections would go where R6/R8/AS1/AS2 go and two sections would go where R10/R12/AS3/AS4 go.  As the resistance of each section increases, the rolloff frequency of the filter drops.

Since it is comparatively easy to find 1% fixed resistors, and comparatively hard to find a quadruple-ganged pot, let alone one which has all 4 sections matched along the entire rotation, use of pulse-width modulation here provides a multi-pole filter with far superior tracking and rolloff accuracy along its full range, and much lower cost and size.

The MXR Envelope filter uses a similar approach, although it uses a different filter type.  The Ross and MXR analog delay pedals use PWM-based filtering to track the delay time.  Because the same clock that  steps the BBD through its paces can also be harnessed to the CMOS switches, you can get the filter to adjust its bandwidth to whatever is sensible for that delay time.  VERY clever.

Zero the hero

Thanks!
Now now I've got amore clear idea...

Boofhead

The correct name for these types of filters is "switched conductance filters".    They aren't called switched resistance filters.  Conductance is the reciprocal of resistance and it turns out the conductance is proportional to the on time.

Paul Perry (Frostwave)

I have found a difficulty wiht PWM filters, in getting a wide enough range of operation. I find it difficult at the 'narrow' end of the range to get the timing exact. Fo9r a phaser, an on/off ratio of 20 to 1 is cool, but if you want to have a filter sweeping most of the audio band, you need much more.

gez

Quote from: Paul Perry (Frostwave)I have found a difficulty wiht PWM filters, in getting a wide enough range of operation.

Amen!  I drove myself mad for a few weeks trying to get decent (linear) range.
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

Transmogrifox

It looks like the filter in that schematic could be quite interesting.  It uses a 4rth order Sallen-Key topography.  I have a suspicion that it could sound somewhat vocal, having a cascaded 2nd order stage setup.

I haven't actually tried the PWM technique yet, but it seems like one could design with more precision using a comparator instead of a CMOS inverter turn-on threshold, as those logic gates to have a noise margin.

I know the comparator-based PWM works very nicely as a pristine low noise audio preamplifier.  I've tried it on my breadboard with great success, using a 300kHz tri wave.  I like to keep the frequency high so one can get good rejection on the carrier with purely passive filtering.  I have been contemplating using this as a bypass technique since one can use digital logic gates and multiplexers to route the guitar signal before demodulating it.
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

Paul Perry (Frostwave)

Thanks Transmogrofix. Maybe my problem was not having a stable enough triangle wave, any noise on it would wreck the whole thing, for sure.
:idea: Maybe now that there are commercial PWM audio chips, one of those could be used. Or even a switch mode supply cip..

R.G.

QuoteMaybe now that there are commercial PWM audio chips, one of those could be used. Or even a switch mode supply cip..
Check out the venerable SG3524 and its successors.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

StephenGiles

I am pleased that this fruit of my surfings has provoked some interesting discussion on the subject. My incomplete trawl through the Recording.org tech forum archives prior to some sort of bust up resulting in the archive being wiped, threw up some interesting links, now mostly lost.
"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".