Hold Block
Sample-and-hold block. Zero-order hold (ZOH) holds the last sampled value. First-order hold (FOH) linearly interpolates between samples.
Open Hold in BlockWerk →# Hold Block
Description
Sample-and-hold block that samples the input at regular intervals and holds or interpolates the value between samples.
Mathematical Model
Zero-Order Hold (ZOH):
y(t) = u(t_k) for t_k ≤ t < t_{k+1}
First-Order Hold (FOH):
y(t) = u(t_k) + (u(t_k) - u(t_{k-1}))/T · (t - t_k) for t_k ≤ t < t_{k+1}
where t_k = k · T and T is the sample time.
Parameters
mode
- zoh: Zero-Order Hold — holds the last sampled value constant until the next sample (staircase output)
- foh: First-Order Hold — linearly extrapolates between samples using the slope from the last two samples
sampleTime
Interval between samples (seconds). The block samples the input at multiples of this interval.
Remarks
- ZOH vs FOH: Zero-Order Hold produces a staircase output (common in DACs); First-Order Hold linearly extrapolates (smoother but can overshoot)
- Sample time: Must be ≥ the simulation base timestep; values below the base step are clamped
- Rate transition: Use Hold to bridge subsystems running at different sample rates
- ZOH mode: Most numerically stable; recommended unless FOH's smoother output is explicitly needed
- FOH mode: Requires two prior samples; initial behaviour differs on the first step after a rate transition
See Also
- UnitDelay: Delays by exactly one sample
- DiscreteIntegrator: Discrete-time accumulator