Stuck with a SynthEdit project?

Category: FM Synthesis

FM synthesis in SynthEdit

FM synthesis has been around for a while now and although the basic idea of using an audio frequency sine wave to frequency modulate an audio frequency carrier sine wave is (on first glance) quite simple, the end result can be a harmonically complex audio tone.
One point to note is that it may be tempting to think “If two sine waves can sound that good, how good would two sawtooth signals sound if one modulated the other?” The answer to this is, very often not that good I’m afraid. Why is this?
When you’re using two sine waves the results are fairly simple carrier + modulator and carrier – modulator because with a pure sine wave we have just two frequencies to deal with. However if we put sawtooth into the picture then things quickly get very complex and messy. Just imagine the calculations to predict the results of these two signals at 1.5 kHz and 1.6 kHz…

The results of this would be as shown below, and even with 0.1% FM its getting very messy. Note that on the low frequency end there’s a lot of noise generated…I’ll explain this later.

If we go up to just 1% as shown below this is just a total inharmonic mess with lots of aliasing. It’s no good trying to filter out the inharmonic noise once it’s been generate either.
So sum up: When designing an FM Synthesizer we need the carrier and modulator(s) to be sine waves for the results to be a) musical and b) predictable>
What we really don’t want is for any of the oscillators in the signal chain to have fast rise and fall times.

This is why FM synthesis is traditionally done with sine waves. Even when we use multiple modulators on the carrier signal, the results will still be fairly predictable. So how does the carrier and modulation produce these sounds from a sine wave?
If you take the basic sine wave (which is a pure tone) as soon as you modulate the sine wave with other audio frequency sine waves, then you’re introducing lots of new frequencies known as “Sidebands” which put (very) simply are the products of all the combined frequencies involved.

Let’s define the carrier’s frequency as C, and the modulator’s as M. The
modulator introduces harmonics to the carrier frequency. The upper
sidebands always appear at the following frequencies:
C + M, C + 2M, C + 3M, C + 4M, and so on
And the lower sidebands will appear at these frequencies:
C − M, C − 2M, C − 3M, C − 4M, and so on
Say the carrier is a 1,000-Hz sine wave, and the modulator is a 200 Hz
sine wave. The carrier’s ascending sideband frequencies are 1,200 Hz,
1,400 Hz, 1,600 Hz, and so on. Its descending sidebands are 800 Hz,
600 Hz, 400 Hz, eventually reaching 0.

In the Illustrations below we have the spectrum from various setups:
1st is a single unmodulated sine wave
2nd is a sine wave with 10% PM by a sine wave of the same frequency
3rd is a sine wave with 90% PM by a sine wave of the same frequency

Sidebands and modulation levels.

In the illustration below we have
1st a sine wave 90% modulated by two sine waves of double the carrier frequency
2nd a sine wave 90% modulated by three sine waves of double the carrier frequency

In the two illustrations below it shows the effect of reducing the modulator frequency below the carrier frequency
1st shows the modulator one octave below the carrier frequency
2nd shows the modulator 2 octaves below the carrier frequency

Effect of changing the modulation frequency

So you can see how things start to get complex very quickly. Just have a look at the setup below (And this is without any complex routing of signals, or adding feedback)

In the spectrum below we can see the effect when we have a chain of modulators with different frequencies:
1st Mod +2 Octaves, 2nd Mod +1 Octave, 3rd Mod -1Octave all modulating the carrier oscillator.

Spectrum with complex modulation
Basic FM structure without feedback

This will hopefully illustrate what happens during FM synthesis, how complex the results can be, and why we really don’t need anything other than sine waves thrown into the equation (things really will start to go out of control). The image below is created by the 440Hz sawtooth carrier, being 90% phase modulated by a 440Hz sawtooth modulator, it really is a messy spectrum with lots of aliasing thrown in. Notice how it’s got really messy down around the 20Hz region! The abrupt changes in modulation with the sawtooth means that the sidebands generated have got extremely complex, and we are generating something very un-musical with lots of Inharmonics and aliasing.

Using a sawtooth as a carrier.

