Jun 8, 2010 at 9:58am



I would like to know what is the more efficient way to get the derivation of a continuous stream of data (real time) :

I am using (f(X+h)-f(x))/h as it can be seen here :

– Pasted Max Patch, click to expand. –

Another idea ?



Jun 8, 2010 at 10:45am

do u mean deviation:
i get the feeling “derivation” is faux-amis?

also AFAIK u cant put formulas as arguments for maths objets (as is the case with the divide), u need to use expr for that.

Jun 8, 2010 at 11:30am

Oops sorry I mean “to differentiate” :

f’(x)= (f(x+h)-f(x))/h or (f(x[i+1])-f(x[i-1)])/(x[i+1]-x[i-1])

Jun 8, 2010 at 12:31pm

well here is an attempt at translating the equation to expr, but it’s broken…
i suspect my algebra is not up to scratch or the equation isnt right. either way the process should at least demonstrate how to translate equations into expr.

i didnt try the second equation… also it may be useful to explain the context of the equations, as this might make it easier for others to help.

hope that’s vaguely useful, sorry dont have much time to look into this.


– Pasted Max Patch, click to expand. –
Jun 8, 2010 at 2:14pm

Thanks justin,

I finally found a way to solve the problem :

Here is my solution :

– Pasted Max Patch, click to expand. –

(With a low pass filter at the end to smooth the values)

Maybe there is a better way


Jun 8, 2010 at 2:53pm

think [bucket 2 1] might be better, cos it outputs current value and previous value. otherwise it outputs previous and one before previous (ignores current value)… look at float number boxes and it should explain better!

– Pasted Max Patch, click to expand. –
Jun 8, 2010 at 2:58pm

Thanks I was just thinking about that problem ! =)

Now my input data and differential data are sync.

Jun 8, 2010 at 3:47pm

de rien ;)


You must be logged in to reply to this topic.