Sinc Interpolation Artifacts

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.

• 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? May 23 '20 at 17:50