Pulse Width Modulation

A sawtooth can easily be converted into a pulse of variable width using just 1 op-amp acting as a comparator. A comparator makes its output high when +ve input exceeds -ve input. If the +ve input is fed by a saw wave, and a fixed voltage level is fed to -ve input the output will go high every time the sawtooth level exceeds the fixed level. This is illustrated below :

This is how the PICSynth waveshaper generates a pulse waveform.

Now the sawtooth in the PICsynth isn't a real sawtooth (don't hold that against it!) but rather a stairstep with 4 levels. As you vary the pulse width control (ie vary level) stairstep exceeds level at discrete points. This means that the PW control has 3 discrete pulse widths around 70%, 50% and around 30%. Actually because the comparator is not that exact you can actually get a very narrow pulse too as it just registers the lowest level. Also you can get an interesting effect on the transition points of the pulse width control. You can produce a waveform that looks like a saw + pulse at those points - it sounds great and reminds me of the Moog bent triangle wave.

The 4046 waveshaper circuit (as described in previous BLOG) produces a 256 step sawtooth, it is really smooth. So now when you combine this with a comparator you can get a continuously variable pulse width adjustment.

If you build a LFO and get the level of output just right, you can modulate the pulse width by feeding LFO into -ve input of the comparator. You get a very rich pulse width modulated sound.

Here is an example of Strings Sound, Oscillator1 = Pulse, Oscillator2=Triangle (octave down), Oscillator3 = Pulse Width Modulation.

Another sound demo
pwm2 (450 kb)

The timbre of the PICSynth is not dependent on the PICSynth chip rather the waveshapers. I now think of the chip as supplying two timebases rather than two oscillators. The timebases can be in-tune or detuned. You can add as many waveshapers as you like to each timebase. For example the strings sound is made by having a PWM waveshaper on osc1, a pulse waveshaper on osc2 detuned, and a triangle, 1 octave lower on osc1. This allows lots of flexibility to alter the timbre.

The Circuit for 256 step sawtooth and Pulse Width Modulation