Frequency modulation with feedback

Source code and result:

In this example, an oscillator is modulating its own frequency through a feedback loop. Here, the fondamental frequency of the oscillator is changed by the modulation, thus the note pitch is unstable. The modulation index of the last notes in the example has high values, increasing the pitch unstability without modifying the timbre.

         sr = 44100
         kr = 4410
      ksmps = 10
     nchnls = 1

          opcode fdbkFM, a, kk
            setksmps  1
kcps, kmod  xin
asig0       init      0
;in Frequency Modulation, modulation index depends upon modulator frequency
asig        oscili    1, kcps + kmod*kcps*asig0, 1
asig0       =         asig
            xout      asig

          instr 4
idur        = p3
iamp        = p4
icarcps     = cpspch(p5)
indxmul     = p6

kndx        adsr      0.4, 0.5, 0.1, 0.05
kmod        =         kndx * indxmul
asig        fdbkFM    icarcps, kmod
kenv        adsr      0.1, 0.2, 0.8, 0.2
            out       iamp * kenv * asig


When there's a feedback loop, frequency modulation and phase modulation are no more equivalent. We hear a picth offset during the frequency modulation with feedback because there's a DC component (null frequency) in the spectrum of the modulated signal. When the modulated signal is added to the frequency, this DC component shifts the frequency. In the phase modulation with feedback the DC component present in the feedback loop does not change the frequency and so the pitch remains stable.

There was no difference between the simple modulations because the modulator was a sinusoid which has no DC component by definition. We can show the influence of the DC component in the modulation by inserting in the feedback loop of the preceding example a DC blocker.

The diagram becomes:

Here are the files for this example:

The pitch offset disappeared. Of course, the modulation audio result is changed by the filter so that it cannot be compared with the one from the phase modulation with feedback.


The phase modulation allows us to use any kind of signal as a modulator without altering the pitch stability. Moreover the modulation index of the phase modulation being independant of the modulator frequency, its effect on the richness of the spectrum on a large pitch range will be more homogeneous than with the frequency modulation. For those reasons the phase modulation is preferred to the frequency modulation when synthesizing musical instruments.

On the other hand, pitch shifting can be an interesting effect in an experimental situation with chaotic evolution. That's what is presented in the next article.