Nu Audio Science ·
OK im new to this so don't laugh.
If something is aliasing in GFX you render a lot of copies and move them all out of sinc to counteract this (Anti Aliasing) , How do you anti alias in audio ?
From the original SynthMaker forum (2004–2014), with its members’ names and dates.
Nu Audio Science ·
OK im new to this so don't laugh.
If something is aliasing in GFX you render a lot of copies and move them all out of sinc to counteract this (Anti Aliasing) , How do you anti alias in audio ?
stefan ·
Nu Audio Science wrote: OK im new to this so don't laugh.
If something is aliasing in GFX you render a lot of copies and move them all out of sinc to counteract this (Anti Aliasing) , How do you anti alias in audio ?
Actually, what you do when you do that in graphics is what we usually call "oversampling". That means that you run the same process for instance at 4x the sampling frequency and then you downsample.
Nu Audio Science ·
So would that achieve the goal of getting rid of the Aliasing ?
If it was 44.1 you would processs at 196 y ?
Nu Audio Science ·
Also another quickie If you use say 2x oversampling is the CPU hit proportional ? I should clarify i knew of oversampling but didn't know its uses ?
stefan ·
Nu Audio Science wrote: So would that achieve the goal of getting rid of the Aliasing ?
If it was 44.1 you would processs at 196 y ?
¨
Well, 44.1 x 4 = 176.4Khz, but yes 🙂
Nu Audio Science wrote: Also another quickie If you use say 2x oversampling is the CPU hit proportional ? I should clarify i knew of oversampling but didn't know its uses ?
Depends on the implementation, but most of the time, yes. Sometimes one can use small tricks to make it a bit less, and sometimes, the overhead of up and downsampling is big, in comparison, which would make it use more than 2x as much cpu. Generally, oversampling is used when there's no other more efficient (or easy enough) way to get rid of aliasing.
For instance, the standard oscillators in SM are alias free, but they are not oversampled. If you do things properly, you can generally avoid aliasing noise without oversampling. For some algorithms oversampling basicly is a must though (distortions and so forth).
Nu Audio Science ·
Yes 196 - 176 Sorry hit the wrong key there DOH.
Cheers for the info Stef 😉
Sk ·
I don't know if there is a different definition of aliasing in DSP theory, but this is what I knew from Signal Theory.
When you sample a signal, what you do is creating spectral copies of it. If the signal has a bandwith B and you sample it with a sample frequency fs, then each copy is centered at 2n*fs (multiples of 2fs). So after sampling you have the signal spectral shape in base band, at 2fc, at 4fc and so on, in an (ideally infinitive) sum. When you want your signal back, what you do is sending it through a low-pass filter: this way you cut what is beside the frequency B, ie you kill the exceeding copies and have a single spectrum as you had in the beginning. (remember that a signal spectrum is even, meaning that the spectrum is mirrored in the negative frequencies range; when you "copy" it around 2fs, you copy the whole signal, ie a spectrum that goes from -B to +B).
The problem comes when B>=2fs. If this happens, adiacent spectral copy overlap and sum up; when you low-pass it, you have a different spectrum than the original one. This is solved by low-passing the signal also before the sampling process: this way you limit its band to a desired B. Obviously, this means that aliasing is originated only by signals with high-frequencies content, such as strings if I'm right.
This shows why audio signals (B=20 kHz) are sampled at fs=44.1 kHz (the exceeding 4.1 kHz are intended as a guard band).
Nu Audio Science ·
Hiya SK Thanx for the information dude 🙂 Extremely helpful to me at the moment cheers 😉
Sk ·
No need to say thank - I'm glad I help (when I'm able to 🙂).
wayfaerer ·
For instance, the standard oscillators in SM are alias free, but they are not oversampled.
I know this is an old post, but I have a quick question. What happens when an oscillator receives a value > 1? I tested it, and with a poly readout I could see that something was still being outputted from the oscillator. I would think that the oscillators would not accept any values over 1?
Assuming they DO accept values > 1, can someone explain the best way to prevent a value > 1 from reaching the oscillator? In code, I have this, but it seems very inefficient:
out=((in) > 1) & 0 + ((in) <= 1) & (in);
I have this running separately for 32 oscillators and it tacks on an extra 2-3% CPU.
rl ·
It depends. Connect some osc's to a frequency analyser and have a look at the spectrum: when cranking up the frequency Saw, Square and Triangle reduce overtones and also skip the base frequency at nyquist (==silence). The sine osc doesn't seem to be bandlimited. Above nyquist the spectrum folds back into the audible range (=aliasing).
Re efficiency: I'd rather control the frequency input. In case the frequency doesn't change fast (no FM at audio-rate involved) you could "hop" the statements every 32th sample or so, like:
... streamin freq; ... float limit=0.8; ... hop (32) { freq = (freq < limit) & freq + (freq >= limit) & limit; } ....
Usually I'm staying a bit below nyquist to have a little headroom for following filter or non-linear amp stages.
wayfaerer ·
Great explanation, thanks. I just saw this for myself as well. It's strange that the sine oscillator accepts values over 1, but the others don't. Is there any reason for this that I am missing?
Good call on the hop!
Acrobat ·
wayfaerer wrote: Great explanation, thanks. I just saw this for myself as well. It's strange that the sine oscillator accepts values over 1, but the others don't. Is there any reason for this that I am missing?
Good call on the hop!
I think it's not bandlimited because it has just one harmonic, so it is supposed to produce no aliasing...
Wrote something here? To have a post removed or your name hidden, write to [email protected].