Linear Frequency Modulation (FM)
Linear Frequency Modulation (FM)
CMPT 468: Lecture 7 Frequency Modulation (FM) Synthesis
Tamara Smyth, tamaras@cs.sfu.ca School of Computing Science, Simon Fraser University January 26, 2009
· Till now we've seen signals that do not change in frequency over time. How do we modify the signal to obtain a time-varying frequency? · A chirp signal is one that sweeps linearly from a low to a high frequency. · Can we create such a signal by concatenating small sequences, each with a frequency that is higher than the last? · This approach will likely lead to problems lining up the phase of each segment so that discontinuities aren't introduced in the resulting waveform (as seen below).
Concatenating Sinusoids of Different Frequency
1
0.5
Amplitude
0
-0.5
-1
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
Time (s)
Figure 1: A signal made by concatenating sinusoids of different frequencies will result in discontinuities if care is not taken to match the initial phase.
1
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
2
Chirp Signal
Chirp Signal cont.
· A better approach is to modify the equation for the sinusoid so that the frequency is time-varying. · Recall that the original equation for a sinusoid is given by x(t) = A cos(0t + ) where the instantaneous phase, given by (0t + ), changes linearly with time. · Notice that the time derivative of the phase is the radian frequency of the sinusoid 0, which in this case is a constant. · More generally, if x(t) = A cos((t)), the instantaneous frequency is given by (t) = d (t). dt
· Now, let's make the phase quadratic, and thus non-linear, rather than linear with respect to time. (t) = 2µt2 + 2f0t + . · The instantaneous radian frequency, which is the derivative of the phase , now becomes d i(t) = (t) = 4µt + 2f0 dt which in Hz becomes fi(t) = 2µt + f0. · Notice the frequency is no longer a constant but is changing linearly in time. · To create a sweeping frequency from f1 to f2 therefore, we need only look at the equation for a line y = mx + b to obtain a formula for the instantaneous frequency: f2 - f1 t + f1, f (t) = T where T is the duration of the sweeping signal.
3 CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7 4
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
Sweeping Frequency
· We can then use this time varying value for the instantaneous frequency in our original equation for a sinusoid, x(t) = A cos(2f (t)t + ).
Chirp signal swept from 1 to 3 Hz
1
Vibrato simulation
· Vibrato is a term used to describe a wavering of pitch. · Vibrato occurs very naturally in the singing voice (though some may say a little exaggerated in some operatic performances), and in instruments where the musician has control after the note has been played (such as the violin, wind instruments, the theremin, etc.). · In Vibrato, the frequency does not change linearly (as our last chirp signal example) but rather sinusoidally, creating a sense of a wavering pitch. · Since the instantaneous frequency of the sinusoid is the derivative of the instantaneous phase, and the derivative of a sinusoid is a sinusoid, we merely apply a sinusoidal signal to the instantaneous phase of a carrier signal to create vibrato.
0.5
Amplitude
0
-0.5
-1
0
0.5
1
1.5
2
2.5
3
Time(s)
Figure 2: A chirp signal from 1 to 3 Hz.
· If the instantaneous phase (t) is constant, the frequency is zero. · If (t) is linear, the frequency is fixed (constant). · if (t) is quadratic, the frequency changes linearly with time.
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7 5
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
6
Vibrato cont.
· We can therefore use FM synthesis to create a vibrato effect, where the instantaneous frequency of the carrier oscillator varies over time according to the parameters controlling the width of the vibrato (the deviation from the carrier frequency) the rate of the vibrato. · The width of the vibrato is determined by the amplitude of the modulating signal. · The rate of vibrato is determined by the frequency of the modulating signal. · In order for the effect to be perceived as vibrato, the vibrato rate must be below the audible frequency range and the width made quite small.
Figure 3: A simple FM vibrato instrument in Pd.
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
7
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
8
FM Synthesis of Musical Instruments
Frequency Modulation
· When the vibrato rate is in the audio frequency range, and when the width is made larger, the technique can be used to create a broad range of distinctive timbres. · Frequency modulation (FM) synthesis was invented by John Chowning at Stanford University's Center for Computer Research in Music and Acoustics (CCRMA). · FM synthesis uses fewer oscillators than either additive or AM synthesis to introduce more frequency components in the spectrum. · Where AM synthesis uses a signal to modulate the amplitude of a carrier oscillator, FM synthesis uses a signal to modulate the frequency of a carrier oscillator.
· The general equation for an FM sound synthesizer is given by x(t) = A(t) [cos(2fct + I(t) cos(2fmt + m) + c] , where A(t) fc I(t) fm m , c the time varying amplitude the carrier frequency the modulation index the modulating frequency arbitrary phase constants.
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
9
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
10
Modulation Index
Modulation Index cont.
· Without delving into rigorous mathematics, it is possible to determine the relationship of the modulation index I(t) to the harmonic content. · Given the result for instantaneous frequency fi(t) = fc - I(t)fm sin(2fmt + m) + dI(t) cos(2fmt + m)/2, dt we may see that if I(t) is a constant (and it's derivative is zero), the third term goes away and the instantaneous frequency becomes fi(t) = fc - I(t)fm sin(2fmt + m). · Notice now that in the second term, the quantity I(t)fm multiplies a sinusoidal variation of frequency fm, indicating that I(t) determines the maximum amount by which the instantaneous frequency deviates from the carrier frequency fc. · Since I(t) is a function of time, the harmonic content, and thus the timbre, of the synthesized sound may vary with time.
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7 12
· The function I(t), called the modulation index envelope, determines significantly the harmonic content of the sound. · Given the general FM equation x(t) = A(t) [cos(2fct + I(t) cos(2fmt + m) + c] , the instantaneous frequency fi(t) (in Hz) is given by fi(t) = 1 d (t) 2 dt 1 d = [2fct + I(t) cos(2fmt + m) + c] 2 dt 1 [2fc - I(t) sin(2fmt + m)2fm + = 2 d I(t) cos(2fmt + m)] dt = fc - I(t)fm sin(2fmt + m) + 1 d I(t) cos(2fmt + m). 2 dt
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
11
FM Sidebands
Determining the Modulation index
· The upper and lower sidebands produced by FM are grouped in pairs according to the harmonic number of fm, that is, frequencies present are given by fc ± kfm.
· In Computer Music, the modulation index I is given by d I= fm where d is the amount of frequency deviation produced by the modulating oscillator. · When d = 0, the index I is also zero, and no modulation occurs. Increasing d causes the sidebands to acquire more power at the expense of the power in the carrier frequency. · The deviation d can therefore act as a control on FM bandwidth.
magnitude
frequency fc - 3fm fc - 2fm fc - fm fc fc - 4fm fc + fm fc + 2fm fc + 3fm fc + 4fm
Figure 4: Sidebands produced by FM synthesis.
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
13
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
14
Bessel Functions of the First Kind
· The amplitude of the k th sideband is given by Jk (I), where Jk is a Bessel function1 of the first kind, of order k.
1 0.5 1 0.5
· Higher values of I therefore produce higher order sidebands. · In general, the highest-ordered sideband that has significant amplitude is given by the approximate expression k = I + 1.
J (I)
0
0 -0.5 -1 0 5 10 15 20 25
J1(I)
0 -0.5 -1 0 5 10 15 20 25
1 0.5
1 0.5
J (I)
2
0 -0.5 -1 0 5 10 15 20 25
J3(I)
0 -0.5 -1 0 5 10 15 20 25
1 0.5
1 0.5
J (I)
4
0 -0.5 -1 0 5 10 15 20 25
J5(I)
0 -0.5 -1 0 5 10 15 20 25
Figure 5: Bessel functions of the first kind, plotted for orders 0 through 5.
· From this plot we see that higher order Bessel functions, and thus higher order sidebands, do not have significant amplitude when I is small.
1
Bessel functions are solutions to Bessel's differential equation.
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
15
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
16
Odd-Numbered Lower Sidebands
Effect of Phase in FM
· The amplitude of the odd-numbered lower sidebands is the appropriate Bessel function multipled by -1, since odd-ordered Bessel functions are odd functions. That is J-k (I) = -Jk (I).
1 1
· The phase of a spectral component does not have an audible effect unless other spectral components of the same frequency are present. In the case of frequency overlap, the amplitudes will either add or subtract and the tone of the sound will change as a result. · If the FM spectrum contains frequency components below 0 Hz, they are folded over the 0 Hz axis to their corresponding positive frequencies.
1
0 -0.5 -1 0 5 10 15 20 25
-J1(I)
0.5
0.5 0 -0.5 -1 0 5 10 15 20 25
J (I)
1
1
3
0 -0.5 -1 0 5 10 15 20 25
-J3(I)
0.5
0.5 0 -0.5 -1 0 5 10 15 20 25
· The act of folding reverses the phase. A sideband with a negative frequency is equivalent to a component with the corresponding positive frequency but with the opposite phase.
J (I)
1
1
5
0 -0.5 -1 0 5 10 15 20 25
-J5(I)
0.5
0.5 0 -0.5 -1 0 5 10 15 20 25
J (I)
Figure 6: Bessel functions of the first kind, plotted for odd orders.
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
17
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
18
FM Spectrum
The frequencies present in a simple FM spectrum are fc ± kfm, where k is an integer greater than zero. The carrier frequency component is at k = 0.
Spectrum of a simple FM instrument: fc = 220, fm = 110, I = 2 Magnitude (linear)
2500 2000 1500 1000 500 0 100 150 200 250 300 350 400 450 500 550 600
Fundamental Frequency in FM
· In determining the fundamental frequency of your FM sound, it is useful to define the following ratio: N1 fc = fm N2 where N1 and N2 are integers with no common factors. · The fundamental frequency is then given by fc fm f0 = = . N1 N2 · As in the previous plot for example, a carrier frequency fc = 220 and modulator frequency fm = 110 yields the ratio of 220 2 N1 fc = = = . fm 110 1 N2 and a fundamental frequency of 220 110 = = 110. f0 = 2 1 · Likewise the ratio of fc = 900 to fm = 600 is 3:2 and the fundamental frequency is given by 900 600 = = 300. f0 = 3 2
19 CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7 20
Frequency (Hz)
Figure 7: Spectrum of a simple FM instrument, where fc = 220, fm = 110, and I = 2.
Spectrum of a simple FM instrument: fc = 900, fm = 600, I = 2 Magnitude (linear)
2500 2000 1500 1000 500 0 0 500 1000 1500 2000 2500 3000 3500
Frequency (Hz)
Figure 8: Spectrum of a simple FM instrument, where fc = 900, fm = 600, and I = 2.
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
· If N2 = M where M is an integer greater than 1, then every M th harmonic of f0 is missing in the spectrum. · This can be seen in the plot below where the ratio of the carrier to the modulator is 4:3 and N2 = 3. Notice the fundamental frequency f0 is 100, but every third multiple of f0 is missing from the spectrum.
Spectrum of a simple FM instrument: fc = 400, fm = 300, I = 2
2500
Some FM instrument examples
· When implementing simple FM instruments, we have several basic parameters that will effect the overall sound: 1. The duration, 2. The carrier and modulating frequencies 3. The maximum (and in some cases minimum) modulating index scalar 4. The envelopes that define how the amplitude and modulating index evolve over time. · Using the information taken from John Chowning's article on FM (details of which appear in the text Computer Music (pp. 125-127)), we may develope envelopes for the following simple FM instruments: bell-like tones, wood-drum brass-like tones clarinet-like tones
Magnitude (linear)
2000 1500 1000 500 0 0 200 400 600 800 1000 1200 1400 1600
Frequency (Hz)
Figure 9: Spectrum of a simple FM instrument, where fc = 400, fm = 300, and I = 2.
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
21
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
22
Formants
Amplitude Env 1 10 5 0 0 5 10 15 4 2 0 0 1 0.1 0.2 0.3 0.4 0.5 4 2 0 0 0.2 0.4 0.6 20 10 0 0 0 0.1 0 5
Mod. Index
Bell
· Another characteristic of sound, in addition to its spectrum, is the presence of formants.
10 15
0.5 0
Woodwind
1 0.5 0
· The formants describe certain regions in the spectrum where there are strong resonances (where the amplitude of the spectral components is considerably higher). · We may view formants as the peaks in the spectral envelope. · As an example, pronounce aloud the vowels "a", "e", "i", "o", "u" while keeping the same pitch for each. Since the pitch is the same, we know the integer relationship of the spectral components is the same. · The formants are what allows us to hear a difference between the vowel sounds.
0.2
0.3
0.4
0.5
Brass
0.5 0
0.2
0.4
0.6
Wood-drum
1 0.5 0 0 0.05 0.1 Time (s) 0.15 0.2
0
0.05
0.1 Time (s)
0.15
0.2
Figure 10: Envelopes for FM bell-like tones, wood-drum tones, brass-like tones and clarinet tones.
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
23
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
24
Two Carrier Oscillators
Magnitude (linear)
· In FM synthesis, the peaks in the spectral envelop can be controlled using an additional carrier oscillator. · In the case of a single oscillator, the spectrum is centered around a carrier frequency. With an additional oscillator, an additional spectrum may be generated that is centered around a formant frequency. · When the two signals are added, their spectra are combined. · If the same oscillator is used to modulate both carriers (though likely using seperate modulation indeces), and the formant frequency is an integer multiple of the fundamental, the spectra of both carriers will combine in such a way the the components will overlap, and a peak will be created at the formant frequency.
FM spectrum with first carrier: fc1=400, fm=400, and f0=400
6000 4000 2000 0 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
Magnitude (linear)
FM spectrum with second carrier: fc2=2000, fm=400, and f0=400
6000 4000 2000 0 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
Magnitude (linear)
FM spectrum using first and second carriers
6000 4000 2000 0 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
Frequency (Hz)
Figure 11: The spectrum of individiual and combined FM signals.
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
25
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
26
Two Carriers cont.
Two Modulating Oscillators
· Just as the number of carriers can be increased, so can the number of modulating oscillators. · To create even more spectral variety, the modulating waveform may consist of the sum of several sinusoids. · If the carrier frequency is fc and the modulating frequencies are fm1 and fm2, then the resulting spectrum will contain components at the frequency given by fc ± ifm1 ± kfm2, where i and k are integers greater than or equal to 0. · For example, when fc = 100 Hz, fm1 = 100 Hz, and fm2 = 300 Hz, the spectral component present in the sound at 400 Hz is the combination of sidebands given by the pairs: i = 3, k = 0; i = 0, k = 1; i = 3-, k = 2; and so on (see Figure 12). · In fact, there are an infinite number of i, k dyads that produce a sideband at ±400 Hz. The actual number that contribute to the overall amplitude is determined by the modulation indeces.
· In Figure 11, both carriers are modulated by the same oscillator with a frequency fm. · The index of modulation for the first and second carrier is given by I1 and I2/I1 respectively. · The value I2 is usually less than I1, so that the ratio I2/I1 is small and the spectrum does not spread too far beyond the region of the formant. · The frequency of the second carrier fc2 is chosen to be a harmonic of the fundamental frequency f0 that is close to the desired formant frequency ff (from Computer Music). That is fc2 = nf0 = int(ff /f0 + 0.5)f0. · This ensures that the second carrier frequency remains harmonically related to f0. If f0 changes, the scond carrier frequency will remain as close as possible to the desired formant frequency ff while remaining an integer multiple of the fundamental frequency f0.
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
27
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
28
Two Modulators cont.
FM spectrum with first modulator: fc=100 and fm1=100 Magnitude (linear)
6000 4000 2000 0 0 200 400 600 800 1000 1200 1400
· Modulation indeces are defined for each component: I1 is the index that charaterizes the spectrum produced by the first modulating oscillator, and I2 is that of the second. · The amplitude of the ith, k th sideband (Ai,k ) is given by the product of the Bessel functions Ai,k = Ji(I1)Jk (I2).
FM spectrum with second modulator: fc=100 and fm2=300 Magnitude (linear)
8000 6000 4000 2000 0 0 200 400 600 800 1000 1200 1400
FM spectrum with two modulators: fc=100, fm1=100, and fm2=300 Magnitude (linear)
4000 2000 0
0
200
400
600
800
1000
1200
1400
· Like in the previous case of a single modulator, when i, k is odd, the Bessel functions assume the opposite sign. For example, if i = 2 and k = 3- (where the negative subscript means that k is subtracted), the amplitude is A2,3 = -J2(I1)J3(I2). · In a harmonic spectrum, the net amplitude of a component at any frequency is the combination of many sidebands, where negative frequencies "foldover" the 0 Hz bin (Computer Music).
Figure 12: The FM spectrum produced by a modultor with two frequency components.
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
29
CMPT 468: Computer Music Theory and Sound Synthesis: Lecture 7
30