help-octave
[Top][All Lists]
Advanced

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

Re: Sporadically sampled data


From: Jonathan Stickel
Subject: Re: Sporadically sampled data
Date: Fri, 20 Jun 2008 07:30:07 -0600
User-agent: Thunderbird 2.0.0.14 (Macintosh/20080421)

On 6/20/08 address@hidden wrote:
Date: Thu, 19 Jun 2008 11:53:38 -0700
From: Shaun Jackman <address@hidden>
Subject: Sporadically sampled data
To: address@hidden
Message-ID: <address@hidden>
Content-Type: text/plain; charset=UTF-8; format=flowed

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.

Thanks,
Shaun

Are you calculating a moving average in order to smooth your sampled data? If so, check out the functions in the relatively new "data-smoothing" package in octave-forge. Currently there are two primary functions that implement smoothing by regularization: "tkrgdatasmooth" implements smoothing for monotonic but not necessarily equally spaced points, and "tkrgscatdatasmooth" for scattered data points. It sounds like the latter may be useful for your situation.

Regards,
Jonathan

P.S.
I will probably change the names of the functions in this package in the near future (they are too long I think).


reply via email to

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