Aliasing in synths. How to prevent it?

VST, AU, AAX, CLAP, etc. Plugin Virtual Instruments Discussion
Post Reply New Topic
RELATED
PRODUCTS

Post

No, once you apply a sample&hold it creates aliased harmonics. It's exactly the same as a DAC, the input to a DAC is a sample & hold.

The only difference is the values are never clocked and quantized in a way that could be called "digital".

Instead, the clock for the sample&hold is potentially fully analog, the voltages are fully analog, the input and output signals are fully analog.

A sample&hold however produces aliasing.

You can do this with any subtractive with a pulse LFO waveform.

In my x1 design for example there is a low/audio switch for the modulator (not limited to low frequency) and I can use the pulse to modulate cutoff.

When the cutoff of a low-pass is low, the state moves very slowly. This is the "hold" state.

When the cutoff is high, the state moves very quickly and follows the input signal. This is the "sample" state.

This is exactly the same way any s&h circuit works.

Try it and you'll get aliasing, the rate you use for the cutoff modulation is your sample rate.

Make the pulses narrow if you want clean samples, otherwise you'll have the sample period where frequency content is allowed to leak from above the sample rate without being aliased.

Here is a Xhip preset to demonstrate: http://xhip.net/temp/S&H.adxi
https://soundcloud.com/xhip/aliasing

You need the alpha version for this to work. You can do the same in the last release version though, the preset format is just different.

Here is the analog version, with my "X1" analog synthesizer:
https://soundcloud.com/aciddose-1/analog-aliasing
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

Thank you very much aciddose for this explanation.
I'm glad that I finally could understand some essential info about aliasing.

I believe the aliasing in your examples is what people call "thin" and "digital" ... etc.

I'll try tonight taking your examples and Urs directions to alias all my synths (all digital, no analog yet) :hihi:
Using: Cubase Pro 15, Reason 13, Tascam US-4x4HR, MODX6, DM12D, LaunchKey 49, Yamaha guitar(Pacifica 612v) and bass (BB234) and some virtual instruments and synths.

Post

Xhip actually sounds horrible for this because the modulation is not anti-aliased. If it were, it would sound much better because the filter wouldn't directly produce aliasing or pass it on from the modulation waveform.

