Frequency Modulation (or FM) synthesis was discovered and introduced by John Chowning at Stanford around 1973. FM is one of the pillars of CCRMA and was the underlying technology for a very successful synthesizer manufactured by Yamaha and known as the DX7 during the 1980's. Many of its trademark sounds are still a novel but in the past FM has been an efficient and simple method for generating and simulating complex textures as the vibrato of the singing voice. FM at its core is a simple and powerful method for creating and controlling complex spectra and is also categorized as a worshiping method of audio synthesis. In its simplest form it involves a sine wave carrier whose instantaneous frequency is modulated according to another waveform called the modulator. If the mean frequency of the modulator reaches as high as audio frequency range, sidebands appear as partials of the new modulated sound. This model then is often called simple FM or sinewave FM. Other forms of FM are extensions of the basic model.
The position of each sideband is a function of the carrier modulator ratio or C:M ratio, and its number and amplitude change as function of the amplitude of the modulator or depth of the modulation. While the precise relationship between the sidebands, the c:m ratio and the amplitude of the modulator (better known as modulation index) is determined by the use of Bessel functions, it is common practice to say that the number of sidebands produced on either side of the carrier equals to the modulation index plus 2.
FM synthesis is done by means of signal generators. In Snd oscil is Bill Shottstaedt's basic and outstanding signal generator among a very vast array of other generators. Bill's description of a signal generator is as follows:
“A generator is a function that returns the next sample in an infinite stream of samples each time it is called. An oscillator, for example, returns an endless sine wave, one sample at a time”.
For more on signal generators see Dick Moore's: Elements of Computer Music or Charles Dodge and T. Jerse's: Computer Music.
“Furthermore each generator is made of a set of functions: Make[gen] sets up the data structure associated with the generator at initialization time; [gen] produces a new sample; [gen?] checks whether a variable is that kind of generator”.
[gen] is the name of a generator like oscil therefore makeoscil sets up a data structure (interpolation values) at initialization time. Then oscil produces a new sample in an stream of samples inside a loop which repeats itself the duration of the desired sound in seconds times the current samplingrate.
“The initialization function normally takes a number of optional arguments, setting whatever state the given generator needs to operate on. The runtime (loop) function's first argument is always its associated structure. Its second argument is nearly always something like an FM input, whatever runtime modulation might be desired; in other cases it can be a function to provide input data or editing operations. Amplitude envelopes are handled with a separate env generator. Frequency sweeps of all kinds (vibrato, glissando, breath noise, FM proper) are all forms of runtime frequency modulation”.
In Snd's s7's scheme the initialization function might be something like:

where frequency is in Hz or cycles per second (cps). There is an optional parameter to this function which is initialphase or the initial angle of phase for the oscillator (oscil uses the Sine function for sine wave generation). The runtime (loop) function might look like:

or using the optional parameters a more complex Oscil function call with vibrato, glissando and frequency modulation value looks like:

The Oscil signal generator definition in Snd is:
“oscil produces a sine wave (using sin) with optional frequency change (i.e. fm). Its first argument is an oscil created by makeoscil. Oscil's second (optional) argument is the current (samplewise) frequency change (it defaults to 0). The optional third argument is the (samplewise) phase change (in addition to the carrier increment and so on). So the second argument can be viewed as FM, while the third is PM (phase modulation). The initialphase argument to makeoscil is in radians. You can use degrees>radians to convert from degrees to radians. To get a cosine (as opposed to sin), set the initialphase to (/ pi 2)”.
As can be seen a simple signal generator like Oscil can be used for Frequency Modulation and its closely related cousin Phase Modulation.
The terms Frequency Modulation (FM) and Phase Modulation (PM) are source of some confusion and ambiguities. The main source of the diverging paths taken by FM implementers can be traced to a discrepancy between the standard analytical FM formula cited above and “MusicV” implementation which have appeared in most texts on the subject. As to this issue Bill Schottstaedt points out: “The difference is that FM integrates, whereas PM does not. – this does not make up any difference in computational speed, or musical results”.
A better explanation in FM.html should clear this confussion:
“The terms "angle modulation", "phase modulation", and "frequency modulation" (not to mention "exponential modulation" and "angular modulation") are used almost interchangeably in the radio literature, but the textbooks on the subject normally distinguish between PM and FM as follows: if f(t) is directly proportional to the modulating signal then it's PM; if f(t) is directly proportional to the derivative of the modulating signal, then it's FM. Of course, you can't tell which is in use either from the waveform or the mathematical expression of the waveform – you have to know what the modulating signal was. That is a roundabout way of saying that in computer music applications there is no essential difference between frequency and phase modulation. However, the fact that phase and frequency modulation are just two ways of interpreting the same thing should not mislead us into thinking "phase doesn't matter" – the initial phases of the parts of the FM formula do make a difference, as we'll see below”.
As a benefit for the reader, this tutorial shows “both” an instrument doing simple FM and another doing simple PM. The reader should listen for any audible or perceptual differences.
In order to understand some of the details in Frequency Modulation it is important to understand the notion of frequency increment. Frequency increment is expressed in terms of radians per second (RPS). In the case of vibrato, or FM or any time we need to specify values to the optional 2nd argument of some oscillator, it is necessary to deal explicitly in RPS. The Snd scheme function hz>radians converts converts frequencies expressed in cycles per second “Hz” to frequencies expressed in radians per second over the actual sampling rate.
Since we know there are 2 pi radians in one cycle and if we know Snd's sampling rate is 22050 therefore, if we want to express this rate in terms of radians per second, the result should be also equal to 2 pi. To make sure this is true you can try typing the following command on Snd's listener window,

