2

I'm trying to write my own high quality audio sample rate converter. I barely know anything about signal processing though so I need help. From what I understand I need to sum together normalized sinc functions that touch every sample to find the value at any arbitrary point. I'm guessing this is hard because that would mean more than a billion calculations for a few second long audio file. So do I only use the sinc functions for the samples that are closest to my x value? Is this what is meant by "windowed sinc"? How many samples should I go in each direction away from my x value? Additionally, my DAW has something called "32 point sinc" resampling. What is the "32 point" supposed to mean in this case?

A_A
  • 10,650
  • 3
  • 27
  • 35
sincman
  • 23
  • 3
  • 1
    Have a look at https://dsp.stackexchange.com/questions/59740/resampling-and-removing-high-frequency-noise/59741#59741 and the comments on https://dsp.stackexchange.com/questions/69033/basic-upsampling-of-a-signal/69034#69034 – Cedron Dawg Jul 13 '20 at 02:10
  • @CedronDawg I think that it is worth putting those in an answer. This question is "far enough" from those original topics to be deemed a duplicate. – A_A Jul 13 '20 at 13:48
  • @A_A I'm not understanding what you mean. The referenced questions are meant to give an understanding of how a sinc interpolation (for upsampling) works and how it relates to maybe using a FFT for efficiency. So, they don't really answer the OP directly, but give context. The analysis of error consequences vs truncation length is a different beast and I would defer to Olli as he does a spectacular job on those. – Cedron Dawg Jul 13 '20 at 15:34
  • @CedronDawg My perception was that the first link was providing enough context for an answer to the question (?) – A_A Jul 13 '20 at 15:45
  • @A_A I threw up (pun intended) a rough answer. I do believe it is important for the OP to understand context if they are "rolling their own". – Cedron Dawg Jul 13 '20 at 16:13
  • @CedronDawg Thanks for letting me know. I think it is a good response and it would give sincman the opportunity to accept it or comment further so that we can close the question gracefully. – A_A Jul 15 '20 at 08:06
  • @A_A Surely you don't mean "close the question". It would be nice for the OP to grace us with the news of their success. This stuff is kind out of my wheelhouse (practically zero real life use), yet I know it is the bread and butter of a lot of the ADC/DAC specialists around here. – Cedron Dawg Jul 15 '20 at 12:03
  • 1
    @CedronDawg No I certainly do not mean close the question just like that. If the OP accepts it, then the question is not going to remain "unanswered" and keep coming back. – A_A Jul 15 '20 at 12:05
  • 1
    @olliniemitalo The "32 point sinc" is a option in FL Studio. – sincman Jul 18 '20 at 09:04

1 Answers1

4

"So do I only use the sinc functions for the samples that are closest to my x value?"

Yes, when you are truncating.

"Is this what is meant by "windowed sinc"?"

Yes. The sinc goes to infinity, calculating that is impractical.

"How many samples should I go in each direction away from my x value?"

The sinc diminishes the further away you are. At some point additional points become insignificant (no wider than a whisker on a gnat).

"Additionally, my DAW has something called "32 point sinc" resampling. What is the "32 point" supposed to mean in this case?"

I'm pretty sure it means a 32 point window, centered on your current sample.

Sinc interpolation is one form of interpolation. It is the "Fourier compatible" one as it gives limits on a bandwidth basis.

Here is another link that may be even more useful: Multi-channel audio upsampling interpolation

On re-reading this reference, Olli has already done this analysis, spectacularly.

Cedron Dawg
  • 7,560
  • 2
  • 9
  • 24