Hello,
With this message : [foo cosinesum 64 1.(
all values of foo array are set to 1.
While with this one : [foo sinesum 64 1.(
i have the expected simple sinus drawn ; is it a bug ?
(i'm os X.4.11 with Pd-vanilla 0.43-1test5)
Cosinesum
Hello,
With this message : [foo cosinesum 64 1.(
all values of foo array are set to 1.
While with this one : [foo sinesum 64 1.(
i have the expected simple sinus drawn ; is it a bug ?
(i'm os X.4.11 with Pd-vanilla 0.43-1test5)
The first frequency of cosinesum is actually the DC offset. So [foo cosinesum 64 0 1( should give you what you're looking for. I don't know why it isn't the same for both, though, so I can't really say whether or not it's a bug.
Hello,
quick look in sources and it seems there is no DC in case of sinus as in this applet ...
http://lumimath.univ-mrs.fr/~jlm/cours/fourier/fourier1.htm
... i don't know why ; anybody ?
Anyway thanks for reply.
what maelstorm says appears to be correct from my simple test.
the sinesum message is built like this:
[;
arrayname sinesum arraysize a b c d ....(
where a b c d.. are the various partials strengths that make up the summed wave
if you just try
[;
arrayname sinesum arraysize (
it outputs an error, like this:
error: sinesum: array1: need number of points and partial strengths
then, with cosinesum, the syntax has one more value - the DC offset,
so the syntax is:
[;
arrayname cosinesum arraysize OFFSET a b c d ....(
in this case, if you did
[;
arrayname cosinesum arraysize 0(
to my thinking, it should act the same as sinsesum and output the error that you need to add partial strengths. However, it doesn't. It just makes a wave with an offset, and no partials. In your case, you are making cosinesum 64 1, so it makes a 64 point wave with an offset of 1 and no partials - ie, it just pins at 1.
not really sure if this is a 'bug' though?
as maelstorn said, cosinesum 64 0 1 will be the cosine equivalent of sinesum 64 1
Hello mod,
you are right, and and after a good night it seems obvious why :
cosinesum : a0 * cos (0. * x) + a1 * cos (1. * x) + a2 * cos (2. * x) + ... + an * cos (n * x)
sinesum : b0 * sin (0. * x) + b1 * sin (1. * x) + b2 * sin (2. * x) + ... + bn * sin (n * x)
for cosinesum, a0 * cos (0) = a0 ; while for sinesum : b0 * sin (0) is ALWAYS 0 ; so you don't have to give the b0 amplitude, list of amplitudes start with b1 in case of sinesum.
it is not a "bug", it is normal behavior ; i'm not sure it is a very intuitive approach ; better to keep the same logic (for math noob like me) ? ; but anyway it seems this is the common way ...
Oops! Looks like something went wrong!