Forums > MaxMSP

differenciating trigonometric function with delta~


VG
February 1, 2008 | 5:42 pm

Hi list,

I was confused by the use of delta~ :
wanted to differentiate a cosine to get a sine~.
I thought i would need to multiply the output of delta
by 44100 to approximate derivative by finite difference..
but found out I had to multiply by some 6900 or so to
get the amplitude of my sine wave to have unit amplitude…
Am I blind about something ?

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 275 507 110 9109513 sin^2 + cos^2 =1;
#P comment 141 251 82 9109513 The sine (*-1);
#P comment 431 262 59 9109513 The cosine;
#P newex 355 115 71 9109513 loadmess 6920;
#P number 355 144 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P user scope~ 113 287 243 417 256 3 128 -1. 1. 0 0. 0 0. 102 255 51 135
135 135 0;
#P user scope~ 394 286 524 416 256 3 128 -1. 1. 0 0. 0 0. 102 255 51 135
135 135 0;
#P user scope~ 260 373 390 503 256 3 128 -2. 2. 0 0. 0 0. 102 255 51 135
135 135 0;
#P newex 260 341 27 9109513 +~;
#P newex 302 299 27 9109513 *~;
#P newex 260 297 27 9109513 *~;
#P newex 260 258 40 9109513 *~ 4410;
#P newex 260 229 33 9109513 delta~;
#P newex 261 171 70 9109513 *~ 6.283186;
#P newex 261 195 35 9109513 cosx~;
#B color 5;
#P newex 262 146 49 9109513 phasor~ 1;
#P window setfont "Sans Serif" 20.;
#P comment 395 140 307 9109524 < - How come this value???;
#P connect 2 0 4 0;
#P fasten 2 0 7 0 266 224 307 224;
#P fasten 2 0 7 1 266 220 324 220;
#P fasten 2 0 10 0 266 216 399 216;
#P fasten 5 0 11 0 265 283 118 283;
#P connect 5 0 6 0;
#P fasten 5 0 6 1 265 287 282 287;
#P connect 4 0 5 0;
#P connect 13 0 12 0;
#P connect 12 0 5 1;
#P connect 1 0 3 0;
#P connect 3 0 2 0;
#P connect 7 0 8 1;
#P connect 6 0 8 0;
#P connect 8 0 9 0;
#P window clipboard copycount 17;


February 2, 2008 | 10:59 am

Vincent Goudard schrieb:
> Hi list,
>
> I was confused by the use of delta~ :
> wanted to differentiate a cosine to get a sine~.
> I thought i would need to multiply the output of delta
> by 44100 to approximate derivative by finite difference..
> but found out I had to multiply by some 6900 or so to
> get the amplitude of my sine wave to have unit amplitude…
> Am I blind about something ?

If you change the frequency, you’ll see that the normalisation value is
dependent on that. delta~ will output a maximum value at the zero
crossing. its the difference between adjacent samples. That difference
is dependent on the sampling rate and frequency of the sine. You would
have to calculate your normalisation value according to this…

You’ll see, that your assumed value of 4410 will fit for the frequency
of pi/2 (1.570796 Hz)

Hope this helps…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


Viewing 2 posts - 1 through 2 (of 2 total)