I have written a program that uses sinc interpolation to resample some data. The general algorithm is a that I compute the previous N values and the next N values to get a new sample at a non-integer value.

For example if I have samples:

(0, 8), (1, 5), (2, 3), (3,8), (4,-2), (5, 11)

And I want a sample value at 2.3, I offset the 2.3 incrementally by 1 and take the sinc coefficients and weight them by the sinc function value e.g.:

sinc(-0.7) * 8, sinc(0.3) * 5 + sinc(1.3) * 3 + sinc(2.3) * 8 + sinc(3.3) * -2 + sinc(4.3) * 11

This algorithm fits my understanding of the sinc interpolation concept, and I'm pretty sure there are no bugs.

Unfortunately I'm hear some tin-y artifacts in the sound.

Given the above algorithm is working properly and is a valid way to resample data (a big premise), is there any reason sinc interpolation would create these artifacts? When I use the same method to down sample by a large enough factor the artifacts to go away.


The width of the Sinc (both the main lobe and the window) needs to correspond to a low pass filter with a cutoff frequency suitable for the bandlimit of the data and the target sample rate. Depending on the number of coefficients, a non-rectangular window may be needed.

  • $\begingroup$ I have pseudo code for a windowed Sinc interpolator with a low pass cutoff setting here: nicholson.com/rhn/dsp.html#3 $\endgroup$ – hotpaw2 May 22 '20 at 21:20
  • $\begingroup$ Thanks for the response! My code looks fairly similar to yours! The final line here: r_y + r_g * r_w * r_snc * indat(j) is 0 + r_g * hann_window * sinc_value * original_data I think the only thing I'm doing differently is that my code is using a blackman window (which shouldn't matter much), and I have no r_g value. What is the role of the r_g value do you have any links to maybe help me understand that step? Is that so you don't lose any gain? $\endgroup$ – Matt Eddy May 23 '20 at 17:50
  • $\begingroup$ Here is my code in case you were curious. It is doing a lot of extra stuff because it caches the sinc and window values $\endgroup$ – Matt Eddy May 23 '20 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.