
Hugo Duncan wrote:
Eric,
OK, the time period isn't a constant, but what is it measured in? Milliseconds? Then you can make milliseconds your discretization, and then resample the data at a coarser discretization with the coarse_grain() algorithm. Am I still not understanding your problem? Perhaps it would help if you were more explicit about what data is being pulled from the bus, exactly. Values and time? Time measured how?
Light finally goes on! I agree that this is a solution. To do this I use a sparse_series, and each point becomes a run, I believe. (Just for the record, pulling time and values.) Thanks for your patient explanation - I think it was the name "sparse" that was giving me problems, as I was thinking of it as dense with variable discretisation (40-60ms) rather than sparse at constant millisecond discretisation.
I don't think sparse series is the right one for you. A sparse series of value, offset pairs such as the following: (42, 0) (43, 9) (44, 21) ... would have the value 42 at offset 0, 43 at offset 9, 44 at offset 21, *and zero everywhere else*. So at offset 1, the value would be zero. You probably want it to be 42 there also, right? I think what you want is a piecewise constant series of (value, offset, end offset) tuples like this: (42, 0, 9) (43, 9, 21) (44, 21, 30) ... The offsets are the (irregularly spaced) intervals at which you are sampling your bus. Then you can regularize the series by resampling to a coarser discretization; e.g., by taking the value at every 10th offset.
I'll have to get back to you about the rest. I'm leaving tomorrow for a long weekend.
Have a good weekend.
Thanks! I'm off. -- Eric Niebler Boost Consulting www.boost-consulting.com The Astoria Seminar ==> http://www.astoriaseminar.com