Author Topic: sinc interpolation...  (Read 16437 times)

HyperDrive

  • Posts: 20
sinc interpolation...
« on: 30 Apr '03 - 13:53 »
I didn't know about this method, so i googled around a bit and found a very nice site explaining the concept of bandlimited interpolation. Unfortunately(?) I also found this page revealing some problems with the same algorithm (mainly related to the Fourier transform). I don't know how those ringing artifacts translate to digital audio processing, but (at least graphically) they're quite ugly! But I assume your sinc interpolator is nicely band-limited... Cheers! ;)

Ian @ un4seen

  • Administrator
  • Posts: 20437
Re: sinc interpolation...
« Reply #1 on: 30 Apr '03 - 22:39 »
Windowing the sinc function removes the ringing. Here's an example :)

Plain sinc interpolation...
  http://un4seen.com/stuff/sinc.ogg

Windowed sinc interpolation...
  http://un4seen.com/stuff/windowed-sinc.ogg

HyperDrive

  • Posts: 20
Re: sinc interpolation...
« Reply #2 on: 30 Apr '03 - 23:23 »
I heard the samples, and all I can say is WOW! :o Impressive results indeed! I never thought it could sound this good, especially with almost pure waveforms (that XM from WAVE is a very nice example ;)). The snare also seemed extremely clean with most (all?) of it's high frequencies, and absolutely no audible interpolation artifacts. The low-pass filter from the Vorbis encoder could have something to do with this, but I pretty much doubt it (and I do spot compression artifacts miles away, believe me ;)). Can't wait to give it a run on some really nasty modules (Daisy-Chain, by Rhesus Minus, comes to my mind... :D).

PS: What windowing function are you using? :)

Cheers!
« Last Edit: 30 Apr '03 - 23:26 by HyperDrive »

Sub-Zero

  • Posts: 49
Re: sinc interpolation...
« Reply #3 on: 1 May '03 - 08:07 »
Btw, check out Jizz -Smokeout.xm by TBL (on the ftp)...Listen to the beginning part with the sinc interpolation and then listen with the old cubic spline interpolator from 2.6.  That whistling/squealing noise is what I was talking about in my other post.  Other modules are affected too.  I listened to those two ogg samples and it 'sounds' like we're talking about the same thing, but I'm not sure.

Sorry I just don't have the technical knowledge to be able to use the right terms to describe what I'm hearing. I end up sounding like an idiot.  You two are way beyond me on this stuff.  I understand linear and cubic a little, but thats as far as I go.  I only made sense of about 10% of those links :\.

« Last Edit: 1 May '03 - 08:18 by Sub-Zero »

Ian @ un4seen

  • Administrator
  • Posts: 20437
Re: sinc interpolation...
« Reply #4 on: 1 May '03 - 17:20 »
Quote
The snare also seemed extremely clean with most (all?) of it's high frequencies

Yep, the most noticeable difference over linear interpolation is that snares and hi-hats are generally sharper.

Quote
Can't wait to give it a run on some really nasty modules (Daisy-Chain, by Rhesus Minus, comes to my mind... :D).

Not sure old MODs (with poxy sample quality) are going to sound "better". Better resampling means less artifacts, which, in the case of low quality samples, is not necessarily how they were meant to be heard :)

Quote
PS: What windowing function are you using? :)

I tried a bunch, and Lanczos looked/sounded good to me, but... :D

Quote
Btw, check out Jizz -Smokeout.xm by TBL (on the ftp)...Listen to the beginning part with the sinc interpolation and then listen with the old cubic spline interpolator from 2.6.  That whistling/squealing noise is what I was talking about in my other post.

A Blackman-Harris window does a better job of removing the ringing in this file's case... so I've changed it to that now :)

podobo

  • Posts: 59
Re: sinc interpolation...
« Reply #5 on: 2 May '03 - 20:45 »
Is this interpolation going to be in the next BASS too?

Ian @ un4seen

  • Administrator
  • Posts: 20437
Re: sinc interpolation...
« Reply #6 on: 3 May '03 - 17:38 »
I'm not sure yet, but it's a possibility.

HyperDrive

  • Posts: 20
Re: sinc interpolation...
« Reply #7 on: 4 May '03 - 17:23 »
Quote

Yep, the most noticeable difference over linear interpolation is that snares and hi-hats are generally sharper.


Well, my reference is ModPlug's 8-point interpolation (cubic polynomial? I'm not sure about the algorithm...) Linear interpolation was never an option, for obvious reasons... ;)

Quote

Not sure old MODs (with poxy sample quality) are going to sound "better". Better resampling means less artifacts, which, in the case of low quality samples, is not necessarily how they were meant to be heard :)


They'll always sound better... Mathematically better, that is! ;)

Quote

A Blackman-Harris window does a better job of removing the ringing in this file's case... so I've changed it to that now :)


Hehehe! I was going to suggest that windowing function, since I believe it's the one that yields the best tradeoff between time/frequency resolution! :D

Oops! I've been itching to ask you these, and almost forgot! ;) What's the accuracy of your calculations? Since you said you optimized the interpolation routines for 3DNow!, I presume you're using 32-bit floats. Two questions: first, is the mixing routine dithered? (Spreading the quantization errors should increase the dynamic range a bit...) Second: I'm currently using a P4-based machine (OMG... Did you know they botched down the standard non-SIMD FPU of this beast ON PURPOSE?! >:(), so that means "No low CPU usage for you!", at least for a while, right?
« Last Edit: 4 May '03 - 18:13 by HyperDrive »

Ian @ un4seen

  • Administrator
  • Posts: 20437
Re: sinc interpolation...
« Reply #8 on: 6 May '03 - 14:35 »
Quote
is the mixing routine dithered? (Spreading the quantization errors should increase the dynamic range a bit...)

I guess you mean the final output? (no real point dithering the sample mixing, as the resolution is being increased :)) ... Anyway, XMPlay does no dithering at the moment, though I am thinking of adding a dither option for those who like a hint of white noise with their music ;D

HyperDrive

  • Posts: 20
Re: sinc interpolation...
« Reply #9 on: 7 May '03 - 09:02 »
Yes, I meant the final output :), but after giving it some thought, I believe you should implement something more useful than dithering... People interested in mastering some MOD compilations on CD would just render at the highest possible quality (interpolated, 32-bit at 96KHz) and use some good post-processing software (Cool Edit Pro, anyone? ;)) for the final conversion stage.

Now for the suggestion: how about supporting 88.2, 176.4 and 192KHz sampling rates? As you most certainly are aware, multiples of the base frequency produce no aliasing on downsampling, which should be simplified to a trivial "discard every other sample" (excluding filtering).

OTOH, maybe I'm just paranoid... :laugh: