to start I am a newbie in signal processing, I just started a month ago so please be as detailed as possible.

From what I understood to resample a signal by a non integer factor you can do an upsample followed by a downsample. So, imagining a sample set of size 10 and if you want to upsample it to 15, you can upsample it by 3 and downsample it by 2, correct?

If that is true, does one can create a kernel by merging the two kernels the upsampling and downsampling ones?

To upsample by 3 we can use the kernel [1/3, 2/3, 1, 2/3, 1/3] and to downsample by 2 we can use the kernel [1, 0]. Can I create just a kernel to do both operations?

If instead I use interpolation, can I do it using a kernel as the above?

  • $\begingroup$ You can by multiplying "convolving" the two sequences to create the combined one. Be aware of tail effects due to length of "filters" and possible aliasing. $\endgroup$ – Moti May 5 '18 at 1:09
  • $\begingroup$ @Moti How can I multiply the convolution then? Can you point me in the right direction please? $\endgroup$ – Pedro Pereira May 5 '18 at 13:52
  • $\begingroup$ Implement to sequential processes, starting with the upsampling. You may also "calculate" each sample to its location (given the value) but the coefficients will be different from sample to sample. $\endgroup$ – Moti May 7 '18 at 0:42

You might be describing something similar to a canonical polyphase resampling filter. If you can compute your filter+interpolation kernel on the fly (certain windowed Sinc’s and others) you can even do this for irrational sample rate ratios or factors.

  • $\begingroup$ how would you increment the sample pointer, which has an integer and fractional portion (the former points to the samples to be combined to be the interpolated output sample and the latter points to the set of coefficients that define how those samples will be combined) and a step size or increment to that continuous-valued sample pointer, how is that step size to be represented as an irrational number? even if the step size is successfully represented as an irrational number, how does it effectively increment that sample pointer by a increment (or step size) that is an rational value? $\endgroup$ – robert bristow-johnson May 5 '18 at 6:41
  • $\begingroup$ On computers, one normally just quantizes (the step or fraction) to something that fits in memory, same as one does when computing using Pi or e or sin(x) during DSP math. $\endgroup$ – hotpaw2 May 5 '18 at 15:42
  • $\begingroup$ so then, hot, i don't think that it's accurate to say, "... you can even do this for irrational sample rate ratios or factors." at least i cannot see how one can do that. $\endgroup$ – robert bristow-johnson May 5 '18 at 23:03
  • $\begingroup$ The idea is that you create two "filters" - one for up sampling and than apply the down sampling filter. I am not sure if you can implement accurately irrational but you could come as close as desired. $\endgroup$ – Moti May 6 '18 at 16:49
  • $\begingroup$ No need for upsampling plus downsampljng. Instead you can interpolated each output sample directly, and create each phase as needed instead of caching/precomputing. $\endgroup$ – hotpaw2 May 6 '18 at 19:15

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.