RateTransition Block
Zero-order hold rate transition. Samples the input at the block's own sample rate and holds the value until the next sample instant. Place between subsystems running at different rates to make the crossing explicit.
Open RateTransition in BlockWerk →# Rate Transition Block
Description
The Rate Transition block transfers a signal across a sample-rate boundary using a zero-order hold (ZOH). It samples the incoming signal at its own sampleTime and holds that value constant until the next sample instant. The block makes the rate crossing explicit and prevents data hazards that arise when a fast subsystem drives a slow subsystem (or vice versa) without an explicit interface.
Place this block between any two subsystems that run at different sample rates — for example, between a 1 kHz sensor-reading loop and a 10 Hz control law, or between a continuous-time source and a discrete-time filter. The held output is deterministic and free of aliasing artefacts within the constraints of ZOH interpolation.
Mathematical Model
y[k] = u(t_s · k) for t in [t_s · k, t_s · (k+1))
Where:
u(t)— continuous or faster-rate input signaly[k]— held output at discrete index kt_s—sampleTime(the Rate Transition block's own sample period, seconds)- The output is constant between sample instants (zero-order hold)
Parameters
sampleTime
Sample period in seconds at which the input is latched. The minimum accepted value is 0.0001 s (10 kHz). Default: 0.01 s (100 Hz).
initialCondition
Output value held before the first sample is taken (i.e., at t = 0 before the first update tick). Default: 0.
Examples
Bridging a fast sensor to a slow controller
Sensor (1 kHz) → RateTransition (sampleTime=0.1) → PID Controller (10 Hz) → Actuator
Downsampling a continuous sine to discrete
Sine → RateTransition (sampleTime=0.01) → DiscreteStateSpace
Remarks
- ZOH only: The block always uses zero-order hold. There is no linear interpolation mode; if interpolation is needed, combine with a discrete FIR filter downstream.
- Upsampling: When the destination runs faster than
sampleTime, the block still outputs the last latched value — the faster consumer simply reads the same held value multiple times per source update cycle. - Initial transient: During
[0, sampleTime)the output equalsinitialCondition, not the first input sample. - Rate isolation: Without this block, connecting blocks at mismatched rates can cause undefined execution ordering. Always insert a Rate Transition at every rate boundary.
- Discrete states: The block uses one internal discrete state slot to store the held value.
See Also
- DiscreteStateSpace: Often placed downstream of a Rate Transition to implement a discrete-time controller or filter.
- ZeroOrderHold: A lower-level continuous-to-discrete hold primitive; Rate Transition additionally enforces sample-rate domain boundaries.
- UnitDelay: Provides a one-step delay within a single rate domain; not a substitute for Rate Transition across boundaries.