# What is the difference between frequency modulation and phase modulation?

DSP, Plug-in and Host development discussion.
KVRAF
4289 posts since 7 Jun, 2012 from Warsaw
Many plugin developers claim that their synths do "true" FM instead of PM, or else.

For a single large sinusoidal signal, PM is similar to FM
This is my intuition as well. Phase and frequency are interchangeable. Or not? Please explain this to me.
http://djwarmonger.wordpress.com/
Tricky-Loops wrote: (...)someone like Armin van Buuren who claims to make a track in half an hour and all his songs sound somewhat boring(...)

KVRian
1353 posts since 12 Apr, 2002
Phase is the integral of frequency over time. For sinusoidal signals integration changes the amplitude and phase, but preserves the sinusoidal shape otherwise. In that sense they are kinda interchangeable, up to the phase and amplitude adjustments. For other signals they are "less" interchangeable, because also the modulator waveform needs to be changed in order to keep the equivalence.

With FM there can be further variations: linear/exponential, thruzero/clipping etc. With phase its usually always linear and nonclipping, the variations are not as natural as for frequency.

KVRer
5 posts since 12 Oct, 2021 from Italy
Z1202 wrote:
Sun Oct 17, 2021 4:11 am
Phase is the integral of frequency over time. For sinusoidal signals integration changes the amplitude and phase, but preserves the sinusoidal shape otherwise.
I second this. It took me a while to get a grasp on this as well. If you have a signal x(t) = sin(w*t) and a modulation signal f(t) then:

• x(t) = sin(w*t + f(t)) is phase modulation
• x(t) = sin(w*t + \int_0^t f(s)ds) is frequency modulation

Since frequency is the derivative of the phase, the instantaneous frequency of phase modulation will be w + f'(t), the instantaneous frequency of frequency modulation will be w + f(t). This is why it appear as more "natural" to us, because with FM the changes in the frequency of the signal reflect exactly the modulation signal (on the other hand, in PM the changes reflect the drivative of f!).

In a digital oscillator, the difference is simply where you add the modulation.

It can be seen by writing the single update of digital ramp oscillator:

PM:

Code: Select all

float phaseTick(float freq, float PM) // freq and PM both normalized in [0, 1], output is in [0, 1]
{
phase = phase + freq; //phase is initialized at 0
phase = frac(phase); //frac is the fractional part

return frac(phase + PM);
}

FM:

Code: Select all

float phaseTick(float freq, float FM) // freq and FM both normalized in [0, 1], output is in [0, 1]
{
phase = phase + freq + FM; //phase is initialized at 0
phase = frac(phase); //frac is the fractional part

return phase;
}

So, in the case of PM the modulation does not get added permanently to the phase, but just to the current output, in the case of FM, the modulation is indeed added to the phase and stored in there, so that the next modulation will add to the previous one and so on (thus realizing the integral, aka the sum, of the modulating signal.
Lorenzo from Italy. Developer, Mathematician

KVRAF
1883 posts since 2 Jul, 2010
In usage, a big practical difference is that any DC bias in the modulator (from an asymmetric waveform, say, or an imperfect analogue VCA) will lead to audible detuning as the FM depth is increased, whereas with PM the fundamental pitch should be unaffected.

KVRian
1353 posts since 12 Apr, 2002
Actually, just realized that the equivalence is probably also broken if connecting serially more than 2 sinusoidal oscillators, since the modulator waveform is no longer a sine then.

KVRist
335 posts since 4 Oct, 2002
Z1202 wrote:
Mon Oct 18, 2021 2:35 am
Actually, just realized that the equivalence is probably also broken if connecting serially more than 2 sinusoidal oscillators, since the modulator waveform is no longer a sine then.
It is. It is also broken as soon as you apply envelope on modulator level. It's now integral of sine()*env(), not just sine(), fast/short env will produce additional modulation of the carrier (it might be roughly equivalent of differential of modulator's volume envelope as additional modulation of carrier's frequency).

So, PM != FM in practice.

KVRAF
6574 posts since 12 Feb, 2006 from Helsinki, Finland
If for "some reason" you happen to have an oscillator that cannot easily handle PM, but you would still like all the great advantages of PM, then there's a very easy solution: just pass the control signal through a differentiator. Now your oscillator can do FM and still produce the same results as a PM oscillator.

But wait, it gets better. After differentiating the signal you can (soft-)clip it, to limit the maximum instantaneous frequency. This can help combat aliasing, but it'll introduce some phase drift. This then can be avoided (over time) by doing error feedback (ie. feed back the difference between original and clipped control signal to the next sample).

But wait, it gets better. Why settle for just the choices between PM and FM when you could blend between these arbitrarily! See, instead of using a pure differentiator, design a highpass that's just a DC blocker (or even completely flat if you feel like it) with cutoff at minimum and a differentiator with cutoff at maximum. When set to minimum cutoff, you've got "true FM" (but without the fundamental shift if you let the filter DC block) and at maximum cutoff you've got PM.

Those are my 2 cents on FM, but feel free to experiment further.
Preferred pronouns would be "it/it" because according to this country, I'm a piece of human trash.

KVRian
1064 posts since 2 Jul, 2018
Nemesis can do both. You can download the free demo and directly compare the results:

https://www.tone2.com/nemesis.html

"From a technical point of view, conventional 'FM synthesizers' actually use phase modulation to generate sound - but for historical marketing reasons they are advertised as 'FM synthesizers'. The traditional method, however, is limited to bell-like sounds and often produces an unpleasant, metallic sound.
Some analog synthesizers can do true FM. However, this suffers from the lack of precision of the oscillators, which creates an inharmonic sound that is not particularly useful musically.
The innovative NeoFM approach combines the advantages of both worlds without taking over the respective weaknesses. It is now easier than ever to get great sounding results."

It also goes one step further: neoFM is completely aliasfree and does not suffer from any drift.
Tone2 Audiosoftware https://www.tone2.com