It’s a recommendation question. I understand the “audible” frequencies (generated by carrier operators in FM/PM world) doesn’t exceed sampleRate / 2, named Nyquist frequency (bandlimiting), but is this limit is also valid for modulators (or not) in FM/PM world?
Maybe Paul (@baconpaul), author of the excellent Six Sines plugin for DAWs (Win/Mac/Linux) can reply?
In FM you generate sidebands with each operator. So, you want to keep the carrier + sidebands under the nyquist. A high frequency modulator will widen the sidebands more. And with multiple operators these can stack up.
I should add, 4x oversampling plus a band limiting decimation filter is probably good enough depending on what you mean by ‘modulation’. Or at least it’s the approach I took!
Oh. Further… by ‘modulation’ for the modulator, I mean that it’s highly dependent on what your modulator is. For example if it’s a pure sine, it won’t alias, and instead it’ll just drop to a lower register and give you a pitch you didn’t expect. But for a modulator with higher bandwidth it gets crazier.
The Nyquist frequency is an absolute mathematical limit, it is not a recommendation. So the role of the signal does not matter. Any attempt to represent a frequency over the Nyquist frequency will produce an aliased result.
That would still be aliasing! A high frequency sine above the Nyquist frequency would alias down to a lower frequency sine below the Nyquist frequency after analog to digital conversion. If the intended frequency is an integral multiple of the Nyquist frequency than it will be harmonious with the original frequency, but it would still be aliasing.
Indeed! Technically aliasing, but it’s somehow more tolerable than if you were to modulate with anything else. I guess that’s why the DX7 uses PM and sines.. smart engineers!
Pure sines because Fourier theorem that says all sounds can be expressed as a sum of sines, each called a “partial”. Phenomenon such as Nyquist apply to each partial. You can usually break down analysis to the simple case of sines and extrapolate from that.
Hello Paul, thank you very much, I agree about any sound is always a sum of sines (Fourier theorem). But I didn’t quite catch the meaning of your last sentence, precisely:
You can usually break down analysis to the simple case of sines and extrapolate from that.
Fun fact, I discover at very high frequency (such C8, ratio 11, as example), Dexed VST3i plugin ignores Nyquist frequency, the result is funny, visible from spectrum analyzer (of course 24kHz isn’t audible for humans, in particular for mine 62-years old ears lol, however my dog reacts on these sounds).
My DeXtral module uses, via std::min(oscFreq * dx7_ratio, sampleRate / 2), the sampleRate / 2 (it’s a kind of limiter), not sure if it’s a good idea to keep 24kHz (for 48kHz sample rate), if yes, is it safe to give a “margin” (like frequency minus something)… Another way is to “kill” - litterally - the frequency to… 0Hz (in the idea of a kind of brutal LPF with cutoff set @ sampleRate / 2, but honestly, I don’t know).
Maybe just go back to basics of (digital) sound. The fundamentals (bad pun intended).
Since digital is discrete, digital audio is all about sufficient resolution: sampling rate and amplitude. To represent any periodic signal, you would need at least 2 samples: one representing the positive half of the period/cycle and one to represent the negative half of the period/cycle. So, this is why the maximum upper frequency limit for any sampled signal is samplerate/2.
Since human hearing is limited to the 20Hz-20Khz range (at best), we would need a sampling rate of at least 2 x 20kHz. To sufficiently accurately encode amplitude, 16 bits generally are enough. So, for audio CD format, 44.1 kHz and 16 bit PCM was chosen.
But, generally, periodic signals are not just pure sines. Actually, most sounds consist of many frequencies; the so-called spectrum. Each frequency in the spectrum is represented by a sine with its own amplitude and phase. Often, relative phase for each individual frequency is ignored. E.g. in many implementations of additive synthesis, you only get control over amplitude of the various frequencies in the spectrum.
For many natural sounds these frequencies are integer multiples of the fundamental frequency. Most often they are then called harmonics.
Generally in most sounds, the lower frequencies in the spectrum have higher relative amplitudes then higher frequencies in the spectrum.
The obvious and most extreme exception is white noise, which contains all frequencies at equal amplitude.
But, for example: A pure sawtooth contains infinite whole integer multiples of the fundamental frequency, where the amplitude is inverse to the rank: 1/rank (1=1/1, 2=1/2, 3=1/3 etc). A pure square has the same 1/rank amplitudes, but odd ranks only (1=1/1, 3=1/3, 5=1/5 ect). A triangle has the same odd ranks only, but amplitude decays way faster: 1/rank-squared (1/1, 3=1/3^2, 1:5^2 etc).
So, theoretically many signals have frequencies in their spectrum that would cross the Nyquist frequency and cause aliasing (reflecting back into the spectrum at half the frequency). But since generally, higher frequencies in the spectrum have lower amplitudes, aliasing gets more noticeable as lower and thus higher amplitude frequencies bounce back from the Nyquist frequency (so, when playing higher notes). After aliasing appears you cannot simply filter out these reflected frequencies, since they are now mixed in within the intended clean spectrum.
Now let’s look into FM/PM. Why is aliasing especially troublesome in FM/PM? Well…the most common synthesis technique, subtractive synthesis (osc–>filter–>amp) starts with some spectrum and only attenuates (filters) or emphasizes (resonance) EXISTING frequencies in the spectrum. Theoretically no NEW frequencies are generated (or generally at least not at annoying amplitudes).
With FM/AM and many other non-linear techniques, frequencies are generated that were not present in the original spectrum. Generally these non-linear techniques directly alter the shape of the signal/wave (so, some form of waveshaping). Any change in shape will change the spectrum (and vice versa). These direct changes in wave/signal shape can generate/alter frequencies anywhere in the spectrum and can easily result in (very) high frequency content, way beyond what was present in the original spectrum.
Going back to FM/PM (linear). Assuming one carrier and one modulator. The modulator modulates (changes) the frequency or most often the phase of the carrier (the one you hear) at audiorate. This evenly generates sum and difference frequencies to the left and right of the carrier frequency. Where these frequencies appear depends on the ratio between carrier and modulator. E.g. at ratio 1:1 you get harmonics/sidebands appear every one harmonics…so…none are skipped. For a 1:2 ratio each second harmonic is skipped, so only odd harmonics are generated etc.
Since we are summing/subtracting and generally like harmonic spectra, the ratios are generally integer ratios (seemingly non-integer ratios might just be integer ratios, some octaves up: 1:2.75 is effectively 4:11)
Anyway, with FM/PM ratios it’s a bit like PWM where the percentage of the pulsewidth tells you which harmonics are skipped in the spectrum. At 50% we already saw that each 100/50=2nd harmonic is skipped, resulting in only odd harmonics with amplitude 1/rank. At 25%, each 4th is skipped, at 20% each 5th etc. BTW, the harmonics amplitude of any pulsewidth in between sort of smears out toward the nearest higher amplitude harmonics. Those intermediate spectra look very much like comb filtered signals: many small humps.
Anyway: as the FM/PM modulator’s amplitude increases, frequencies are generated towards both the lower and the higher end of the spectrum. Ever more as the amplitude of the modulator increases.
In FM/PM, when (sideband) frequencies reach 0 Hz they reflect back into the spectrum at inverted phase and might interact with frequencies already present there in the spectrum (due to phase cancellation). But towards the higher end of the spectrum, as soon (sideband) frequencies reach Nyquist, they also reflect back into the spectrum and we get aliasing for those frequencies.
So, FM/PM can easily generate very high frequencies and is thus very susceptible to aliasing, especially at higher modulation amplitudes. Even when playing lower to mid range notes, high frequency content might bounce back from Nyquist. My Yamaha SY77 (1989) has noticeable aliasing at higher modulation/notes. And you can safely assume that Yamaha tried to avoid that as much as they could.
Finally, as with many audiorate modulation techniques, like AM and FM/PM, sum and difference frequencies are generated for each frequency in the spectrum (both in carrier and in modulator). This is mainly why FM/PM uses sines only. Richer spectra will soon generate so many frequencies you loose control over where you want them and where you don’t want them in your sound. And…higher spectral content will soon generate sidebands that will reach Nyquist real soon, causing aliasing. Also sooner reaching ‘FM-noise’ where the result is no longer really musically usefull.
Final word: Since lowpass filtering is not really a viable option here (since it is a complex task to predict all resulting frequencies), oversampling is a common techniques to temporary increase the samplerate, thus shifting the Nyquist frequency upward and avoid/diminish aliasing. As long as you filter out the high frequencies that would cross Nyquist, before reverting back to the lower samplerate. Another is bandwidth limiting by splitting the signal into its individual frequencies (FFT), and simply ignoring all frequencies above Nyquist before mixing/converting the remaining ones all back to a single signal (iFFT). There are many ways in which to mitigate aliasing, each with its own cost benifit.
Huh..by now this post has become somewhat long. I hope it contains some usefull information for some…
Just… impressive! Thank you so much for all of these explanations.
In fact, in my development since yesterday, I’ve tried to consider to “ignore” all frequencies above Nyquist (either for modulators and… carriers), but the result is bad. Best results at the moment is to set the frequency to sampleRate /2, if over. The developer of Dexed VST3/AU plugin is using another approach: he ignores Nyquist!
Of course, to go deeper, I’ll must repair my DX7 (battery + some electronic components such out-of-order capacitors must be replaced) in order to analyze the behavior at high ratios / frequencies (above Nyquist). Unfortunately I don’t have found any infos on the web about the DX7 vs. Nyquist.
The Yamaha DX7 (1983) uses a 12/bit DAC at around 50kHz. So…Nyquist frequency should be at about 25 kHz. Which is above the CD Red Book standard (1980) 44.1 Khz samplingrate, but below the CD Red Book 16-bit bitdepth.
The look-up tables (LUT) for the sines are only 10-bit. But, since mixing is summing sources and dividing by the number of voices…any mix of digital 2 signals will cost you 1-bit of resolution (halves the resolution). So the 10-bit LUT vs 12-bit DAC allows for mixing 4 10-bit voices with no loss of resolution. Since we only modulate phase, amplitude will stay untouched by the modulation. Only the carriers are mixed. So, theoretically, per voice loss of resolution by mixing will only occur for 5 and 6 carrier algorithms.
But, then…we still have a max of 16 voices to mix down to 1 output…
But apparently there’s some resolution enhancing trickery going on too:
This source gives a great overview of the technical side of the DX7 and mentions various other sources (also on the samplerate):
We know from the service manual that the OPS processes all 16 six-operator voices in ~20.368032μs. From this we can determine that the synth’s overall sample rate is 49096Hz.
A nice starting point, with various links to more detailled sources in these articles: