Assuming you're interested in a mass flow rate computed as the time derivative of the signal you're getting from the scale, might I recommend fitting a line to the last points, and reading the slope off of that line? Fitting a line to data is robust with respect to noise, unlike taking a derivative (which is highly susceptible to noise). In fact, you wouldn't even need to compute the of the . You could just go with the computation of the as follows. Given the latest time series data the slope of the line fitted through the last data points is given by

where

and

are the averages.

Since everything in sight is a sum, you have a procedure that's robust with respect to noise. In addition, you can re-compute the slope each time you get a new data point in, so you'll have up-to-the-second information.

A word of caution, however: the more data points you include in these computations, the less susceptible to noise your numbers will be. However, it is also true that the more data points you include in these computations, the slower your computed slope will respond to real changes in the slope. So you'll need to play around with to see what works the best in your case. I would recommend that you sample at 10 times the frequency of any expected frequencies showing up in your data, otherwise you won't be able to tell noise from real signal so well. One sample per second might be perfectly adequate if you don't expect things to change except on a scale of every ten seconds, for example.

Hope this helps.

[EDIT] There are even some fancy ways of reducing the computations required by keeping running buffers of data, and doing the sums by only adding one point and subtracting the last point, that sort of thing. But that may be much fancier than you need.