Derivation

Jun 8, 2010 at 9:58am

Derivation

Hello,

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 ?

Thanks

Mathieu

#50792
Jun 8, 2010 at 10:45am

do u mean deviation: http://en.wikipedia.org/wiki/Absolute_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.

#182278
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])

#182279
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.

j

– Pasted Max Patch, click to expand. –
#182280
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

Mathieu

#182281
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. –
#182282
Jun 8, 2010 at 2:58pm

Thanks I was just thinking about that problem ! =)

Now my input data and differential data are sync.

#182283
Jun 8, 2010 at 3:47pm

de rien ;)

#182284

You must be logged in to reply to this topic.