| Contents | Index |
Signal Attributes
The Rate Transition block transfers data from the output of a block operating at one rate to the input of a block operating at a different rate. Use the block parameters to trade data integrity and deterministic transfer for faster response or lower memory requirements. To learn about data integrity and deterministic data transfer, see Data Transfer Problems in the Simulink Coder documentation.
| Transition Handling Options | Block Parameter Settings |
|---|---|
| Select:
|
| Select:
Clear:
|
| Clear:
|
The behavior of the Rate Transition block depends on:
Sample times of the ports to which the block connects (see Effects of Synchronous Sample Times and Effects of Asynchronous Sample Times)
Priorities of the tasks for the source and destination sample times (see Sample time properties in the Simulink documentation)
Whether the model specifies a fixed- or variable-step solver (see Solvers in the Simulink documentation)
When you update your diagram, a label appears on the Rate Transition block to indicate simulation behavior.
| 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 |
| Mixed | Expands to multiple blocks with different behaviors |
The block behavior label shows the method that ensures safe transfer of data between tasks operating at different rates. You can use the sample-time colors feature (see Displaying Sample Time Colors in the Simulink documentation) to display the relative rates that the block bridges. Consider, for example, the following model:

Sample-time colors and the block behavior label show 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 Handle Rate Transitions in the Simulink Coder documentation for more information.
The following table summarizes how each label appears if the sample times of the input and output ports (inTs and outTs) are periodic, or synchronous.
Block Settings | Block Label | |||
|---|---|---|---|---|
Rate Transition | Conditions for Rate Transition Block | With Data Integrity and Determinism | With Only Data Integrity | Without Data Integrity or Determinism |
inTs = outTs (Equal) | inTsOffset < outTsOffset | None (error) | Buf | Copy or NoOp (see note that follows the table) |
inTsOffset = outTsOffset | Copy or NoOp (see note that follows the table) | Copy or NoOp (see note that follows the table) | ||
inTsOffset > outTsOffset | None (error) | Db_buf | ||
inTs < outTs (Fast to slow) | inTs = outTs / N inTsOffset, outTsOffset = 0 | ZOH | Buf | |
inTs = outTs / N inTsOffset ≤ outTsOffset | None (error) | |||
inTs = outTs / N inTsOffset > outTsOffset | None (error) | Db_buf | ||
inTs ≠ outTs / N | None (error) | |||
inTs > outTs (Slow to fast) | inTs = outTs * N inTsOffset, outTsOffset = 0 | 1/z | Db_buf | |
inTs = outTs * N inTsOffset ≤ outTsOffset | None (error) | |||
inTs = outTs * N inTsOffset > outTsOffset | None (error) | |||
inTs ≠ outTs * N | None (error) | |||
KEY
| ||||
When you select Block reduction in the Optimization pane of the Configuration Parameters dialog box, Copy reduces to NoOp. No code generation occurs for a Rate Transition block with a NoOp label. To prevent a block from being reduced when block reduction is on, add a test point to the block output (see Working with Test Points in the Simulink documentation).
The following table summarizes how each label appears if the sample time of the input or output port (inTs or outTs) is not periodic, or asynchronous.
Block Settings | Block Label | |||
|---|---|---|---|---|
| With Data Integrity and Determinism | With Only Data Integrity | Without Data Integrity or Determinism | ||
inTs = outTs | Copy | Copy | Copy | |
inTs ≠ outTs | None (error) | Db_buf | ||
KEY
| ||||
The Rate Transition block accepts signals of any data type that Simulink supports, including fixed-point and enumerated data types.
For more information, see Data Types Supported by Simulink in the Simulink documentation.

Selecting this check box results in generated code that ensures data integrity when the block transfers data. If you select this check box and the transfer is nondeterministic (see Ensure deterministic data transfer 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, which can lead to loss of data during nondeterministic data transfers. Select this check box if you want the generated code to operate with maximum responsiveness (i.e., nondeterministically) and data integrity. See Rate Transition Block Options in the Simulink Coder documentation for more information.
Selecting this check box results in generated code that transfers data at the sample rate of the slower block, that is, deterministically. If you do not select this check box, data transfers occur as soon as new data is available from the source block and the receiving block is ready to receive the data. You avoid transfer delays, thus ensuring that the system operates with maximum responsiveness. However, transfers can occur unpredictably, which is undesirable in some applications. See Rate Transition Block Options in the Simulink Coder documentation for more information.
This parameter applies only to slow-to-fast transitions. It specifies the initial output of the Rate Transition block at the beginning of a transition when there is no output from the slow block connected to the input of the Rate Transition block. Simulink 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 the 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 output rate as a multiple of its input rate.
If you specify Inherit and all blocks connected to the output port also inherit sample time, the fastest sample time in the model applies.
This parameter is visible when you set Output port sample time options 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 Rate Transition block inherits the output rate from the block to which the output port is connected. See How to Specify the Sample Time in the Simulink documentation for information on how to specify the output rate.
This parameter is visible when you set Output port sample time options to 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, a nonzero scalar, or a finite numeric structure. For information about specifying an initial condition structure, see Specifying Initial Conditions for Bus Signals.
All signals in a nonvirtual bus input to a Rate Transition block must have the same sample time, even if the elements of the associated bus object specify inherited sample times. You can use a Rate Transition block to change the sample time of an individual signal, or of all signals in a bus. See Using Composite Signals and Bus-Capable Blocks in the Simulink documentation for more information.
You can use an array of buses as an input signal to a Rate Transition block. For details about defining and using an array of buses, see Combining Buses into an Array of Buses.
Bus-capable | Yes, with restrictions as noted above. |
Direct Feedthrough | No, for slow-to-fast transitions for which you select the Ensure data integrity during data transfer check box. Yes, otherwise. |
Sample Time | This block supports discrete-to-discrete transitions. |
Scalar Expansion | Yes, of input. |
Dimensionalized | Yes |
Multidimensionalized | Yes |
Zero-Crossing Detection | No |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |