It seems to me intuitively if I have a signal $y$ with sampling frequency $f_0$, then if I resample that signal with $f_{new}$ the correct number of samples will be $\frac{f_{new}}{f_0} \cdot len(y)$.

But I'm using a library which includes an example (line 26) where the length of the new signal is calculated as $\frac{f_{new}}{f_0 +f_{new}} \cdot len(y)$. It seems to me this is a mistake? If I have a signal with 48000 samples at the same $f_s$ and resample it with $f=16000Hz$ then the new signal should have length 16000 right?

  • 1
    $\begingroup$ seems to me that your intuition is the correct intuition. $\endgroup$ – robert bristow-johnson Mar 7 '18 at 19:46
  • 1
    $\begingroup$ No, you're misreading the code. At line 26#, the size for the input/output buffers is being calculated and that's all. $\endgroup$ – dsp_user Mar 7 '18 at 21:03

Your Answer

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

Browse other questions tagged or ask your own question.