The exact right solution to sample your f(x) without frequencies above
nyquist would be to use sync interpolation which would result in perfectly
filtered data, but that requires considering ALL the samples so is
impractical for real time usually, and seems so in your case if additive
synthesis is off the table.

DFT / iDFT processes are probably off the table too, as they are
computationally expensive.

You mention phase modulation.  Did you know that part of what makes FM
synth (and PM) sound the way it does, is because of aliasing?  At least if
you are thinking about bringing it up to audible levels of modulation to do
traditional FM / PM synth stuff.

Do you for sure need no aliasing?  If you don't need to be so exactly
correct, you can have a sliding scale of correctness vs processing speed
with a low pass filter.  Maybe you could find you have the processing power
to support a low pass filter that does a good enough job for you.

Also, maybe you are interested in being able to calculate sine waves
without trig?  I don't know the architecture you are working on, or details
of your situation, but maybe one of these could be a nice solution for you
to get additive bandlimited signals on the cheap.

http://blog.demofox.org/2014/11/04/four-ways-to-calculate-sine-without-trig/

http://blog.demofox.org/2015/06/14/a-fifth-way-to-calculate-sine-without-trig/

http://blog.demofox.org/2016/03/11/a-sixth-way-to-calculate-sine-without-trig/

Wave table synthesis is a good idea though, as rbj suggests. It's
essentially a lookup table of a precomputed function, which is a common
technique in all programming, that can be a very nice win for performance
critical applications.

You probably are going to want a decent interpolation function though when
looking up into the table.

Lerp will add aliasing, and so will anything else that isn't sinc
interpolation, but cubic hermite interpolation is pretty decent as it
doesn't just interpolate values, it also interpolates 1st derivatives.

http://blog.demofox.org/2015/08/08/cubic-hermite-interpolation/

Also, if you are looking for some slick hacks, the demoscene guys know a
lot of audio tricks.  You can see some of them on shadertoy.com, like here:
https://www.shadertoy.com/view/ldfSW2


On Thu, Sep 15, 2016 at 10:27 AM, robert bristow-johnson <
r...@audioimagination.com> wrote:

>
>
> ---------------------------- Original Message ----------------------------
> Subject: Re: [music-dsp] Bandlimited morphable waveform generation
> From: André Michelle <andre.miche...@gmail.com>
> Date: Thu, September 15, 2016 1:12 pm
> To: r...@audioimagination.com
> music-dsp@music.columbia.edu
> --------------------------------------------------------------------------
>
> >> i presume, by "arbitrary ... waveform", you are restricting to
> quasi-periodic waveforms (like the tone or "note" you might expect from
> most musical instruments). so x(t+P) approx = x(t) where P is the current
> period.
> >>
> >> if so, the answer is yes: wavetable synthesis. crossfade between
> wavetables. crossfade as elapsed time evolves. crossfade as the note goes
> up and down the keyboard. crossfade as the user cranks the mod wheel (or a
> pedal or some other slider). make sure that the wavetables are phase
> aligned and the number of harmonics in each wavetable is appropriately
> limited to avoid aliasing (a small amount of foldover is doable, i think
> you can get away with 2 wavetables per octave along the "up and down
> keyboard" axis of interpolation).
> >>
> >> derivation of a set of sequential wavetables from a sampled note
> requires a pitch detector and a good interpolation alg.
> >>
> > That sounds like a static solution for a arbitrary but time-fixed
> waveform function.
>
>
>
> what's "static" about crossfading.  you're not crossfading from a
> "time-fixed waveform" to another *identical* waveform.  if the beginning
> and ending waveforms were identical, then it would be static.  but because
> the waveforms are different, crossfading from one to the other is a form of
> morphing.
>
>
>
> > If I get your suggestion right I need a lot of wavetables (each for a
> certain range in the spectrum) for each provided waveform shape. That
> unfortunately won’t work in my case.
>
> usually in most computer hardware situations, memory is cheap.  like 100s
> of megabytes.
>
>
>
>
> >
> > I have an automatable wave-shape parameter which seamlessly morphs from
> quad to triangle to sawtooth to square (http://codepen.io/
> andremichelle/full/8341731a1ff2bdc90be3cb88e6509358/ <http://codepen.io/
> andremichelle/full/8341731a1ff2bdc90be3cb88e6509358/>). I also have
> phase-modulation and hard-sync which we can leave out for now.
> >
>
> and you can sequentially crossfade through a bunch of wavetables to do
> that.   phase-modulation and hard-sync are just another collection of
> wavetables.  the core waveform generator is the same.
>
>
> > To read everything from wavetables I could quantise the wave-shape range
> and create 2d-wavetables and blend between four of them to avoid not only
> smooth frequency gliding but also wave-shape morphing. In fact it is a
> solution (thanks for that) but I was hoping for something more elegant.
> >
> > I could phrase my question more general:
> > Given any x(t): Is it possible to sample x(t) with a given sample-rate
> ignoring all frequencies (slopes) higher than SF/2?
>
> well, lessee
>
> 1. pitch detection (so you know how long a period is)
>
> 2. resample so that each period is a nice number N samples long.
>
> 3. DFT
>
> 4. eliminate harmonics above a top limit so that when the pitch is
> increased the harmonics do not alias (or alias very much).
>
> 5. iDFT and create new waveforms
>
>
>
> but all of that is in the purview of wavetable synthesis/analysis anyway.
>
>
>
>
> --
>
> r b-j                  r...@audioimagination.com
>
> "Imagination is more important than knowledge."
>
> _______________________________________________
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp
>
_______________________________________________
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Reply via email to