If the modulator were anti-aliased (to be honest I've considered adding an option) you'd still get the side-band products due to frequency modulation of the filter and you'd still get the positive aliases from the s&h effect. You need oversampling (I guess, not 100% sure) to eliminate that.

The analog version sounds so awesome because it only creates aliasing reflected from the modulator frequency, the sample rate. The positive aliases don't get reflected, they're filtered away by the DAC anti-aliasing filters.

The weird vocal effect is created by increasing the resonance. It's a combination of the non-linearity of the filter and the general hysteresis and feedback properties. You'd get a similar effect in Xhip, just not exactly the same.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

fluffy_little_something wrote:Does any modern synth alias at 96kHz? I don't think I noticed any aliasing since I switched to 96kHz, not even with my old SE stuff.
With FM synths you can go into MHz range if you overdo it.
Then it basically falls into white noise.
Blog ------------- YouTube channel
Tricky-Loops wrote: (...)someone like Armin van Buuren who claims to make a track in half an hour and all his songs sound somewhat boring(...)

Post

aciddose wrote:
If the modulator were anti-aliased (to be honest I've considered adding an option) you'd still get the side-band products due to frequency modulation of the filter and you'd still get the positive aliases from the s&h effect. You need oversampling (I guess, not 100% sure) to eliminate that.
So, how the signal flow should be to avoid aliasing or minimize it to the lowest possible?

For example, the normal basic signal in a subtractive synth:

Osc -> Filter -> Effects -> Volume -> Output
^-------^----------^------------^
^Modulators (lfos and Envelopes)^

I guess if you put a function say call it "AntiAlias(x,y)" and the function will oversample x parameter with y times, now if you call this function many times, this will increase the cpu usage, right?

The second thing I also wonder about is what "Fluffy little something" is doing by using 96khz sample rate in his projects. But I read somewhere (I really don't remember now), that the oversampling should be inside the plugin code (like the imaginary flow above) otherwise it won't prevent/affect the aliasing.
Using: Cubase Pro 15, Reason 13, Tascam US-4x4HR, MODX6, DM12D, LaunchKey 49, Yamaha guitar(Pacifica 612v) and bass (BB234) and some virtual instruments and synths.

Post

I can't say anything about the signal path, but all signals must be fully anti-aliased and 2x oversample is required for any multiplications (volume, etc).

When we begin talking about frequency modulation it is difficult to make a general rule. It is a bit complicated.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

I understand. Thank you once again for the explanations :)
Using: Cubase Pro 15, Reason 13, Tascam US-4x4HR, MODX6, DM12D, LaunchKey 49, Yamaha guitar(Pacifica 612v) and bass (BB234) and some virtual instruments and synths.

Post

EnGee wrote:
aciddose wrote:The second thing I also wonder about is what "Fluffy little something" is doing by using 96khz sample rate in his projects. But I read somewhere (I really don't remember now), that the oversampling should be inside the plugin code (like the imaginary flow above) otherwise it won't prevent/affect the aliasing.
I don't know how it works, but I think it doesn't really matter which part of the system orders the oversampling, the result is probably the same regarding the output of the synth. But when I use 96 kHz within my DAW, it is applied to everything (including other synths and effects), not just the section the developer of a particular plugin specifies (for instance the oscillators of his own synth).

Post

and the function will oversample x parameter with y times,
Uhm not. You can't oversample signal that already got the possibility of aliasing. Aliasing is irreversible.

You need to oversample processing block (filter or whatever) to run at frequency higher than sample rate. The most common solution is to process two samples in each cycle. Effectively processign bandwidth becomes 88,2 kHz while DAW sampling rate is still 44,1 kHz. Once this is done, you simply cut everything above 22 kHz. Then if you reduce sample rate back to 44,1 kHz, only clean signal up to 22 kHz remains.
Blog ------------- YouTube channel
Tricky-Loops wrote: (...)someone like Armin van Buuren who claims to make a track in half an hour and all his songs sound somewhat boring(...)

Post

fluffy_little_something wrote: I don't know how it works, but I think it doesn't really matter which part of the system orders the oversampling, the result is probably the same regarding the output of the synth.
Actually each time you go up, a filter is applied. Each time you go down, a filter is applied.

This means if you're running at a low rate and each plugin in the chain needs to oversample again and again you could end up with a huge number of filters. These filters are expensive, but not only that...

These have a cumulative phase-shifting effect and any imperfections (pass-band ripple) will be multiplied each time.

So for this reason you always want these effects to take place (mostly) outside the audible band. Running at 96k (48k X 2) is usually good enough to accomplish this.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

Someone mentioned distortion before, is it particularly prone to aliasing? Just wondering because it says in the Sylenth specs that the distortion unit has 4x oversampling in order to minimize aliasing artifacts. They don't mention 4x oversampling anywhere else, only 2x for the chorus and phaser.

Post

EnGee wrote:The second thing I also wonder about is what "Fluffy little something" is doing by using 96khz sample rate in his projects. I read somewhere (I really don't remember now), that the oversampling should be inside the plugin code (like the imaginary flow above) otherwise it won't prevent/affect the aliasing.
No, thats not true.

Heres an example of a synth that uses 2x Oversampling internally.

Listen to 44100.wav, then to 192000.wav

The difference is so immense that one would literally have to be deaf not to hear it.

Download WAVs


PS: I used a PM patch here because it demonstrates the difference at 192000 vs 44100 extremely well. Its not anywhere near that bad on 44100 (in fact not even remotely) with say a Saw, in other words this is kind of a 'worst case scenario'.

Post

fluffy_little_something wrote:Someone mentioned distortion before, is it particularly prone to aliasing? Just wondering because it says in the Sylenth specs that the distortion unit has 4x oversampling in order to minimize aliasing artifacts. They don't mention 4x oversampling anywhere else, only 2x for the chorus and phaser.
Well yes. Distortion generates higher harmonics and if you already have 20 kHz signal, it will go much higher.
Blog ------------- YouTube channel
Tricky-Loops wrote: (...)someone like Armin van Buuren who claims to make a track in half an hour and all his songs sound somewhat boring(...)

Post

Thanks everyone.

I'm reading this article:
http://productionadvice.co.uk/high-samp ... und-worse/
I need to read it again tomorrow as there is a paragraph says:
"It’s quite common for ultrasonic content to cause intermodulation distortion right down into the audible range. Or in simple English, the inaudible high-frequency content actually makes the audio you can hear sound worse."


There are the comments from this article also:
http://www.homestudiocorner.com/sample- ... ting-hype/

Which I read that a mix at 44.1 is better than converted 88.2 or higher to 44.1


From my side I tested Arp2600V and it seems slightly better at 88.2 when going extreme with high frequency, but playing normally I didn't notice a difference that makes me "Wow! this is much better". With the Blofeld, I didn't notice a difference, but maybe this is due to the sound being processed in the synth then the audio transmitted to the audio interface? I don't know.

Final question: if using 88.2 or higher. Is there a need then to use high quality option (or oversampling) in the synth? As it is already with high sample rate?

I would be interested to know more about this topic but mostly for my projects I will keep using 44.1 :clown:
Using: Cubase Pro 15, Reason 13, Tascam US-4x4HR, MODX6, DM12D, LaunchKey 49, Yamaha guitar(Pacifica 612v) and bass (BB234) and some virtual instruments and synths.

Post

I'm still lost. Is this like a very tiny example of when you load one sample into a sampler and spread it all across the keyboard? The low notes are slow and distorted and the high are quick and chirpy?

...Or is it the holding/looping of the sample which aliases?

Post Reply

Return to “Instruments”