|5-point spline interpollation|
Type : interpollation
References : Joshua Scholar, posted by David Waugh
//nMask = sizeofwavetable-1 where sizeofwavetable is a power of two.
double interpolate(double* wavetable, int nMask, double location)
/* 5-point spline*/
int nearest_sample = (int) location;
double x = location - (double) nearest_sample;
return p2 + 0.04166666666*x*((p3-p1)*16.0+(p0-p4)*2.0
+ x *((p3+p1)*16.0-p0-p2*30.0- p4
+ x *(p3*66.0-p2*70.0-p4*33.0+p1*39.0+ p5*7.0- p0*9.0
+ x *( p2*126.0-p3*124.0+p4*61.0-p1*64.0- p5*12.0+p0*13.0
+ x *((p3-p2)*50.0+(p1-p4)*25.0+(p5-p0)*5.0)))));
Added on : 27/05/03 by joshscholarREMOVETHIS[ AT ]yahoo[ DOT ]com
The code works much better if you oversample before interpolating. If you oversample enough (maybe 4 to 6 times oversampling) then the results are audiophile quality.
Added on : 26/08/10 by transmogrifox at yahoo dot com
This looks old...but if anybody reads this:
What do you mean by oversample first? That is practically what you are doing with interpolation. For example, if you want to oversample 6x, you would interpolate 5 evenly spaced points in between p2 and p3 using 5 points at base frequency centered around p2. The 5-point spline interpolation seems like a lower CPU algorithm than a good sinc interpolation, and as a bonus it does not have much of a transient response (only 5 samples worth).
My main target application for something like this is delay line interpolation where there is a concern regarding high frequency notch depth...5th order interpolation is certainly an improvement over linear interpolation :)
Added on : 04/10/12 by Josh Scholar
By oversample I meant do a windowed sinc doubling oversample a couple times.
The point is that a 4 times oversample can be based on table values and only gives you points exactly 1/4, 1/2 and 3/4 between the samples.
Then the spline can be used to interpolate totally arbitrary points between those, say speeding up and slowing down as needed, at very high quality.
If you don't oversample first, you'll get an audible amount of aliasing, though not as much as a linear interpolation. Unless the source has a lot of roll off (which is equivalent to it being oversampled anyway).
Added on : 16/08/14 by chris[ DOT ]dannemiller[ AT ]gmail[ DOT ]com
Can any explain the derivation of this?
Added on : 24/04/17 by theilre[ AT ]bighost[ DOT ]download
wh0cd3690187 [url=http://sildenafilcitrate2017.com/]sildenafil india[/url]
Added on : 09/05/17 by coxfamilywestafrica[ AT ]web2web[ DOT ]stream
wh0cd3690187 [url=http://viagraonline2017.com/]buy viagra[/url]
|Add your own comment|
Comments are displayed in fixed width, no HTML code allowed!