The y[-1], y[0], etc correspond to the samples values around the value you wish to sample eg if sampling at 34.2
y[-1] = 33, y[0] = 34, y[1] = 35, y[2] = 36..
and x corresponds to the fractional value 0.2..
Shouldn't be too difficult convering these into schematics..
I look forward to any results you get, this is something thats been at the back of my mind for a while.. It would be nice to have a wave read module with one input and a whole selection of interpolation methods as properties..
Cheers
Sam
lalo ·
sambean wrote: t would be nice to have a wave read module with one input and a whole selection of interpolation methods as properties..
a beginning of it 🙂
..my .osm at rapidshare has no interpolation , linear and cubic 😉
lalo ·
arghh... i made i mistake in cubic interpolation....
correct pos1 and pos2
they should be
pos1=int-1; and not int-2
pos2=int; and not int-1
in the cubic interpolation code block
lalo
p.s now it sound peeerfectly..far better 🙂
chek it out by yourself...
chose a super fractional pitch value and change the interpolators in realtime 😉 ...with a sine sample to check quality
One way I suggest testing it is by subtracting the exact calculated sine value from a code module from you're sampled/interpolated value, the remainder that is left will be the error.. Should be visible using an analyser..
Sam
lalo ·
sambean wrote: Can't download it yet.... 😠
One way I suggest testing it is by subtracting the exact calculated sine value from a code module from you're sampled/interpolated value, the remainder that is left will be the error.. Should be visible using an analyser..
Sam
why you can't download?
good idea about the subtraction 😉
lalo ·
uploaded with spline algorythm found by sambean (thanx m8 😇 )
cubic seems better 'cause spline is heavy low-pass filtering....but it depends on the material you are playing with the buffer...
i've upladed the .osm as a .txt cuase my server doesn't like .osm....
just change the extension to .osm and open with SM 🙂
lemme know what you think....
http://www.nusic.org/temps/interpolations.txt
lowe
lalo
sambean ·
Hey Lalo, finally got it!
Have had a wee look round.. Some of it's working some not..
The spline and the cubic seem fine, a quick suggestion though: if you're going to divide by numbers, it's probably better to multiply by 1OverNumber ie instead of having x = y/3, use x = y*0.333333... It's harder to read at this stage, but it's better doing this now rather than having to come back later on.. Divide takes about 20x the cpu than a multiply..
In the linear section You have the fraction and 1-fraction going to the wrong sections, this is why the linear is sounding brighter.. rndint rounds to nearest so to round down I've changed this to int = rndint(index-0.5).. This isn't necessary with the others, I'm not sure why..
I've updated with these changes and also added mono support for the spline section, should be easy to add to the others.. I've switched to a selector instead of a multiplexer too, with multiplexers and poly sections the cpu from the other sections is not stopped.. I've also neatened it up a little..
Interesting stuff guys, so far I've not really looked much at this sort of interpolation - too busy with other things - but there's some useful information here 🙂
That interpolation scheme pdf is very useful - I think I already had it sitting somewhere on my machine - but I'm glad to see it posted!
Cheers guys,
Shif.
lalo ·
well done sam...
yes i konw about division cpu cost...at this stage i was trying to keep readabilty for me to understand better 🙂
i thought rndint round to the lower integer...
i have to understand why cubic and spline works anyway 🙂
lalo ·
another version...
corrected some bug introduced by sam's bug fixing 🙂
and some bug introduced by stupeed me...
now all shoukd be good 🙂
i'll do some mid-level buffer things (mono and stereo) where you can chose interpolation algorythm in the properties menu 😉
http://www.nusic.org/temps/interp_sam_lalo.txt
...change .txt in .osm 😉
dasdeck ·
hey, thans, but doesn't serious inperpolation use oversampling? i don't grasp this stuff too good, as my math is not good enough yet, 'im a new student and have some audiofreak profs., so i think i'll grasp it during my studiing
greetz
D3CK 🙂
Shifrin ·
dasdeck wrote: but doesn't serious inperpolation use oversampling
Not to my knowledge! Of course I am open to being corrected 😉
Shif.
stefan ·
dasdeck wrote: hey, thans, but doesn't serious inperpolation use oversampling? i don't grasp this stuff too good, as my math is not good enough yet, 'im a new student and have some audiofreak profs., so i think i'll grasp it during my studiing
greetz
D3CK 🙂
You don't need any oversampling to do "perfect" interpolation. To do low alias up-pitching you probably want to do oversampling though, but that's another issue.
lalo ·
stefan wrote: You don't need any oversampling to do "perfect" interpolation. To do low alias up-pitching you probably want to do oversampling though, but that's another issue.
yes...avoiding aliasing is another issue....too complex for me now....
but maybe in some months... 😉
dasdeck ·
good to hear, i mostly use samples for drums and other rythmic sounds. not too much up-pitching involved here, but i need downpitching a lot!
thanks for the sinc interpol, it sounds better on bass drums then the others, wich i had berfore, but found to be unusable.#
may it be that you can raise the order of the spline interpolation? i mean can it be that you can use more points than four to interpolate?
and for downpitching, wouldn't some kind of dither be kool to avoid the "pixeling" ?
anyway, i don't have too much knowledge about all this stuff, but i have the experience that samplers sound different when samples are pitched (and soemtimes even unpitched", and i do have favourites.
D3CK
sambean ·
For some reason the blue connectors seem to be taking over the schematic.. Could be a bug..
Some cpu stat estimates:
no interp- 90 cycles/sample
linear- 260
spline- 430
cubic - 450..
infuzion ·
stefan wrote: You don't need any oversampling to do "perfect" interpolation. To do low alias up-pitching you probably want to do oversampling though, but that's another issue.
I could use up-sampling, but I use Live for it now.
stefan ·
infuzion wrote:
stefan wrote: You don't need any oversampling to do "perfect" interpolation. To do low alias up-pitching you probably want to do oversampling though, but that's another issue.
I could use up-sampling, but I use Live for it now.
Just for the clarity of things:
Up-pitching = down-sampling
Down-pitching = up-sampling
🙂
infuzion ·
ah, I wanna go faster for now, slower later...
dasdeck ·
hey bros, in the last example you add -0.5 to the fractional value before you round to int, are you shure about that?, i mean, it always rounds down, so form case to case it would go down one or to steps:
1,2-> -0,5 -> round = 0
1,7-> -0,5 -> round = 1
schould not both be 1?
or the second one 2?
anyway, i think i gave the answer ma self, as a addition of 0,5 or -0,5 seems nessesarry tom me now.
thanks 🙂
please comment if i'm wrong
D3CK
p.s.: is mathematical rounding nesesary here or just cosmetic?
sambean ·
The method SM uses for rounding always rounds to nearest, so to round down you need to subtract the 0.5..
Try putting the following code into an analyser
streamin in;
streamout out;
out = rndint(in);
You'll find the output always round to nearest..
And rounding is necessary to get the fractional amount:
fract = value - floor(value);
Cheers
Sam
lalo ·
waht sam said 🙂
dasdeck ·
thanks 🙂
i have added hermite, lagrange and osculating4 point versions, herimite seems best to me so far.
I' ll up them if i got some more 🙂
its acool pdf, its copy and paste, cool.
D3CK
dasdeck ·
sambean wrote: Can't download from rabidshare at the mo.. But here's a rather extesive list of interpolation methods..
The y[-1], y[0], etc correspond to the samples values around the value you wish to sample eg if sampling at 34.2
y[-1] = 33, y[0] = 34, y[1] = 35, y[2] = 36..
and x corresponds to the fractional value 0.2..
Shouldn't be too difficult convering these into schematics..
I look forward to any results you get, this is something thats been at the back of my mind for a while.. It would be nice to have a wave read module with one input and a whole selection of interpolation methods as properties..
Cheers
Sam
do you have a copy of that paper you linked to? its away and i've lost my copy.
thanks
D3CK
Shifrin ·
You should be able to find the paper here :-
http://yehar.com/dsp/deip.pdf
Shif.
dasdeck ·
Shifrin wrote: You should be able to find the paper here :-
http://yehar.com/dsp/deip.pdf
Shif.
thanks! 😀
i googled it but seems there are other deip.pdfs out there.
D3CK
Wrote something here? To have a post removed or your name hidden, write to [email protected].