[sdiy] "FM" Synthesis (was Re: Buchla 295 10-band comb filter topology)
brianw
brianw at audiobanshee.com
Sat Nov 26 02:34:23 CET 2022
On Nov 25, 2022, at 4:34 PM, Donald Tillman wrote:
> On Nov 25, 2022, at 3:42 PM, brian wrote:
>> On Nov 25, 2022, at 2:59 PM, Donald Tillman wrote:
>>> Just like "FM Synthesis" is really phase modulation, but the term is used generically.
>>
>> This has always baffled me. I understand the difference between frequency and phase, but my math skills aren't great enough to answer the question: Is there any way to phase modulate without frequency modulation? ... or the converse: Is there any way to frequency modulate without phase modulation?
>
> It baffled Chowning, too... in his famous paper he describes "frequency-modulated wave" in the first equation, but it's really an equation for phase modulation.
Wikipedia has brought the term, angle modulation, to my attention. Seems like a wonderful term for just those times when one is so confused.
> In practice, the difference is day and night. Phase modulation is much more musical.
Thanks for the comments so far.
Would you be able to describe the difference between linear (frequency) modulation and log (frequency) modulation? Is that an actual consideration, or am I misremembering the literature of decades passed (or past decades, take your pick).
As I recall, linear FM would take a sine wave at 200 Hz and vary it between 100 Hz and 300 Hz (e.g. between a set of three harmonics, one below center and one above), whereas log FM might vary between 100 Hz and 400 Hz (from an octave down to an octave above). Those are both obnoxiously high levels of modulation, but I'm using them for the simple math.
For me, it gets tricky to think about analog versus digital, so I'm not even sure what sort of explanation I'm asking for. Probably the digital implementation might make more sense.
Usually when I try to figure this out, I try to consider what's happening to a physical object like a piece of wood, a drum skin, a string, or a sheet of metal when certain vibrations increase and decrease tension in the material which in turn changes the pitch of the vibration.
> And feedback around a frequency modulation VCO has the potential can get stuck at 0 Hz.
I guess it really depends upon how you implement it - i.e. whether it can get stuck at 0 Hz.
>> A quick visit to Wikipedia says that PM does not alter the frequency, so I'm wondering how the DX-7 implemented that.
>
> You can scope the output of a DX-7, and it's pretty obvious.
Ha. I can't make any sense out of angle-modulated sine waves. They're all Greek to me.
> The big deal about the DX-7 was that they found a way to completely avoid real-time multiplies. The entire implementation is single-cycle add and ROM lookup operations. And those are so easy and quick they were able to implement 16 notes * 6 operators => 96 phase modulation oscillators in 1983 technology. For $2500.00.
I can imagine that if the sine wave table is a power of two in length, then the lookup could be performed with a modulo operation. Digital signal processor instruction sets have the ability to perform modulo addressing without any overhead - just specify the length of the data in number of address bits and it's handled as part of a single instruction doing the fetch.
Frequency is the rate of change of phase, so adding a constant to the previous address will output a sine wave at a corresponding frequency. Can't remember at the moment whether DSP instructions can add an arbitrary register value to an address (with modulo), but that seems obvious. The rate could even be negative, and the output would still be a sine wave (as long as the rate is non-zero). Adding modulation to that simple carrier means adding: previous_address + rate + modulator input. That looks like two additions, one constant plus two varying values, so I'm probably already missing an optimization that Yamaha probably used.
If I'm on the right track so far, then it seems like phase modulation could end up as a frequency modulation if the modulator somehow got stuck at a fixed value (i.e. if a modulator got stuck at 0 Hz with some non-zero DC offset).
Implementing FM instead of PM would seemingly require changing the rate "constant" that's added to the address for each sample. This would possible remove an add, because the code is just previous_address += rate. But, if you want to avoid FM around 0 Hz, then the rate would need an offset corresponding to the center frequency of the carrier.
Here's where I get confused, because both of the implementations that I've described seem identical in my mind (perhaps because I've only implemented one of them and not the other). I'm trying to understand: What is the difference between adding a sine wave to a constant rate of change of phase (FM?), versus using a sine wave (with a necessary DC offset) as the rate of change of phase (PM?). Maybe it's because I'm assuming that it's always necessary to add a constant, representing the center frequency of the carrier, to a changing value, representing the modulator.
Meanwhile, lately I've become very fond of using Hal Chamberlin's software State Variable Filter with no audio input and feedback of precisely 1.0 to turn it into a sine wave generator. No lookup table is needed, and therefore no interpolation between samples is needed, either. A MacBook Pro can generate thousands of sine waves in real time with this code. An unfinished project is to implement FM (or PM) with this to hear what sounds can be generated.
Brian
p.s. I did notice that the DX series attenuates the carriers according to the number of them in the selected algorithm, so that there's no chance of clipping. They don't shy away from odd numbers of carriers, so they're not relying on simple bit shifts for the 3-carrier and 5-carrier algorithms.
More information about the Synth-diy
mailing list