mathnet-numerics icon indicating copy to clipboard operation
mathnet-numerics copied to clipboard

Numerics.Generate.Periodic amplitude parameter description seems off?

Open erikthysell opened this issue 3 years ago • 2 comments

In Numerics.Generate.Periodic the parameter amplitude description seems to be incorrect (line 331):

<param name="amplitude">The length of the period when sampled at one sample per time unit. This is the interval of the periodic domain, a typical value is 1.0, or 2*Pi for angular functions.</param>

For me, amplitude has nothing to do with length of a period but with the "level" of a signal.

I do not entirely understand the implementation and I do not know if I just misunderstand something here.

erikthysell avatar Dec 22 '22 12:12 erikthysell

It is indeed confusing, since it is assuming a context which is not actually stated, and also not always relevant.

The idea behind these generate functions is, among others, to drive other functions as input. With Periodic you can then sample any function periodically - where amplitude is then indeed the length of the period (or interval) sampled from that other function. Note also that often that amplitude value is never actually reached, depending on the other parameters - which is fine in this context, but maybe not if you indeed intended it to be an amplitude of a saw-tooth curve.

Maybe we should split this into a saw-tooth curve (with different more straight forward parameters), and one for periodically sampling another function, and then make the description much clearer.

cdrnet avatar Dec 24 '22 08:12 cdrnet

Thanks. To be more clear - I am looking for a c# equivalent of the Matlab sawtooth function.

erikthysell avatar Jan 02 '23 10:01 erikthysell