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
| Name | Domain | Direction |
|---|---|---|
y | signal | out |
Parameters
| Name | Unit | Default | Range | Description |
|---|---|---|---|---|
k | 1 | 1 | Amplitude | |
T | s | 1 | 0 to ∞ | Period |
offset | 1 | 0 | Value at the start of each period | |
t0 | s | 0 | Start time |
Variables
| Name | Unit | Start | Description |
|---|---|---|---|
period_start | s | t0 | Time 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)