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

NameDomainDirection
usignalin
ysignalout

Parameters

NameUnitDefaultRangeDescription
Tss0.10 to ∞Sample period

Variables

NameUnitStartDescription
last1Latest sampled input
held1Output, the sample before the latest
nextsTsTime 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