and you should get,

which indeed is twopi. If you don't get twopi, you are working with other sampling frequency on Snd. You might find your sampling frequency by simply issuing,

This also means that the radian frequency of half the sampling rate is pi, the radian frequency of 1/4 the sampling rate or quarter cycle is pi over two and so on.
 Several years ago composer Nicky Hind wrote a series of tutorials for composers to get around CLM (Common Lisp Music) on NeXT machines at CCRMA. CLM is Snd predecessor and still being used by some composers because of Lisp code and perhaps some easiness in contrast with other languages. Among those tutorials is a twopart FM Synthesis tutorial here.Most of his examples can be translated into Snd with few differences, most notably CLM's “RUN” loop. Below we are borrowing his code and paraphrasing some of his indications.
A frequency increment instrument and other instruments illustrate this issue on Snd's s7's Scheme. (you can copy and paste them directly on Snd's listener window or better to Emacs or your favorite editor then save as “fm.cms”.











Following we have s7 Scheme code for a very simple FM instrument which can be used as a template for more complex instruments, and in fact more complex projects in Snd. Notice that makeoscil and makeenv are the definitions for the the signal generators oscil and env respectively. Here we are creating two oscillators for the carrier and modulator plus one amplitude envelope and a modulationindex envelopes which changes as sound unfolds.

The function calls for this instrument are as follows:


There is a carrier frequency of 400Hz and a sideband of 800Hz with 0.65 the value of the amplitude of the carrier. You can activate the FFT or (f) view of your Snd sound file to make sure these are the values of this spectra.

Here we get a different spectrum with a carrier frequency at its maximum amplitude and a second sideband frequency which decreases 40% the value of the peak amplitude.

then we obtain sidebands on 100Hz with 0.95 amplitude and at 690Hz and the same 0.95 amplitude.

here we get a fundamental frequency around 200Hz at the peak amplitude and average sidebands at 200Hz and 975Hz each one with an average amplitude of 0.925 the peak amplitude.



As previously discussed if f(t) is directly proportional to the modulating signal then we have Phase Modulation. If f(t) is directly proportional to the derivative of the modulating signal, then we have Frequency Modulation or FM. This means that difference between PM and FM lies in that FM integrates, whereas PM does not. This does not mean that there is any difference in computational speed, musical or perceptual results. Snd provides tools to check this analytically with its spectrogram windows which can be dragged to change with time. Here we have a simple “Phase Modulation” instrument. Notice the modulating frequency at oscil's fourth parameter.

Function calls for the Phase Modulation instrument are:


Notice the carrier frequency of 400Hz and a sideband of 800Hz with 0.65 the value of the amplitude of the carrier. You can activate the FFT or (f) view of your Snd sound file to make sure these are the values of this spectra.
The other function calls which should match the FM instrument calls are as follows:





Synthesis of audio by means of Frequency Modulation and its relatives is still a powerful method for generating complex spectra. Many instruments using this principle as a basis have been developed and include violins, trumpets, plucked strings as well as bells, gongs, drums and more. As John Chowning points out, the richness of FM lies in the ability to manipulate on the time domain the spectrum of a sound. We have seen that this can be easily accomplished by using envelope generators which control the modulationindex over time.
© Copyright 20012022 CCRMA, Stanford University. All rights reserved.
Created and Mantained by Juan Reyes