New Antialiasing Technique?


#1

Anyone seen http://www.airwindows.com/slew2-2/
I'd love to know how this was done.

a|x


#2

Hello toneburst,
I'm new here (just ordered my axoloti :slight_smile: .
I'm a plugin coder (in JSFX a built in plugin language of Reaper), anti aliasing is sort of an obsession for me.

I'm not really convinced by the video because the test signal is noise.
I think that I'll download and test this plugin next week end with a sine sweep
.


#3

I posted about this on the Mutable Instruments forum, and got a reply from Olivier, who designs all the MI products.

According to him, this technique wouldn't work as a general anti-aliasing solution for digital oscillators.

I'd be interested to hear your take on it.

Of course, the source isn't available, so we can only guess how it works.

a|x


#4

It appears to be a steep lowpass filter with a signal dependent response.

There is no simple way to remove aliasing from a signal once it's there.


#5

Hi toneburst and DrJustice,
I'll definitively have a look at his plugin tomorrow :slight_smile: I'm very curious to see what he achieved to do.


I've done some experiments (with JSFX plugins in Reaper) some time ago with a first order LP filter of the form:
y += a * (x - y)
"y" is the output
"x" being the input and the filter coefficient "a" being a function of x.

My results were not alias free and the saturation effects were too soft to my taste (more like a low pass limiter).
So i switched to other antialiasing methods (pre integrated tables).


#6

A low pass filter (or any filter) will help if the aliased frequency components happen to be outside the pass band. However, with e.g. the varying frequency and spectral content of an oscillator, the aliased frequency components come back and haunt us at frequencies that usually land in the range that we want to hear.

As you suggest, avoiding generating aliasing in the first place is the only realistic way to avoid it. I.e. always produce a bandlimited signal without any frequency components above half the samplerate.

Edit to add: Anti aliasing filters are applied before sampling (or resampling) a signal to strip it of frequencies above Nyquist for the target sample rate.


#7

Just out of interest, how might one go about eliminating aliasing from a system where the input isn't known, ie an effect algorithm?

a|x


#8

If the input already contains aliasing no effect will remove them.

Some effects - linear effects - won't add aliased components : say chorus, phasing, flanging, filters, reverb, delays.

But as soon as the effect includes a non-linear element (distortion or saturation) it will generate a bunch of overharmonics that are likely to alias.

Anti aliasing of non linear effects is still an open field. There is many techniques out there.
I've started a small doc about my favorite method here: http://stash.reaper.fm/28384/DifferentiatedPolynomialWaveTables.pdf but i'm not sure i'll be able to adapt it to the axoloti.


#9

@SmashedTransistors I'd love to know if a DPW (is that the right term?) wavetable setup could be done on the Axoloti.

A way of recording audio and automatically slicing it into DPW-optimised wavetables wiuld also be very cool.

a|x


#10

Some random unfinished and unproven Sunday ideas for anti-aliased oscillators. They could be wrong, or not beneficial in practice, but maybe inspiring somehow?

  • representing the pre-integrated wave in integer can perfectly recover from overflow if the playback speed is limited, and avoid the need for double precision floating point. Ultimately floating point representation is not an advantage, only the number of mantissa bits matter. In floating point, the accuracy will drop towards the end of the table, while integer results in a constant accuracy.

  • the pre-integrated wavetable concept could also extend to a 2D (or 3D) summed area table

  • complex oscillator waveforms could be obtained from a set of octave-stacked DPW oscillators. A DPW oscillator only deviates at one single sample from the straight function (at the transition). When the phase difference of each oscillator is 180 degrees compared to the corresponding higher octave, there is really only a single transition at a frequency one octave higher than the top octave across all octave-stacked oscillators.
    x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.
    .x...x...x...x...x...x...x...x..
    ...x.......x.......x.......x....
    .......x...............x........
    ...............x................

    This could lead to a massive reduction in computation. The tricky part is dealing with changing frequencies, jumping the top octave to the first below nyquist.

  • noise shaping the oscillator period? When the period time is an integral number of samples, the alias frequencies align with the desired spectrum. Now that does not produce the desired frequency, but this could be seen as an application of noise-shaped quantization.

  • Cancelling aliases with another oscillator? Cancelling the first order aliases would already be a significant improvement. Perhaps an approximation could be created with an SSB frequency shifter?


#11

Sure it does, in fact my problem is that i've been coding JSFX plugins for quite a long time and i'm somewhat addicted to doubles.

