# Length of a resampled audio signal

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?

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