Aliasing in synths. How to prevent it?

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

Post

Re,

There are a good tool if you want oversample a VST in your DAW:

https://sites.google.com/site/vstoversampler/home

Edit: the download link is adf.fy link and the zip seems corrupted. Sorry.

Post

aciddose wrote:
kx77free wrote:Sync oscillators: FS *8 min, ideal *16 or *32.
Are you talking about naive?

It is possible to use a method like FIR filters to fully anti-alias sync without any over-sampling.

"Ideal" also is a bit tricky. To produce the same result as a "very low-quality" (5 samples long) FIR filter requires *32 and depends upon a "very high-quality" interpolating filter.

This should be easy to understand once you understand that the convolution is the same as infinite times oversampling, so the FIR filter acts directly as an interpolating filter with infinite resolution of input.


Are you talking about the Blep oscillators ?

I never really tested the minBlep oscillators because I prefer the additif synthesis to control each harmonic of the look up table. By this method we can make complex true analog waveforms like those of VCS3.

I'm currently testing polyBLEP oscillator based on this KVR thread:
http://www.kvraudio.com/forum/viewtopic ... 3&t=375517

So, I have got similar results of look up table with an oversampling of x8, this is the minimum with hard sync...
With x16, the result with hard sync is very good with more high frequencies than a true analog synth.

Post

"BLEP" is a specific type of FIR filter kernel. It is important not to think this way, FIR filters should be viewed more abstractly and "minBLEP" should really only be referred to in the context of a discussion on FIR filters.

As far as oversampling applies to FIR filter kernels; remember that all you are doing is making the approximation of the original continuous function more accurate.

In other words increasing oversampling and improving interpolation will only act to remove error introduced by sampling of the kernel.

What really matters are the properties of the kernel itself.
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

How to avoid aliasing?

1. Use real analogue synths
2. If 1. Is not an option, avoid low and high notes.

Post

Hi,

Sorry , it's little out of this topic...

@acidose
I search a way to simplify my oscillators code in an oversampled modular synth and actually the polyblep is a good compromise even there are more limits than complex wavetable oscillators. I want to oversample all audio processes to down sampling only the output.
The minblep oscillator code seems too complex to do that, I will have no improvements to simplify the code by report of band limited wavetable oscillators.

@.jon
It's not really true, some hardware synths are little "crappy" even they do not produce digital aliasing...
Nothing is perfect in this world but when we work about the musicality of the instrument, we have good results.
And the good way is also to avoid VA which produce aliasing.

Post

My FIR/blep code looks like this:

Code: Select all

phase += delta;
while (phase >= next || sync) {
 T fraction = (phase - next) / delta;
 set_phase(fraction, next);
}

set_phase(fraction, target) 
{
 event_phase = phase - fraction * delta; // unless sync or other cause == delta >= 0 ? next : last
 // get difference between current state and target phase state,
 // insert impulses: 
 zero.add(fraction, newlevel - oldlevel);
 first.add(fraction, newdelta - olddelta);
 ...
 next/last = phase of next/last state change
 phase = target + fraction * delta
}

output = filter(level); // filter(x) = delay(delay(x) + impulse0) + impulse1, ...
Extremely simple. Exactly the same as polyblep.
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

chk071 wrote:Is there any free VA synth which aliases (badly) so one can audition that phenomenon? I never really noticed aliasing anywhere, could be just the sounds i make, but i guess i never went that high to really be able to notice it.
If you have access to FL Studio, try the native 3xOSC plugin. I hear very aliased saw waves in the higher notes.

Post

Yorrrrrr wrote:
chk071 wrote:Is there any free VA synth which aliases (badly) so one can audition that phenomenon? I never really noticed aliasing anywhere, could be just the sounds i make, but i guess i never went that high to really be able to notice it.
If you have access to FL Studio, try the native 3xOSC plugin. I hear very aliased saw waves in the higher notes.
ANA (Sonic Academy) also produces very noticeable aliasing at high pitches
You may think you can fly ... but you better not try

Post

aciddose wrote:My FIR/blep code looks like this:

Code: Select all

phase += delta;
while (phase >= next || sync) {
 T fraction = (phase - next) / delta;
 set_phase(fraction, next);
}

set_phase(fraction, target) 
{
 event_phase = phase - fraction * delta; // unless sync or other cause == delta >= 0 ? next : last
 // get difference between current state and target phase state,
 // insert impulses: 
 zero.add(fraction, newlevel - oldlevel);
 first.add(fraction, newdelta - olddelta);
 ...
 next/last = phase of next/last state change
 phase = target + fraction * delta
}

output = filter(level); // filter(x) = delay(delay(x) + impulse0) + impulse1, ...
Extremely simple. Exactly the same as polyblep.
Hi,

Thanks to share a part of your code but in fact I just need to know where I'm going.
I tested with interest your alpha.
If you do not use oversampling and if you implement the blep impulse like the polyblep... Effectively your blep method is simply very good in case of classic waveforms: saw, pulse and tri with or without sync.
But I read that is not really possible to use the blep impulse on sine or on wave tables based on additive synthesis with another form that the classic saw, tri and pulse per example to decrease the aliasing created by the oscillator synchronization.

Is it true?

Anyway , following my last tests, I think that it is possible to improve the render of oscillator sync by mixing in the high frequencies a special band limited wave table with the same accentuation around the harmonics 4 and 8... I will test that.


