|
From: | Przemek Klosowski |
Subject: | resampling irregularly sampled data |
Date: | Fri, 23 Jun 2017 10:14:14 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 |
In Matlab the recommended method to resample irregularly sampled
input data is:
but Octave signal package's resample() function only
handles already regularly sampled data:
error: resample.m: p and q must be positive integersIs resample() function worthy to be made Matlab-compatible here? 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.
I got a working result by integrating within regular
intervals:
dateEven=0:.1:25;
j=1; for i=dateEven;
dataEven(j++)=sum(data(find((date>=i) &
(date<i+.1)))); end
but is there a simpler and/or vectorized approach?
|
[Prev in Thread] | Current Thread | [Next in Thread] |