Author
|
What plugin synth has the least aliasing (especially in the oscs)?
|
Speakafreaka
IsraTrance Junior Member
Started Topics :
18
Posts :
779
Posted : Mar 2, 2008 23:41
|
Okay... when you discard samples, what you are effectively doing is limiting the rate of change of the sample waveform, or in other words, low pass filtering, in other words interpolating
from wiki:
Quote:
|
There are at least two ways to perform digital sample rate conversion:
(a) If the two frequencies are in a fixed ratio, the conversion can be done as follows: Let F = least common multiple of the two frequencies. Generate a signal sampled at F by interpolating 0s in the original sample. This will also introduce aliases at multiples of the baseband frequency. Remove these with a digital low pass filter, until only the signals with less than half of the output sample frequency remain. Then reduce the sample rate by discarding the appropriate samples.
(b) Another approach is to treat the samples as a time series, and create any needed new points by interpolation. In theory any interpolation method can be used, though linear (for simplicity) and a truncated sinc function (from theory) are most common. |
|
Low pass filtering and interpolation are mathematically identical.
As I said, it is a black hole, of misleading and ambiguous data.
Don't believe me?
Grab a slew limiter in your favourite dsp program, set it to very short times and note the effect on your audio. LP filter.
Wavetable with interpolated read = Antialiased Oscilator.
In other words, a well programmed interpolated wavetable osc does not serve up the precise value of the wavetable when the audio out needs it but an expression of the average of where its come from and where its going to, thus elminating aliasing. The problems with these oscs occur when you go down in pitch below the audio sample rate, which is why bigger wavetables are favoured, and many cheap and nasty wavetable synths struggle to dish out a satisfying bass.  .
http://www.soundcloud.com/speakafreaka |
|
|
Speakafreaka
IsraTrance Junior Member
Started Topics :
18
Posts :
779
Posted : Mar 3, 2008 00:15
|
|
heretical
Started Topics :
1
Posts :
77
Posted : Mar 3, 2008 03:18
|
psytendo,
true in theory anything could be done in reaktor Core. there is not enough time in the day though for me to learn all this though, and if i did learn it I wouldnt write it in reaktor anyway as opposed to writing straight out in a programming language.
really to your original question, i think alot of those synths just sound like junk to my ears. you should give reaktor a try or really all the synths that NI made using the band limited oscs they came up with around the time of reaktor 4 forward.
FM8 should probly do the trick if you don't want to bother with reaktor. An issue with Massive is I believe its sopposed to sound a little dirty. While absynth has AA oscilators I think they just added an AA routine to the original absynth oscilators and they are not the NI band limited ones.
Linplugs synths to me all sound like an analog synth that someone built out of cardboard boxes. Raptor just sounds like shit IMO. |
|
|
psytendo
Started Topics :
1
Posts :
73
Posted : Mar 3, 2008 05:55
|
heretical:
"true in theory anything could be done in reaktor Core. there is not enough time in the day though for me to learn all this though, and if i did learn it I wouldnt write it in reaktor anyway as opposed to writing straight out in a programming language. "
Well, reactor could speed up development in may ways and you can use bits from other people, but everyone has their own way of working.
I for instance mostly like creating sounds more than actually using them in a track
Anyway, thanks for the info. FM8 was one of my favourite synths actually, but i got a bit bored with it. Maybe time to renew a past love
|
|
|
psytendo
Started Topics :
1
Posts :
73
Posted : Mar 3, 2008 06:25
|
Speakafreaka:
Heh, yeah drop/repeat sample is the most basic way of resampling.
I'm still not sure how interpolation would remove aliasing if you have more samples than can be fitted in a samplerate (downsampling). Or just maybe not sure why you would call that process interpolation.
The bit i dont get is that interpolation is an adaptive form of filtering. It's cutoff or slope depend on how far the two sample points are apart. If they are far away then the interpolator (seen as a filter) reacts quicker to get at the right 'in between' value. It needs to bend steeper to move the distance.
If the points are more close it will react slower.
So if you look at it as a filter it would have either a dynamic cutoff or a dynamic slope (i dunno how the math works out). Its following the curve and adapting constantly.
But i get confused by the fact that to avoid aliasing you would need a very steep lowpass filter at a single cutoff with a static slope for a given source samplerate and a given destination samplerate (to satisfy sampling theorem).
So these two types of filters seem very different to me in the way they work and the sort of results they produce.
I hate quoting from Wikipedia, but its a fast resource of info so here goes:
http://en.wikipedia.org/wiki/Downsampling
The only mention of interpolation on that page is where they say:
"Note that a proper upsampling design requires an interpolation filter after increasing the data rate "
But that is again about UPsampling. The problem i was describing occurs when you DOWNsample something.
They do however say that you need a brickwall filter and aply it beforehand (just as i said) to do proper DOWNsampling.
So this article is actually supporting my thoughts.
Very confused now. |
|
|
Speakafreaka
IsraTrance Junior Member
Started Topics :
18
Posts :
779
Posted : Mar 3, 2008 11:41
|
Quote:
| The bit i dont get is that interpolation is an adaptive form of filtering. |
|
not right.
The amount of time it takes to move between to values is in effect the cutoff freq - unless you modulate it this is always static - whatever the points happen to be - really, its behaviour is totally consistent. A filter does not affect amount of change, it affects rate of change (which has an indirect effect on amount of change).
I'm on the verge of tying up a slew limiter in Synth Maker to an FFT so that I can show you - trust me, I'm know I'm right - I've done this experiment before!
Of course the slew limiter is totally linear, and not at all the filter we are after for this, but that isn't the point. Linear interpolation is done for speed an simplicity, not accuracy. For that you want sinc interpolation, but don't ask me to explain it.
Although, having said that, you *could* build a interpolater that had an ability to adaptively change according to freq of input.
Now we are talking about the difference between equal rate and equal time on portamento. This is another form of interpolation where I have no *real* idea what is going on. However, what I can say is that this is non-linear interpolation.
  .