ps:
You can also test my wavetables with the Kx-Modulad, there are two main panels, the second is the gui of my waveform builder (console program). With this panel you can control the level and the phase of the 40 first harmonics and to build up to 1600 harmonics (for 13.75 hz, 0 volt) you can loop a part of these ones. You can also mix the wavetables and change the wavetables following the volt scale (frequency).

Xavier

Post

kx77free wrote:But I read that is not really possible to use the blep impulse on sine or on wave tables based on additive synthesis with another form that the classic saw, tri and pulse per example to decrease the aliasing created by the oscillator synchronization.

Is it true?
No. That was 100% a lie or came from someone completely ignorant.
kx77free wrote: Anyway , following my last tests, I think that it is possible to improve the render of oscillator sync
You'll have an awful time improving upon something limited purely by the filter kernel used.
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

TL;DR thread, but has anyone mentioned xoxos' synth suite? It's 4 otherwise similar synths with different types of antialiasing, with adjustable oversampling and filter types when applicable. Very good for demonstrating the pros and cons of the different AA implementations.

http://www.xoxos.net/shop.html#synthbundle

Post

Hi aciddose,
aciddose wrote:No. That was 100% a lie or came from someone completely ignorant.
Thanks, I hope that because in fact I never see something about on the web, an example to implement the blep on sine or similar wave to decrease the sync aliasing.
Perhaps it's possible but probably the method is not the same if we use additive waveforms.
aciddose wrote:You'll have an awful time improving upon something limited purely by the filter kernel used.
I'm talking about my actual way to decrease the aliasing with oscillator sync on the very high frequencies with band limited additive waveforms.

Xavier

Post

If you've already sampled the additive waveforms you can apply sinc just as with any other signal with discontinuities. The accuracy depends upon how you treat the samples. Using sinc to replace the samples is ideal, although you can also treat them as zero-order-hold and apply blep or similar kernels accepting the drawbacks of that.

In order to smooth the discontinuities introduced in sin(), you need to be aware that sin() is infinite order. So unless you insert corrective impulses up to infinite order you'll never get a "perfect" result. That said there is no such thing as a "perfect" result, neither is additive or any other method "perfect" by any possible definition so therefore it is a stretch to come up with any justification for thinking that this situation is special compared to any other.

(Although, technically the approximations for sin() used in software are not infinite order and can be solved perfectly.)

You can eliminate the vast majority of the aliased harmonic content using up to third order.

Still though, in most cases there are better solutions. You might rethink the methods you're using rather than use convoluted solutions to handle their drawbacks and corner cases.
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

Hi,
aciddose wrote:Still though, in most cases there are better solutions. You might rethink the methods you're using rather than use convoluted solutions to handle their drawbacks and corner cases.
Yes, I'm improving my actual DSP processes but sometime it's necessary to explore different ways to have references, to compare the results.

This week end I improved the way to smooth the fade used to reduce the aliasing by using a sin()
, I oversampled *8 also.
I will try to oversample only the moment where the wave is broken to reduce the CPU.

Results in relative percent of CPU use, actual tests:

- no sync
0.2%, no aliasing (band limited wave tables)

- sync without oversampling (band limited wave tables):
0.4%, aliasing -80 dbfs to -65 dbfs (+/- high frequencies)
(slave incr/master incr ) *slave incr + fade (4 to 20 samples)+ mix to BLT waveform (for very high frequencies)

- sync oversampling *8 (band limited wave tables):
2.2%, aliasing <= 80 dbfs in all case.
(slave incr/master incr ) *slave incr + fade (4 to 20 samples)
With the oversampling the fade is hidden of the waveform in the scope.

- sync with PolyBLEP and oversampling to *8 (naive SAW waveform):
1.7%, aliasing -80 dbfs
Note, It is not possible to use the PolyBLEP without oversampling...

Xavier

Post

Re,

@aciddose
I tested again and I saw that I did an error in my code inside the sync sine processes of my Kx-synth-x16, when the VCO1 sine is only used and synchronized... I used this one for my tests. I forgot to modify one statement of the interpolation for the high frequencies. I use two interpolations, one for reading the main look up tables and the second one for the transition between each look up tables. For the very high frequencies I use only the main interpolation because the end look up is a simple sine.
So I corrected that and I compared with a Blep Sine sync and I see that the aliasing noise is similar (around 80 dbfs +- 10 db) without oversampling, the difference is around the extremities, there are more harmonics with Blep processes but the levels are very low to listen something with the Sine. Of course when I oversampled by a factor of 8, I have got better results (like a real analog synth)but the CPU is increased. Now I know that I can have the same render, I must optimize that. I can have less CPU use with Blep oscillators but It's important for me to keep my wave table oscillators because I prefer to control the timbre of each waveform. The blep oscillators are sounding very similar, always the same sound, the additive synthesis is really better to simulate a particular timbre like the vintage synthesizers. To do the actual electro music sounding the Blep oscillators are perfect but it's not really my cup of tea. In this case your code is better than the Polyblep but I will not disturb you on KVR.

I'm trying to oversample only the sync moment but the filter delay is not constant even with a FIR filter, I must build a filter with a regular delay for all frequencies but I'm not sure about that because a complex code will use also a lot of cpu if I want the same results than the full oversampled processes.
Anyway I will not use the Polyblep oscillators because they are not aliasing free without oversampling for purists like me.

Xavier

Post Reply

Return to “Instruments”