I think that second order pre-integration can work with 32bit floats for non modulated dpw oscillators (w stands for waveform or wavetable here). As you stated, the phase change is steady and the 1/delta_phase factor is not a problem.

But as far as i experimented it won't work for phase modulated dpw oscillators (or distortions).
The problem is that the phase is modulated we get factor of the form 1 / (delta_phase + delta_modulation)
which can lead to division by 0 (or something very small = > accuracy issues).

I'm not very confident with my abilities to handle/combine integer divisions to get high precision fixed point arithmetic.

Maybe, 1st order DPW and 4x oversampling with floats will be the solution for anti-aliasing phase modulated wave tables and distortions. That will be my first try.

I'll certainly experiment all these in a month or two.

I just ordered my axoloti :package: and i already plan all that...

By the way, i've spent half my week end browsing this forum :books: and i'd like to thank all its contributors :smiley:


#12

Yes but, like MIP MAPs, it does not handle anisotropy well (texture in perspective)


#13

I think that BLEPs are that kind of oscillators ?...?
[Edit]
oops, I misunderstood,
by first order, you mean first reflection (not aliasing of first order discontinuity) ?
The problem will be to control the phases of the cancelling signal.

Another idea is to use a tuned comb filter that attenuates what's between harmonics.


#14

I started to experiment with pre integrated wavetables.
My goal is to make an antialiased wavetable object capable of phase modulation.

I did not achieved to make a 2nd order integration. 32 bits are not enough and i had artefacts in the low pitches (ill values due to divisions by small numbers).

Anyway, here is an implementation of the first order DP wavetable with phase modulation.

At the moment, the pre-integrated polynomial wavetable is hard coded.
I wanted to see if it can be implemented on the Axoloti and if it is efficient. In fact it seems to be.
I use a float division along with fixed point operations.

It is a first order DPW, so the antialiasing is not perfect. It will need x2 or x4 oversampling for extreme
modulation or when used for distortion.

The object:
Wave3.axo (13.3 KB)
A simple patch:
Wave3.axp (3.0 KB)


#15

Awesome @SmashedTransistors

Definatly going to try it out. I have made many different wavetable subpatches, but they all use a lot of DSP. So I look forward to try a dedicated object :wink:

I will get back to you on it.

I have made a wavetable morph subpatch that morphs between 4 waves. You can try it out here:


#16

@SmashedTransistors

Ok, tested the patch, seems like it is working pretty well. No disconnects or any odd behaviour.

But I think you can all ready make phase modulation on wavetables as it is now. Use the drj/osc/phasor_pm_pr_b from DrJustice to drive the table. ANd modulate the phase input...

Probably not a efficient as a dedicated object. Look forward to see how the object you are working on will develop, as I am addicted to wavetables :wink:


#17

Hi jaffasplaffa,

sorry, i was so busy experimenting that i did not took time to try your patch, i'll do it tomorrow.

Directly driving a wavetable with a modulated phase will produce aliasing for high pitch or heavy modulation.
Aliasing is what i am fighting.

My first goal here is to adapt an anti aliasing method I already used in JSFX plugin's.
Once I find the best way to implement it on the Axoloti I will certainly make different objects (oscillators and distortions).

So this evening, i experimented 2nd order differentiation with 32 bit integers, even with optimisations.
~ 1900 cycles, inaudible at high pitch aliasing but i had glitches in certain conditions (low frequency and deep phase modulation).

I tried using some 64bit integers (the STM32F4 has 32bx32b -> 64b mul and mulad) for the most critical sections of code. ~ 3000 cycles but it was not enough... again glitches when using slow and deep phase modulation.

So, for the moment, i won't try to use 2nd degree.

The first degree DPW is around 1200 cycles, I will try to use some oversampling.


#18

Hey man :slight_smile:

Sorry, I am not so much into the coding language, som I dunt understand some of the stuff you say. But I find it interesting to test new ways of using wavetables :slight_smile:

Loo forward to see what you come up with :wink:


#19

Here is a practical example of aliasing vs antialiasing:
https://soundcloud.com/thierry-rochebois-1/pre-integrated-wave-table-antialiasing-test
It is a glissando.
The first time, wavetable with linear interpolation.
the second time, the same wavetable with a 3rd order pre-Integration and DPW.


#20

Wow huge difference! Sounds VERY clean, the second one. I look forward to your final wavetable object.

One thing I'd like to suggest is to keep the system "open". By that I mean it would be super nice that the object is not locked to a specific size wavetable. For example @thetechnobear 's WT object is nice, cause you can use it with any size, just set number of waves and the size for each wave and you are good to go: