Unit delay
signal.unit_delay
Samples the input every Ts seconds and outputs the sample taken one period earlier. Samples are taken at Ts, 2 Ts, and so on; the output is 0 until 2 Ts.
Ports
| Name | Domain | Direction |
|---|---|---|
u | signal | in |
y | signal | out |
Parameters
| Name | Unit | Default | Range | Description |
|---|---|---|---|---|
Ts | s | 0.1 | 0 to ∞ | Sample period |
Variables
| Name | Unit | Start | Description |
|---|---|---|---|
last | 1 | Latest sampled input | |
held | 1 | Output, the sample before the latest | |
next | s | Ts | Time of the next sample |
Equations
der(last) = 0 der(held) = 0 der(next) = 0 when time >= next then reinit(held, last), reinit(last, u), reinit(next, next + Ts) y = held