From the original SynthMaker forum (2004–2014), with its members’ names and dates.
mwvdlee ·
The standard wave player uses interpolation to handle differences between the sample rate of the host and the sample rate of the wave. It uses a linear interpolation.
Now my background is in graphics rather than sound, but in graphics linear interpolation isn't considered very good. It's better than none, but far worse than other common methods. Most notable of those other methods are the polynominal methods (cubic interpolation is polynominal) of which there are about two dozen standard ones, all with different purpose, quality and performance. Most should all be easy enough to implement in S|M with reasonable performance. However, since sound and graphics are obviously two entirely different fields, it's unlikely the "best" graphics interpolations are the best for sound.
Are there any (de facto) standard methods for interpolation of sound, superior to linear?
Is there any research on use of polynominal (or other) interpolation of sound?
infuzion ·
mwvdlee wrote: Are there any (de facto) standard methods for interpolation of sound, superior to linear?
Is there any research on use of polynominal (or other) interpolation of sound?
You're on the right track... tried searching this forum & KVR's? There are actually good discussions on both.
Or just test yourself:
[old link]
Might be nice if you'd post some tests. 😉
trogluddite ·
The 'Developer's Toolkit' has half a dozen alternative interpolation modules from Exo, including some polynomial stuff.
They certainly sound smoother to my ears than linear - but I'm not mathsy enough to have a clue how all the co-efficients etc. are derived.
My guess is that, like pitch-shift algorithms, the optimal interpolation is dependent on the content of the audio to some degree - and that the most 'mathematically' accurate method is not necessarily the best sounding subjectively.
Andrew J ·
mwvdlee wrote: Are there any (de facto) standard methods for interpolation of sound, superior to linear?
Is there any research on use of polynominal (or other) interpolation of sound?
Resampling filters, have a read here: http://www.mp3-tech.org/programmer/docs/resampler.pdf
mwvdlee ·
infuzion wrote: Might be nice if you'd post some tests. 😉
Well, atleast here's a visual analyzer.
It's a 440Hz sine wave at a 6000Hz sample rate played back really slowly with all the different interpolation methods from the devkit and the nearest neighbor method. Remember that the low sample rate of the sample is only used to enlarge the artifacts.
Atleast visually there are some obvious losers. Choosing the winner is a bit harder. Perhaps other wave types would provide some insight. After all, the best method is the one that reconstructs sharp edges and straight lines as well as curves 🙂
I don't know if the B-spline one is Catmull-Rom. If it is, I'd like to tweak it into the lesser-known Mitchell-Netravali, which is the one I use for my graphics programming.
MegaHurtz ·
mwvdlee wrote: Atleast visually there are some obvious losers. Choosing the winner is a bit harder. Perhaps other wave types would provide some insight. After all, the best method is the one that reconstructs sharp edges and straight lines as well as curves.
That`s the million dollar question right there, Ive been looking at this stuff for a couple of years now.
And to me the sounds are`nt that different. it seems a bit like a physical impossibility to do better
than liniar. simply becouse the future is an unknown factor.
(noted that any sines amplitude is an unknown factor aswell, so tweaking it would require spectral manipulation).
And the shape that went in there has very little resemblance to a sine.
Also the motion through the array is liniar, possibly not the sound that you uncover.
You`d hear the difference when the sound gets so low there`s nothing but a sine to come out.
But there you instantly get the hang for a bit of distortion becouse the shape of the sound get`s more
prenounced. But the hermite and optimal models are looking quite good indeed.
Before yappin too much ill think ill get to giving them some field testing.
Ill be back 🙂
aliasant ·
I did compare them using my drum machine build.
It is probably impossible to hear the difference for a normal person using the default pitch of the recorded sound but I often pitch down quite a lot to use maybe a Clave as a 808ish bassdrum or similar and when you do that the differences are quite clear.
My personal favourites was 4th Order and B-Spline.
4th order seems to have a steeper filter so it sounds slightly "better" but it also uses a few cycles extra.
I did a quick asm optimizaion of the code part in the B-Spline and got it down from 28.5 cycles to 9.5 and since theres 2 of them codes in there it makes a small difference/voice This can probably be optimized further so if anyone feels like it.. 🙂
aliasant wrote: I did a quick asm optimizaion of the code part in the B-Spline and got it down from 28.5 cycles to 9.5
9.5 cycles? That would be impossible, since you have a string of math that is longer than 9 in a row, plus all the other movaps & maths before that. Though you did do a good job on optimization! 😇
aliasant ·
infuzion wrote:
aliasant wrote: I did a quick asm optimizaion of the code part in the B-Spline and got it down from 28.5 cycles to 9.5
9.5 cycles? That would be impossible, since you have a string of math that is longer than 9 in a row, plus all the other movaps & maths before that. Though you did do a good job on optimization! 😇
Well. .lol
Thats the resulh I get on my PC.
I checked several times. What results do you get?
mwvdlee ·
infuzion wrote:
aliasant wrote: I did a quick asm optimizaion of the code part in the B-Spline and got it down from 28.5 cycles to 9.5
9.5 cycles? That would be impossible, since you have a string of math that is longer than 9 in a row, plus all the other movaps & maths before that. Though you did do a good job on optimization! 😇
AFAIK, cycles as used in the old days no longer apply and modern CPU's can do multiple simultaneous instructions in one cycle as long as they're not dependant upon eachother's results (and even them some CPU's can use predictive models).
What I'm wondering more is how he actually measured the number of cycles. Is that built into S|M and did I miss it?
trogluddite ·
CPU Analyser
aliasant ·
trogluddite wrote: CPU Analyser
That one doesnt really work on my machine. Resuls are quite weird but they are quite weird with my own too but more consistent. 😕
My cycles dont really mean anyting for anyone else but I think the differences between my results can give others at least a hint.
flamingRedDingo ·
9.5 cycles *is* in fact, possible for a series of 9 operations...
Modern cpu technology is superscalar. More than one operation is often performed per "cycle" - so even WRT a single core, you can't count cycles to determine the # of operations...
CPU cycle counting is useless w/ modern CPU technology. It's an abstract indicator at best, and most of the time, the results are so incredibly misleading in the general case as to be worse than useless.
Wrote something here? To have a post removed or your name hidden, write to [email protected].