How do you do bicubic (or other non-linear) interpolation of re-sampled audio data?

My favorite resource for audio interpolating (especially in resampling applications) is Olli Niemitalo’s “Elephant” paper. I’ve used a couple of these and they sound terrific (much better than a straight cubic solution, which is relatively noisy). There are spline forms, Hermite forms, Watte, parabolic, etc. And they are discussed from an audio point-of-view. This is … Read more

Resample a numpy array

NumPy has numpy.interp which does linear interpolation: In [1]: numpy.interp(np.arange(0, len(a), 1.5), np.arange(0, len(a)), a) Out[1]: array([ 1. , 2.5, 4. , 5.5, 7. , 8.5, 10. ]) SciPy has scipy.interpolate.interp1d which can do linear and nearest interpolation (though which point is nearest might not be obvious): In [2]: from scipy.interpolate import interp1d In [3]: … Read more

Resampling irregularly spaced data to a regular grid in Python

Comparing your code example to your question’s title, I think you’re a bit confused… In your example code, you’re creating regularly gridded random data and then resampling it onto another regular grid. You don’t have irregular data anywhere in your example… (Also, the code doesn’t run as-is, and you should look into meshgrid rather than … Read more