Synthesizer Basics: What is PWM?

Pulse Width Modulation and You

Robin Vincent · 04/21/23

In any synthesizer where square waves exist, there’s the potential for pulse wave modulation. It’s commonly referred to as PWM, and it’s a movement in timbre that’s hard to pin down exactly—and yet, you know it when you hear it.

It’s a sort of phasing, a movement, a wobble that’s not tremolo or vibrato; it’s a lushness, a chorusing like you find when detuned oscillators start to beat against each other. PWM transforms a dull sound into an undulating, juicy and animated tone. It’s fun, and we like it, so what actually is it?

So...What is Pulse Width Modulation?

Let’s start with the familiar square wave. It’s a waveform that flips immediately between a high (or ON) state and a low (or OFF) state, unlike a sine wave that smoothly transitions from one extreme to another. It contains the same fundamental frequency as a sine wave, but those sharp corners produce odd harmonics, giving it a fuller and somehow hollow sound. We like to use square waves for bass sounds; the Roland TB-303 Bass Line is famous for its square wave. They have an in-your-face quality that easily overwhelms the whimsical nature of sine waves and out-dances the buzz of the sawtooth. Square waves are brutal.

In order to give us that square shape on an oscilloscope, the waveform needs to be on for half the cycle and off for the other half. We call the "on" part the "Duty Cycle," and so for a square wave you would say that it has a 50% duty cycle. If you change the width of that duty cycle to, say, 75% or 25% of the total waveform, you would no longer have an even square wave, and so instead, we’d call it a Pulse wave. In electrical terms, a pulse wave is an on/off cycle where the relationship between how long it’s on and off can be changed. Let’s take a visual analogy. Consider a bunch of controllable fairy lights like those you might have on a Christmas tree. Using a slow-moving square wave, you can turn them on and off for the same amount of time. A 25% duty cycle pulse wave could have them on for a second and then off for three seconds, whereas at 75%, it would be the reverse. If there was a control that automatically changed the width of that duty cycle over time, so that your lights came on and off differently, you could say that the pulse width is being modulated.

In synthesizer terms, that change, that modulation, does something very interesting to the harmonics. As I mentioned, square waves contain only odd harmonics, but as the duty cycle changes, other harmonics drop in and out as their amplitudes are modulated according to the mathematical "sinc" function, which is shaped a bit like the path of a dropped tennis ball. But we don’t want to get into the maths; we want to know how it sounds. For me, there’s a strong pitch element, separate from the fundamental, which rises in tone as you move from the central square wave until the sound is literally ripped apart as it hits the extremes. Stick an LFO onto that pulse width control, and it sounds awesome; it instantly breathes life into a static, pure tone.

PWM wasn’t invented to give us interesting tonal changes in synthesizers. It was first used in steam engines, and then motors and electronics to control thresholds and speeds in power switching. It’s a very useful function. But engineers with an interest in music are always finding ways of pushing circuit functions into the audible range. PWM allowed monophonic oscillators to sound like they were two oscillators with a slight detuning, for a thicker and fuller tone. When digital wavetable oscillators came along, PWM could give these perfect digital waveforms the movement and variation they needed to sound more analogue. But we don’t care how it got here; we just care about using it. So let’s do that.

PWM in Standalone Synths vs. Modular Synths

In hardware synths, PWM tends to be well-behaved and musically interesting at both ends of the ratio. Synth designers would usually restrict the extremes to around a 5% to 95% duty cycle and so avoid the ripping of the waveform as it approached 0 or 100% (and the silence when it gets there).

We tend to assume that PWM modulation was all about applying a triangle LFO, but actually there was more to it than that. For instance, the Roland SH-101 analogue synthesizer lets you modulate the pulse wave by LFO, envelope or manually with a slider. Interestingly, even though the SH-101 had other LFO waveforms that you could direct to other places, the PWM was always tied to the triangle. The CEM3340 oscillator chip used in the SH-101 was also found in the Sequential Prophet 5, Oberheim OB-Xa, and the Moog MemoryMoog—and all of them are famous for the lushness of their tone. This is largely down to how well the PWM was implemented in that chip. It’s like turning on an Ensemble or Chorus effect, which was pretty much what it was there for.

In modular, all bets are off. Module designers prefer to give us access to the fullest range of possibilities in the chips and circuits of synthesizers. Sometimes that’s great; sometimes it isn’t. With PWM in most modular oscillators, you can hit the extreme ends of the duty cycle simply by plugging in an LFO. So instead of a nice, friendly wobble, you get a jerking, spitting tear at the end of each cycle of modulation. Some VCOs provide a PWM attenuator knob to calm things down a bit, but for others, you’ll have to attenuate your LFO before it gets there.

This offers some new avenues to explore, like you could use the disappearing sound at the extremes to create rhythmic patterns. And then there’s the fact that what you plug into that PWM input is entirely up to you. It could be any shape of LFO, it could be an envelope, function generator, sequencer or the audio rate output of another VCO, taking it to a whole other dimension.

PWM may have started as an apology for a single oscillator synth, but we’ve found that it’s a vital source of animated sounds. A modern trend has been to apply the PWM concept to other waveforms, and you’ll find lots of synths and VCOs can push and pull different shapes to approximate the effect of PWM. Pulse Width Modulation is awesome.

Patch Ideas & Audio Examples

Here are some example uses of PWM to kick off your own explorations.

Basic PWM, Vibrato PWM, and Double-Oscillator Chorus examples; created in VCV Rack

Basic PWM: Modulate the pulse width with a low and slow triangle LFO for that classic detuned effect.

Vibrato PWM: It’s not vibrato because you’re not modulating the pitch, but the harmonic changes give the impression of pitch variance. So, with a moderate triangle LFO, the PWM can give a reasonable vibrato effect.

Double Oscillator Chorus: If you have two identical oscillators with independent PWM, set the pulse width slightly differently for a very interesting chorus effect.

Bolstered PWM patch example; created in VCV Rack

Bolstered PWM: You don’t have to use square waves on their own. For instance, one great patch on the SH-101 is to have basic PWM on the 100% square and bring in the sawtooth up to 80%, noise up to 20% and a 1-octave sub-oscillator. Before you even get the filter involved, this is one huge sound from a single oscillator synth. Whatever synth or modular you have, mix in some other waveforms.

Audio-Rate PWM patch example; created in VCV Rack

Audio-Rate PWM: When “audio-rate” is mentioned, this means that rather than using an LFO (low-frequency oscillator) you use a VCO (voltage-controlled oscillator) that kicks out waveforms at a frequency we can hear, in other words, very fast. The same idea is most commonly used in Frequency Modulation (FM) and can produce spectacular sounds.

The modulation is moving so fast that we can no longer follow the changes in pulse width, and it sort of becomes something else, something edgy, chaotic and fantastic. The relationship between the two oscillators becomes important, and you’ll have to play with the tuning to find something useful. And then suddenly, an awesomely fat and fruity tone will leap out at you as you hit a harmonic sweet spot. Once you have something musical, you can tie the modulating VCO to the same pitch tracking as the original VCO to keep a similar tone across the keyboard. If you don’t, you’ll get some very different timbre changes which are no less awesome.