Trig

The amplitude is computed based on the following summation.

For Sine,

A(t)=aisin(i2πT0(tt0)=aisin(if0(tt0))fort>t0.A(t)=\sum{}a_i\sin(i\dfrac{2\pi}{T_0}(t-t_0)=\sum{}a_i\sin(if_0(t-t_0))\quad\text{for}\quad{}t>t_0.

For Cosine,

A(t)=aicos(i2πT0(tt0))=aicos(if0(tt0))fort>t0.A(t)=\sum{}a_i\cos(i\dfrac{2\pi}{T_0}(t-t_0))=\sum{}a_i\cos(if_0(t-t_0))\quad\text{for}\quad{}t>t_0.

In above equations, T0T_0 is the base period and f0f_0 is base frequency accordingly. In the above definition, t0t_0 is the (pseudo) start time of the step in which the amplitude is defined.

Syntax

amplitude Sine (1) (2) (3) [(4)...]
amplitude Cosine (1) (2) (3) [(4)...]
# (1) int, unique tag
# (2) double, base period T_0
# (3) double, amplitude at base period/frequency a_0
# [(4)...] double, optional amplitudes at higher periods a_i

Example

amplitude Sine 1 10. 2.
A(t)=2sin(π5(tt0)).A(t)=2\sin(\dfrac{\pi}{5}(t-t_0)).
amplitude Sine 1 10. 2. 4.
A(t)=2sin(0.2π(tt0))+4sin(0.4π(tt0)).A(t)=2\sin(0.2\pi{}(t-t_0))+4\sin(0.4\pi{}(t-t_0)).

Last updated