http://www.soundcloud.com/speakafreaka |
|
|
Speakafreaka
IsraTrance Junior Member
Started Topics :
18
Posts :
779
Posted : Mar 3, 2008 14:05
|
And a thought about the filter before downsampling.
This is exactly what the interpolation is doing.
I will say again, just to make absolutely sure I've made this point very very clearly, interpolation and low pass filtering are exactly equivalent. There is no difference between the two at all.
The value of the downsampled audio output stream is derived from the interpolation of two upsampled audio samples (or more, depending) - therefore it is prior to the downsampled version - ie the audio output. You cannot produce the audio out before it is calculated!
If the filtering was done after, then you'd just call the last previous known osc value, say the audio stream was equal to that and then filter it, like an insert on an audio track, which clearly isn't going to get rid of lower harmonics. Only you will notice that actually, I've introduced a filtering function to downsample by selecting the previous known value... interpolation is hardwired into downsampling in other words. The degree of aliasing is determined by the quality of the interpolation. You'll never get rid of it completely in a digital system. Your only hope is to run at such a high freq that you can get away from it being in the audible spectrum. Or run at insane oversampling rates, therfore increasing the internal resolution of the osc and giving a more precisely calculated value to the audio stream.
This is easier then you might think. Instead of treating the osc as an array of values, you treat it as an array of arrays... I wll put up the psuedocode if you are iterested.
  .