Sidebands that mathematically would be negative frequencies are obviously just not physically possible, so these are “reflected”, that is, they just become normal audio frequencies that appear above 0Hz, so if one of the sidebands should mathematically be -200Hz, it will just become a 200Hz sideband.
Therefore in our calculations we can treat them as normal positive numbers and represent them as such.
For example, if C = 1 and M = 2, the first sideband is at: |C − M| = |1 − 2| = |−1| = 1.

A carrier and a modulator signal sharing the same frequency will generate a harmonic at 0 Hz, which will appear as a constant DC offset that is visible on a frequency analyser.
A simple one-pole high-pass filter with a cut-off of about 20 Hz will remove this unwanted DC offset quite effectively. It’s important to do this as it will be added to any audio signals, which could easily cause distortion through clipping.
We often express carrier and modulator frequencies as C:M or M:C
ratio, because they define the sidebands. Lower sidebands do not occur
when the C:M ratio is 1:M (the carrier is the fundamental frequency),
provided that M ≥2 or M = 1. If M = 1, then the first lower sideband is
1 − 1 = 0 Hz, which is a DC offset. The second lower sideband is
|1 − 2 ∗ 1| = |−1| = 1, or a frequency identical to the carrier’s. If M is
greater than 2, then all lower sidebands lie above the carrier frequency,
which rules out lower sidebands. Table 3.3 lists some C : M ratios and
their first ten sideband frequencies.

If a sideband’s frequency lies above the Nyquist frequency, it is mirrored—
that is, aliased, right back into the 0-to-Nyquist range. This effect
increases with the FM depth setting. You can confine it somewhat by
limiting the FM depth amount. Waveforms other than a sine will normally cause substantial amounts of aliasing.
The sidebands’ amplitude hinges all on modulation depth. They are absent without any frequency modulation, leaving only the sine wave carrier. Ever more sidebands appear as FM depth increases. The FM depth amount determines the
number and amplitude of the audible sidebands and thus the modulated signal’s overall audio bandwidth.
Vary the FM amount over time using an envelope, and you can
shape the modulated sound’s spectral component. Put simply, the carrier
envelope will determine the sound’s amplitude over time, and the
modulator envelope determines the harmonic content (timbre) over
time, behaving much like a filter envelope.

Creating an FM Synth in SynthEdit.

Technically it’s not really true FM synthesis, as what we are doing is really done with phase modulation (As it was in the Yamaha FM series of Synthesizers.
Frequency Modulation, used as a form of synthesis, was discovered experimentally by John Chowning, and was popularized initially by the Yamaha DX-7 synthesizer.
The idea is to use the output of one oscillator to modulate the frequency of another. The result is a rich, complex sound containing many, many more harmonics than is possible with subtractive synthesis.
The Yamaha DX-7 used a variation on direct frequency modulation called phase modulation. The result is the same, but with phase modulation it’s easier to control the pitch and depth of modulation independently. (Phase modulation should not to be confused with phase distortion.)

Basic FM Synthesizer structure

The first oscillator is referred to as the modulator, and the second oscillator the a carrier. Rename the modules to make this clear as you progress. I have just used structure groups to illustrate this. This is a very basic form of FM synthesizer. The scope is there so you can see as well as hear what is going on when you increase the amount of modulation. Both oscillators should be sine wave, as the results with other waveforms can become rather unpredictable. Likewise it’s a good idea for both oscillators to receive a Sync pulse from the trigger output of the MIDI to CV2 module.

As things stand this is a very basic design, and any tonal variation has to be done manually, which isn’t always very convenient, or quite what we want. However there’s quite a simple solution to this:
We can add another ADSR module with the usual Trigger/Gate connections to control the amount of Modulation reaching the carrier oscillator, so now we can dynamically change the modulation level every time a note is played.

Adding modulation to the FM Synthesizer

Yes you can have feedback in SynthEdit with one caveat: this is due to the way SynthEdit works it introduces a delay one sample long, so although we can have feedback it won’t behave quite like the feedback in a hardware FM synth (sorry, but there’s no way round this) . We just need a special module for this, the Feedback – Volts module which feeds the output of the Carrier oscillator back to the Modulator oscillator’s PM input via a Level Adj module. You’ll find you only need quite moderate amounts of feedback, as too much can cause some quite “unmusical” results. However despite these points it’s worth adding the feedback loop as it does increase the sonic possibilities quite drastically.

Adding Feedback to an FM Synthesizer