Alias Free Oscs, band limiting, and downsampling

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Borogove wrote:Assuming you blend between wavetables as the pitch changes instead of doing a hard cut between them, you can select some compromise blocksize (32 or 64 samples) to select the table -- as long as your pitch modulation doesn't get very deep and very fast, you'll rarely have any audible aliasing. If the modulation is too fast for that to work, then you actually have FM
yes. i want my osc to be able to accept FM and very fast envelopes. very fast envelopes clearly have spectral components in the audible range and therefore color the sound with modulation-sidebands. thats also a reason, why i generate my envelopes at sample-rate and update everything (also filter coefficients) at sample-rate. taken to the extreme: the faster an evelope gets, the more it approaches an impulse function which contains all frequencies with the same amplitude.
Borogove wrote:Strictly speaking, the spectrum generated by FM or PM always has unlimited harmonics of nonzero amplitude, so aliasing is guaranteed regardless of what wavetable you select.
that's true. unfortunately. is there a simple solution? ....mmmhhh......oversampling.....mmmhhh....jaaaa...don't know anything better at the moment.
Borogove wrote:The only way I can think of to avoid it is to synthesize one cycle of the modulated FM signal (either with brute force in the time domain or using Urs's IFFT strategy from the predicted spectrum) and use that as the wavetable; this doesn't allow you to have inharmonic partials. (It's also essentially equivalent to MadBrain's suggestion, now that I think about it.) So in fact if you want completely alias free FM, you may as well go straight to additive synthesis.
predicting an FM-spectrum???!!! wouldn't this require to evaluate a whole bunch of bessel-functions? at sample rate?!...i mean, the essence of FM is varying the FM index and maybe also the frequency ratio over time (-> again with envelopes, which should be updated at sample-rate (imo)). directly evaluating the bessel-functions is obviously brute force. but is there a simpler way to predict an FM-spectrum? i mean, i didn't think much about it yet.
Borogove wrote:If instead you decide you can accept some aliasing in your FM, then pick a wavetable that is an acceptable compromise between aggressive brightness (more partials, more aliasing) and mellow dullness (fewer partials, less aliasing)
at the moment i accept the aliasing in FM as i don't know really what i can do about it besides oversampling (which i don't want to do, at least not in my current synth project "aggressor" - which has FM but is not meant to be a FM-expert)
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

braindoc wrote:
Borogove wrote:The only way I can think of to avoid it is to synthesize one cycle of the modulated FM signal (either with brute force in the time domain or using Urs's IFFT strategy from the predicted spectrum) and use that as the wavetable; this doesn't allow you to have inharmonic partials. (It's also essentially equivalent to MadBrain's suggestion, now that I think about it.) So in fact if you want completely alias free FM, you may as well go straight to additive synthesis.
predicting an FM-spectrum???!!! wouldn't this require to evaluate a whole bunch of bessel-functions? at sample rate?!...
No, I'd compute the FM spectrum via Bessel functions and synthesize a new set of tables via IFFT periodically, blending between the synthesized tables in between.
i mean, the essence of FM is varying the FM index and maybe also the frequency ratio over time (-> again with envelopes, which should be updated at sample-rate (imo)). directly evaluating the bessel-functions is obviously brute force. but is there a simpler way to predict an FM-spectrum? i mean, i didn't think much about it yet.
Get out of the FM box, decide that there's nothing sacred about the Bessel-predicted spectrum, and instead think about interesting ways to specify a spectrum for a straight additive model. :)
Image
Don't do it my way.

Post

Borogove wrote: Get out of the FM box, decide that there's nothing sacred about the Bessel-predicted spectrum, and instead think about interesting ways to specify a spectrum for a straight additive model. :)
of course, i do. for instance, i like this one very much:

http://www.kvraudio.com/forum/viewtopic.php?t=107402

...and also have implemented some experimental stuff based on that - sounds very promising. but i thought we were talking about FM and not about additive synthesis.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Borogove wrote:Sounds like putting the horse *in* the cart and pulling it yourself to me.
I found myself laughing out loud the other day, and my wife asked what it was. I tried to explain the basic contents of this thread, and then said your punchline - which I had thought very insightful and an utterly hilarious analogy. She looked rather blankly at me..

Anyway, it's an analogy I will remember and trot out at appropriate times to others who bring on extra work for themselves.

thx russell!

DSP
Image

Post

braindoc wrote:
Borogove wrote: Get out of the FM box, decide that there's nothing sacred about the Bessel-predicted spectrum, and instead think about interesting ways to specify a spectrum for a straight additive model. :)
of course, i do. for instance, i like this one very much:

http://www.kvraudio.com/forum/viewtopic.php?t=107402

...and also have implemented some experimental stuff based on that - sounds very promising. but i thought we were talking about FM and not about additive synthesis.
At least we're not discussing the sexual habits of the common marmoset.

I guess my point, if any, is this -- if you want to do FM, you have the following choices:

a) Accept whatever aliasing comes
b) Oversample and filter off some of the aliasing
c) Bessel-predict the spectrum and refuse to allow combinations of modulator frequencies and depths which generate aliasing above a certain threshold
d) Bessel-predict the spectrum, bandlimit the predicted spectrum, then IFFT

But if you decide to go with route d), then it's time to ask yourself what the FM model is actually buying you, given that it's notoriously unfriendly to sound designers.
Image
Don't do it my way.

Post