http://www.soundcloud.com/speakafreaka |
|
|
psytendo
Started Topics :
1
Posts :
73
Posted : Mar 3, 2008 19:55
|
Still wondering.
Would your interpolation algo's curve still pass through all the original samples?
This is what i would expect from a normal interpolation algo.
Basicaly this is what i always thought was ment by a 2-point linear interpolation algorithm. This is also why i think that its rate would have to automaticaly adapt. This would be a side effect of lineary crossfading the two values.
It seems it shouldnt work as an aa filter because you wont get rid of any harmonics in the source sample. (they still exist in the sample as the curve still passes throught their points)
I imagine such an algorithm (say, linear) could in fact add to the spectrum of the original waveform as it can calculate points between the existing samples.
Some algorithms may be able to leave the spectrum alone but linear interpolation should not.
Somehow it seemed obvious to me that what you are describing is a reconstruction filter and not an AA filter.
Thats what's bugging me
thinking of it,
You'd have to interpolate over larger amounts of points to be able to filter out frequencies present in the sample.
The more points used, the lower the cutoff of the interpolation. Not sure how N point linear interpolation would look tho.
I could imagine sinc functions working somehow with just one sample but that would just be a FIR filter basically because you are just convolving sinc functions.
About the slew rate limiter, not sure what you want to say with it. Its just a type of filter, no? |
|
|
psytendo
Started Topics :
1
Posts :
73
Posted : Mar 3, 2008 20:07
|
"The value of the downsampled audio output stream is derived from the interpolation of two upsampled audio samples (or more, depending) - therefore it is prior to the downsampled version - ie the audio output. You cannot produce the audio out before it is calculated! "
Yes of course
You need to get rid of all frequencies in the source that will end up above the niquist rate after resampling. And you need to get rid of them BEFORE you do the actual resampling.
I think i got hung up on the word interpolation as i was assuming 2-point linear interpolation which wouldnt filter anything. But it would of course help smooth out the sampledata if it is to me upsampled.
|
|
|
Speakafreaka
IsraTrance Junior Member
Started Topics :
18
Posts :
779
Posted : Mar 3, 2008 21:14
|
Quote:
|
On 2008-03-03 19:55, psytendo wrote:
Still wondering.
Would your interpolation algo's curve still pass through all the original samples?
This is what i would expect from a normal interpolation algo.
Basicaly this is what i always thought was ment by a 2-point linear interpolation algorithm.
|
|
yes, all samples are worked on, or rather, all samples *can* be worked on.
Quote:
|
This is also why i think that its rate would have to automaticaly adapt. This would be a side effect of lineary crossfading the two values.
|
|
no, you just need to know where you are in the osc array and work with either the next or previous value.
Quote:
|
It seems it shouldnt work as an aa filter because you wont get rid of any harmonics in the source sample. (they still exist in the sample as the curve still passes throught their points)
|
|
You get rid of harmonics, because although you cycle through all values you don't output all values, only values that are needed to comprise the audio output.
Quote:
|
I imagine such an algorithm (say, linear) could in fact add to the spectrum of the original waveform as it can calculate points between the existing samples.
Some algorithms may be able to leave the spectrum alone but linear interpolation should not.
|
|
agreed - but as I said, linear interpolation is not done for accuracy - speed and simplicity are the name of the game. There are far better interpolation algos out there. Linear is just cheap on CPU, easy to implement and understand programmatically, so that is why I use it. I'm under no illusions as to its short comings.
Quote:
|
Somehow it seemed obvious to me that what you are describing is a reconstruction filter and not an AA filter.
|
|
filter is filter is filter... the effect will have broadly similar characteristics... its just which model is most suited to what you are up too.
Quote:
|
I could imagine sinc functions working somehow with just one sample but that would just be a FIR filter basically because you are just convolving sinc functions.
|
|
Woah! you cannot interpolate with one sample. You have to have at least two values. Just as it is impossible to express a sound in a 44100 system at anything above nyquist. The speaker generates vibration when it changes position. To change position you need at least two values. Sample rate/2=nyquist obviously.
Quote:
|
About the slew rate limiter, not sure what you want to say with it. Its just a type of filter, no?
|
|
It is an interpolater. For example, A portamento on a synth is a slew limiter.
You know the pitch you start from, you know the pitch you are going too. You control how long it takes to get there in time, which is expressible as a number of samples.
So, (endPoint-startPoint)/timeOfTransition = stepSize. Whereby step size is the increment you change the pitch by on each sample. This is interpolation. We Don't know the stepsize, we calculate it from two known values and the time the shift is to take.
You can express hz as time, so the nyquist is expressible, so you know the previous and next value of the oscilator...
And hopefully now you can see what oversampling is doing... ie creating more steps inbetween the two values allowing a preciser 'lock' of osc to audio rate.
It is exactly the same thing with a waveform in an oscilator, and when you really think about it a low pass filter.
All in all this has been a top notch and very interesting thread - top job!
Maybe if I say, the array of values is not the osc, the array of values followed directly by the interpolation is the osc it will be clearer?  .
http://www.soundcloud.com/speakafreaka |
|
|
psytendo
Started Topics :
1
Posts :
73
Posted : Mar 3, 2008 23:46
|
as i need to go to work soon and i have a flue as well i will not reply in depth to your last post
About the one-sample interpolation, what i ment was actually interpolation on all available sample points from the original where you replace every sample with a sufficiently low-freq sinc function.
I think this is what UnderTow was talking about before.
btw, you seem to have done all this before, anything i could have a look at?
|
|
|
Speakafreaka
IsraTrance Junior Member
Started Topics :
18
Posts :
779
Posted : Mar 3, 2008 23:51
|
|
Glitch_CapeTown
IsraTrance Junior Member
Started Topics :
36
Posts :
952
Posted : Mar 4, 2008 01:55
|
|
UnderTow
Started Topics :
9
Posts :
1448
Posted : Mar 4, 2008 04:37
|
Quote:
|
On 2008-03-03 23:46, psytendo wrote:
About the one-sample interpolation, what i ment was actually interpolation on all available sample points from the original where you replace every sample with a sufficiently low-freq sinc function.
I think this is what UnderTow was talking about before.
|
|
That's the general idea but not exactly. If you start with an array of samples representing the OSC wave at base rate, and play the synth at any other pitch, most new sample points won't coincide with old sample points and values. So you can't just drop the sinc function on the sample value. (You don't have the correct value!) You first need to take care of this... by interpolation.
If I remember correctly, I used a two step interpolation scheme. The second step is where I used the sinc function.
I only ever wrote one synth so it isn't as though this is all deeply ingrained in my memory. I need to look-up my old code (and comments). I haven't done any DSP coding in a few years so I might be remembering things incorrectly.
And I need sleep...
UnderTow |
|
|
Speakafreaka
IsraTrance Junior Member
Started Topics :
18
Posts :
779
Posted : Mar 4, 2008 14:18
|
Well, I'll tell you what, we're getting away from the relevant.
You want a synth name ultimately, not a thesis.
However, one final point, it isn't just the oscs that suffer, but the filter too - big time. That rez is a pure sine wave. A any harmonic interference shows up massively on a sine.
So the filter needs to be antialiased too.
For that reason, the synth I recommend to you is:
OhmForce Minimonsta.
  .
http://www.soundcloud.com/speakafreaka |
|
|