12-14-2007 01:05 PM
12-15-2007 11:43 AM
12-15-2007 01:34 PM - edited 12-15-2007 01:35 PM
You don't give enough information, for example you don't say at what rate the data arrives. For example if new data arrives every 1000ms, then you would need to just keep one set in memory and subtract current-previous. Peanuts! Since you are talking about keeping a history size of 1000, it seems you maybe want to subtract the data from 1000 histories back. Please clarify!
vonsin wrote:
I have an xy plot (2D) at occurs at time t. I need to plot this x,y at time t against a previous set time, say (t-1000ms) .The amount of sequences (3rd dimension) would have to be limited to about 1000 to not bog down memory.
Let's not forget that xy graphs can take an 1D array of complex data. (It will plot IM vs. RE), so all you need is a fixed size 2D array of complex datatype to keep your history.
Keep the history in a shift register and for each iteration:
Here is an image of a quick draft that would do that. Let me know if anything is not clear. (the two array operations in the loop are "index array" and "replace array subset"). Most likely you need to adjust a few things for your exact requirements.
You should also decide what should get plotted during the iterations where there is no history data yet. If you initialize the array with 0+0i, it would just plot the raw data. If you would initialize with NaN+NaNi, it would not plot anything until there is valid history data to be subtracted.