DSP.jl Resampled signal length doesn't match upsampling factor

Hey guys,

I ran into a problem, while trying out the resampling algorithm from the DSP package (v0.6.3).
First I just create a test array with random numbers between 1 and 2. My plan is then to resample up by factor of 10. Apart from being very happy with the speed of that especially with the @threads macro, my output vectors have the length of 99.999.995 instead of 100.000.000. Anybody have an idea why that is?

x=rand(10000000,4).+1;

function Resample(sig)
    res=DSP.resample(sig,10);
    return res
end 

@time Threads.@threads for i in (1:size(x)[2])
    x_resampled=Resample(x[:,i])
end

Thanks and best regards,
Merit

First, try with a shorter vector and smaller degree of upsamplimg. These huge numbers just make things more confusing.

I would also guess (not knowing anything about this function) that it doesn’t necessarily extrapolate. So upsampling a length 10 vector by 2 should give a length 19 vector.

Try different lengths and factors and see what makes sense. Plot and inspect visually, etc. Pay particular attention to what happens near the beginning and end.

This is a known issue and I agree it’s not ideal.

https://github.com/JuliaDSP/DSP.jl/issues/186

-s

1 Like

Thanks for the answers, the output of the resampling seems good though except that its missing a couple values. Maybe it will get fixed sometimes…

@DNF:
I tried it before with much smaller Vectors, but same problem there.

Best, Merit