On Fri, Jun 23, 2017 at 10:14 AM, Przemek Klosowski <

[hidden email]> wrote:

>

> In Matlab the recommended method to resample irregularly sampled input data is:

>

> [y, Ty] = resample(x,irregTx,desiredFs);

Yet another case of something I do regularly (with interp1) having a built in solution for years and I never new it.

>

> I don't think interp1 is the right approach because it just interpolates between nearest points instead of taking into account all points in the 'regularized' interval.

>

From the Matlab resample documentation [1], it appears using interp1 would emulate one of the resample forms:

"y = resample(x,tx) resamples the values, x, of a signal sampled at the instants specified in vector tx. The function interpolates x linearly onto a vector of uniformly spaced instants with the same endpoints and number of samples as tx. NaNs are treated as missing data and are ignored."

from the octave help for resample, it looks like it only implements the first two ( resample(x,p,q) and resample(x,p,q,h) ) or maybe 3 of the 10 or so different forms handled by the Matlab function.

It appears that the Matlab documentation does describe the type of filters that would be used by the other options. At the bottom under Algorithm it states:

"resample performs an FIR design using firls, normalizes the result to account for the processing gain of the window, and then implements a rate change using upfirdn."

An improved firls is currently under development [2]. It may be that resample could be implemented that makes use of it.