help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sporadically sampled data


From: Jaroslav Hajek
Subject: Re: Sporadically sampled data
Date: Fri, 20 Jun 2008 16:08:36 +0200

On Thu, Jun 19, 2008 at 8:53 PM, Shaun Jackman <address@hidden> wrote:
> I have data sampled sporadically from a function x = f(t); I have vectors t 
> and
> x. Does Matlab have any functions to deal with sporadically sampled data?
>
> I want to calculate a moving average (a sliding window) of my data. If I had
> periodically sampled data, I would use hanning and conv. Right now I'm
> converting my sporadically sampled data to periodically sampled data by...
>
> p(t) = x;
> y = conv(p, hanning(n));
>
> This is not ideal though, because there are gaps in the sampling data, and
> assuming those gaps are 0 (or the mean) is not ideal.
>
> My current thought to improve on this is select all the data points that fall
> within a sliding window using `find`, calculate the mean (or some weighted 
> mean
> based on position in the window) of the data points in that window, and repeat
> in a loop. Before I proceed down this path, I wanted to know if Octave has any
> functions to deal with this sort of data.
>

If you don't need to smooth the data, then you can simply use the
interpolating functions (interp1, spline, pchip), assuming your data
is 1-dimensional.
For smoothing data, you can use OctaveForge packages - data-smoothing, octgpr.

--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]