Anti-Aliasing Strategies For A Phase Distortion Oscillator

AsylumSpeaker
AsylumSpeaker Member Posts: 26 Helper
edited October 22 in Building With Reaktor

I'm building a phase distortion oscillator and as one might expect from that technique, aliasing is a major issue. I'd like to hear some opinions on the best way to approach limiting aliasing in such a dynamic and challenging situation.

A PD oscillator can create a huge amount of energy above nyquist very easily, and as far as I'm aware standard oscillator-centric approaches to limiting that, like polybleps, are irrelevant as the high frequency energy is generated by the sync process after the raw waveforms are synthesised.

Should I simply oversample the oscillator core? I can envisage a control setting where bass notes yield a peak in the upper registers that would alias even at 2x oversampling, were it played higher up the keyboard. Is a brick wall filter a good approach? What about using key tracking and sample rate to reduce peaking where the peak is above nyquist and can't be heard anyway? It seems like that would have an audible effect regardless...

This is the oscillator core, since I'm sure people will ask. The sync is doing the job of the rising phase driver in the classic Casio style design, and the falling sawtooth is the inverted phase driver. the [-1] macro is a single sample delay.

Comments

  • colB
    colB Member Posts: 987 Guru

    Is that just part of PD though?

    My understanding is that PD is taking a sinusoid and using some other waveform (Phase distortion function) to distort the phase over a single cycle. It is quite similar to a sinusoidal wavefolder in some ways.

    Casio did some other stuff like interleaving two waveforms ABABAB style, and applying an envelope - what you have here. But to my that is more of an extra trick to spice things up, while the phase distortion is the main thing?

    My impression after playing with it was that the casio idea of using an envelope per cycle is a way to reduce aliasing. The sinusoid starts it cycle at zero, and the envelope ends the cycle at zero, so even if you are playing fast and loose with the cycle's end phase, aliasing is significantly reduced.

    I think ideally, your phase distortion function would start the cycle at 0 and ends it at 1. That way there is no discontinuity. In that case, the only places where there is aliasing is those parts of the function that have discontinuities, or discontinuities in the derivative(s)

    As far as alias reduction, oversampling and bleps?. Although the bleps would be tricky to calculate, because it's a sinusoid, so there are discontinuities at 1st, second, third... etc derivatives... iirc anyway. The stuff in Vadims paper on hard syncing a sine oscillator might be appropriate... not sure.

    It might be possible to use ILO for this too, treat it as a wavefolder, so the main wavefom is the phase distortion funciton, and you stuck it through an ILO wavefolder. You will lose some high end, but thats probably a good thing here! Not sure if that works though - worth a try.

    Anyway, here's a good paper:

    FWIW, the alias reduction approach suggested in that paper seems... hmmm... a bit shady... maybe you can get it to work. I found that it didn't really work, and it also altered the character of the sound in a negative way - pretty sure I had it implemented as described. Don (salamaneranagram) also implemented PD from this paper and had no luck with their alias reduction approach... YMMV!

  • AsylumSpeaker
    AsylumSpeaker Member Posts: 26 Helper

    My impression after playing with it was that the casio idea of using an envelope per cycle is a way to reduce aliasing. The sinusoid starts it cycle at zero, and the envelope ends the cycle at zero, so even if you are playing fast and loose with the cycle's end phase, aliasing is significantly reduced.

    Exactly. There's a very significant reduction in aliasing by comparison with a naive sync algorithm. There are no discontinuities in the waveform, but there is one aliasing-critical component: The transition from the enveloped zero at the end of one cycle to the sine at the start of another.

    That's not far off being a pseudo-square wave shape, and would (does) create the kind of overtone series that can lead to aliasing.

    Now, I've just realised while creating that screen grab that perhaps I need to explore using a cosine rather than a sine to smooth that transition. But as you said initially, isn't that kinked waveform kind of the point? I'd prefer to find a solution that puts a little blep-like wobble at that corner, in the manner of a band limited square wave.


    PS, that paper you linked, I can't reach it. Presumably for new message board reasons. I will look up that hard sync sine paper you mentioned, of course.

  • colB
    colB Member Posts: 987 Guru
    edited January 2022


    EDIT: had a look back at my implementation, and there is a frequency mod control that does result in a hard sync type effect, so that's clearly part of the deal, at least for the casio approach. Thats only part of it though - you can have that set to zero and still have wild PD sounds...

    For what it's worth, I used a cosine.

  • AsylumSpeaker
    AsylumSpeaker Member Posts: 26 Helper

    That one worked, thanks!

    I'll work up a cosine version and see where that goes.

This discussion has been closed.
Back To Top