Sawtooth

signal.sawtooth

Rises in a straight line from offset to offset + k over each period T, then drops back. Starts at time t0.

Ports

NameDomainDirection
ysignalout

Parameters

NameUnitDefaultRangeDescription
k11Amplitude
Ts10 to ∞Period
offset10Value at the start of each period
t0s0Start time

Variables

NameUnitStartDescription
period_startst0Time the current period began

Equations

der(period_start) = 0
when time >= period_start + T then reinit(period_start, period_start + T)
y = offset + (if time < t0 then 0 else k * (time - period_start) / T)