Borogove wrote:...ask yourself what the FM model is actually buying you, given that it's notoriously unfriendly to sound designers.
What do you mean by this? Do you mean that FM is hard to do digitally, or that the timbres FM produces don't generally sit well in a mix, or something else? Maybe I'll learn something today.

Post

MackTuesday wrote:
Borogove wrote:...ask yourself what the FM model is actually buying you, given that it's notoriously unfriendly to sound designers.
What do you mean by this? Do you mean that FM is hard to do digitally, or that the timbres FM produces don't generally sit well in a mix, or something else? Maybe I'll learn something today.
i think, the point is, as soon as you use more complex FM configurations than modulator->carrier->out, the change of some paraemters will often lead to hardly predictable changes in the output sound - as opposed to a -say- cutoff-control. when tweaking a cutoff, you (almost) always know in advance, what will happen
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Borogove wrote:
I guess my point, if any, is this -- if you want to do FM, you have the following choices:

a) Accept whatever aliasing comes
b) Oversample and filter off some of the aliasing
c) Bessel-predict the spectrum and refuse to allow combinations of modulator frequencies and depths which generate aliasing above a certain threshold
d) Bessel-predict the spectrum, bandlimit the predicted spectrum, then IFFT

But if you decide to go with route d), then it's time to ask yourself what the FM model is actually buying you, given that it's notoriously unfriendly to sound designers.
i think i would choose option b, that's why:

a)aliasing....iihhhhh

c)mmhh...if this means to choose a low maximum value for the fm-index, maybe in some cases it would be acceptable. but if this means to make the maximum value of the fm-index dependent on the frequencies of the carrier and the modulator - awkward and not really what the user expect from FM

d)how would this work for complex fm-configurations, maybe even with feedback? also, i don't like to work block based - introducing an arbitrary blocksize always seems somehow "unnatural" to me - i want to update everything sample-by-sample (as much as possible)

b)expensive, but robust and without side-effects - i vote for b unless someone can point me to a better option

however, fortunately i'm not about to implement a dedicated FM-synth as there are fantastic ones out there (FM7, Sytrus) - nevertheless, it would be intresting to know, how they tackle these problems.

BTW: did you take a look on the PadSynth?
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

braindoc wrote:i think, the point is, as soon as you use more complex FM configurations than modulator->carrier->out, the change of some paraemters will often lead to hardly predictable changes in the output sound - as opposed to a -say- cutoff-control. when tweaking a cutoff, you (almost) always know in advance, what will happen
Yep, what he said. FM isn't generally a friendly model for the *user* (= sound designer) due to the indirect relationship between the controls and the spectrum.
Image
Don't do it my way.

Post

braindoc wrote:b)expensive, but robust and without side-effects - i vote for b unless someone can point me to a better option
Yeah, if I cared about FM that's probably the way I'd go on a modern synth too.
however, fortunately i'm not about to implement a dedicated FM-synth as there are fantastic ones out there (FM7, Sytrus) - nevertheless, it would be intresting to know, how they tackle these problems.
I'm guessing a) and b), mostly a)
BTW: did you take a look on the PadSynth?
Yeah, I like the concept.
Image
Don't do it my way.

Post

braindoc wrote:it would be intresting to know, how {FM synths} tackle these {aliasing} problems.
I found an old thread on music-dsp that suggests that the DX7 has an option to roll off mod depth starting above a certain note, which would address it.
Image
Don't do it my way.

Post

Hey, sorry, I fell out of the loop here due to some update stuff that currently keeps me busy.

Braindoc, yes, extracting the exponent like you did was exactly what I suggested. Glad it works out, I wasn't too sure of that ;)

Btw. as the phase increment is always positive (there's no negative frequency, even in FM, I guess?) you don't have to mask out the sign bit. Or am I just confused now?

Regarding that hardsync code, here's one of them, but it's just the branch-free, not the antialiased:

http://aulos.calarts.edu/pipermail/musi ... 28847.html

Hmmm, dunno where it went :-|

;) Urs

Post

Urs wrote: Braindoc, yes, extracting the exponent like you did was exactly what I suggested. Glad it works out, I wasn't too sure of that ;)
:tu: yes, works well. thanks for the good tip.

Btw. as the phase increment is always positive (there's no negative frequency, even in FM, I guess?) you don't have to mask out the sign bit. Or am I just confused now?
i think i get some negative increments in my current implementation of feedback-fm (my machine crashed away when i left out a check for this :uhuhuh: )

edit: but this was not the reason to mask the sign bit. if i dont mask it i would get a leading 1 left to my actual exponent.

edit2:...for negative increments.... :dog:
Regarding that hardsync code, here's one of them, but it's just the branch-free, not the antialiased:

http://aulos.calarts.edu/pipermail/musi ... 28847.html

Hmmm, dunno where it went :-|

;) Urs
i'll have a look at it.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Ah... I see!

Well, that other code... is more useful as a tutorial about creating branchless conditions. So it's at least a little bit on topic ;)

Cheers,

;) Urs

Post

Borogove wrote:Strictly speaking, the spectrum generated by FM or PM always has unlimited harmonics of nonzero amplitude, so aliasing is guaranteed regardless of what wavetable you select. Yay!


Actually in practise digital FM synthesis produces signals with a finite number of partials because the amplitudes of the highest partials are so negligible that they vanish to zero in digital representation of sound which has a limited number of bits to represent the instantaneous amplitude of the sound.

Post Reply

Return to “DSP and Plugin Development”