| Simulink® | ![]() |
Handle transfer of data between blocks operating at different rates
Signal Attributes
The Rate Transition block transfers data from the output of a block operating at one rate to the input of another block operating at a different rate. The Rate Transition block's parameters allow you to specify options that trade data integrity and deterministic transfer for faster response and/or lower memory requirements.
Note See Data Transfer Problems in the online Real-Time Workshop® documentation for a discussion of data integrity and deterministic data transfer. |
In particular, the block supports the following options:
Deterministic transfer of data with data integrity between blocks operating at different speeds at the cost of maximum latency of data transfer
This is the default option.
Nondeterministic data transfer with minimum latency and assured data integrity but increased memory requirements
To specify this option, check the Ensure data integrity during data transfer parameter and uncheck the Ensure deterministic data transfer parameter.
Minimum latency and target size at the cost of nondeterministic data transfer and possible loss of data integrity
To specify this option, uncheck the Ensure data integrity during data transfer and Ensure deterministic data transfer parameters.
The behavior of the Rate Transition block depends on the sample times of the ports between which it is connected, the priorities of the tasks corresponding to the source and destination sample times (see Sample time properties), and whether the model specifies a fixed- or variable-step solver. Updating the diagram causes a label to appear on the block that indicates its behavior during simulation as follows:
| Label | Block Behavior |
|---|---|
| ZOH | Acts as a zero-order hold |
| 1/z | Acts as a unit delay |
| Buf | Copies input to output under semaphore control |
| Db_buf | Copies input to output, using double buffers |
| Copy | Unprotected copy of input to output |
| NoOp | Does nothing |
The behavior label lets you see at a glance the method that the Rate Transition block uses to ensure safe transfer of data between tasks operating at different rates. You can use Simulink® software's sample-time colors feature (see Displaying Sample Time Colors) to display the relative rates that the block bridges. Consider, for example, the following diagram.

Sample-time colors and the block behavior label allow you to see at a glance that the Rate Transition block at the top of the diagram acts as a zero-order hold in a fast-to-slow transition and the bottom Rate Transition block acts as a unit delay in a slow-to-fast transition.
See Sample Rate Transitions in the online Real-Time Workshop documentation for more information.
Note The Zero-Order Hold and Unit Delay blocks also enable transfer of data between blocks operating at different rates. However, you should use the Rate Transition block for this purpose because it offers a wider range of options and is easier to use. |
The Rate Transition block accepts signals of any data type supported by Simulink software, including fixed-point data types.
For a discussion on the data types supported by Simulink software, see Data Types Supported by Simulink® in the Simulink documentation.

Selecting this option results in generation of code that ensures the integrity of data transferred by the Rate Transition block. If you select this option and the transfer is nondeterministic (see Ensure deterministic data transfer option below), the generated code uses double-buffering to prevent the fast block from interrupting the data transfer. Otherwise the generated code uses a copy operation to effect the data transfer. The copy operation consumes less memory than double-buffering but is also interruptible and hence can lead to loss of data during nondeterministic data transfers. Thus, you should select this option if you want the generated code to operate both with maximum responsiveness (i.e., nondeterministically) and assured data integrity. See Rate Transition Block Options in the online Real-Time Workshop documentation for more information.
Selecting this option causes code generation to generate code that transfers data at the sample rate of the slower block, i.e., deterministically. If this option is not selected, data transfers occur as soon as new data is available from the source block and the receiving block is ready to receive the data. This avoids the need to delay transfers, thus ensuring that the system operates with maximum responsiveness. However, it also means that transfers can occur unpredictably, which is undesirable in some applications. See Rate Transition Block Options in the online Real-Time Workshop documentation for more information.
This parameter applies only to slow-to-fast transitions. It specifies the Rate Transition's initial output at the beginning of a transition when there is not yet any output from the slow block connected to the Rate Transition block's input. Simulink software does not allow the initial output of this block to be inf or NaN.
Specifies a mode for setting the output port sample time. The options are:
Specify — Allows you to use the Output port sample time parameter to specify the output rate to which the Rate Transition block converts its input rate.
Inherit — Specifies that the Rate Transition block inherits an output rate from the block to which its output port is connected.
Multiple of input port sample time — Allows you to use the Sample time multiple (>0) parameter to specify the Rate Transition block's output rate as a multiple of its input rate.
This parameter is visible only if the Output port sample time options parameter is set to Specify. Enter a value that specifies the output rate to which the block converts its input rate. The default value (-1) specifies that the output rate is inherited from the block to which the Rate Transition block's output port is connected. See Specifying Sample Time in the Simulink documentation for information on how to specify the output rate.
This parameter is visible only if the Output port sample time options parameter specifies Multiple of input port sample time. Enter a positive value that specifies the output rate as a multiple of the input port sample time. The default value (1) specifies that the output rate is the same as the input rate. A value of 0.5 specifies that the output rate is half of the input rate, while a value of 2 specifies that the output rate is twice the input rate.
The Rate Transition block is a bus-capable block. The input can be a virtual or nonvirtual bus signal, with the restriction that Initial conditions must be zero or a nonzero scalar.
| Bus-capable | Yes, with restrictions as noted above |
Direct Feedthrough | No for slow-to-fast transitions that are protected, i.e., for which you have checked the Ensure data integrity during data transfer option. Otherwise, Yes. |
Sample Time | This block supports discrete-to-discrete transitions. |
Scalar Expansion | Yes, of input. |
Dimensionalized | Yes |
Multidimensionalized | Yes |
Zero Crossing | No |
![]() | Rate Limiter Dynamic | Real-Imag to Complex | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |