[PD] derivative function

Chuckk Hubbard badmuthahubbard at gmail.com
Tue Jun 27 20:19:55 CEST 2006


I believe h should be in units of radians, which depends on frequency.
 As you change frequency, instead of computing the derivative of sine
x, you compute the derivative of sine n*x.  The slope isn't
independent of the x axis, or time axis.


On 6/27/06, Federico <xaero at inwind.it> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Piotr Majdak wrote:
>
> > Federico wrote:
> >> don't know if derivative is the right term..
> >> i mean:
> >> f(x)=x      => f'(x)=1
> >> f(x)=ln(x)  => f'(x)=1/x
> >> f(x)=sin(x) => f'(x)=cos(x)
> >
> >
> > I don't know such as object, but maybe this will help you a little bit:
> > Because you're dealing with finite discrete signals, the derivative of a
> > signal becomes a difference between two consecutive samples. You can
> > easily implement it using [z~] (from zexy, I think) and then subtract
> > the delayed and original sequence:
> >
> > y[n]= x[n]-x[n-1]
>
> hmm... I tried this with [z~] and [fexpr~], achieving the same result....
>
> I wonder if there are errors in this way of computing derivative...
>
> I am looking at my math notebook, where I read that derivatives are the
> "limit for the incremental ratio of a function", where h is the
> increment, and f(x) is the function, and I have this formula:
>
>
> y' = lim {h >> 0}  ( f(x+h) - f(x) ) / h
>
> translating this into a fexpr~ I do:
>
> [osc~]                    [float (h)]
> |                         |
> [fexpr~ ($x1-$x1[-$f2])/$f2]
>
> recalling the rules above, for f(x)=sin(x),
> I should have f'(x)=cos(x), however its amplitude lower as frequency
> lowers... and phase offset of [osc~]' is 180° not 90°....
> what's the problem? h isn't enough close to zero?
>
> is there an "ideal" derivator? or I am say something totally wrong?
>
> - --
> Federico
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFEoVuixlXK3KziJfcRAsP+AJ9/+u4wgLZKYt6MN9QxUvP26nmxZgCfdIbF
> hdZFx8rIgh+UJR4ipF6QDmA=
> =0yYt
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>


-- 
"Far and away the best prize that life has to offer is the chance to
work hard at work worth doing."
-Theodore Roosevelt




More information about the Pd-list mailing list