Rate Transition
Control of data transfer between blocks operating at different rates (sampling rate).
Description
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. Correct setting of the block parameters allows to find a balance between data integrity and transfer determinism on the one hand, and higher performance or memory saving on the other hand.
Processing parameters
Processing parameters | Block parameter settings |
---|---|
|
Enabled:
|
|
Enabled:
Not enabled:
|
|
Not included:
|
Ports
Input
Port_1 - input signal
scalar
| vector
| matrix
| N-dimensional array
| bus
Input signal as a scalar, vector, matrix, array or bus.
Data types: Int8
, Uint8
, Int16
, UInt16
, Int32
, UInt32
, Int64
, UInt64
, Int128
, UInt128
, Float16
, Float32
, Float64
, Bool
, Fixed-point
, BusSignal
.
Support for complex numbers: Yes
Output
Port_1 - output signal
scalar
| vector
| matrix
| N-dimensional array
| bus
The input signal is converted to an output signal at the specified sampling rate. The configuration by default provides secure and deterministic data transmission.
Data types: Int8
, Uint8
, Int16
, UInt16
, Int32
, UInt32
, Int64
, UInt64
, Int128
, UInt128
, Float16
, Float32
, Float64
, Bool
, Fixed-point
, BusSignal
.
Support for complex numbers: Yes
Parameters
Ensure data integrity during data transfer - ensure data integrity
enabled (by default)
| disabled
Checking this box causes code to be created to ensure data integrity during data transfer by block. If this parameter is enabled and the transmission is non-deterministic, then, depending on the priority of the input or output rate, the generated code will use one or more buffers to protect data integrity during transmission.
Otherwise, the Rate Transition block is either ignored or generates code that uses a copy operation to affect the data transfer. This unprotected mode consumes less memory. But the copy operation can be interrupted, which can cause loss of data integrity during transmission. Enable this option to make the generated code run at maximum speed (i.e. non-deterministic) and preserve data integrity.
Block parameter |
|
Value |
|
By default |
|
Ensure deterministic data transfer (maximum delay) -ensure deterministic data transfer
On (By default)
| Off
Checking this checkbox results in the creation of code that transfers data at the sampling rate of the slower block, i.e. deterministically. If this checkbox is not selected, data transmission occurs when new data is available from the source block and the receiving block is ready to receive the data. In this way, transfer delays are eliminated, thereby ensuring that the system operates at maximum responsiveness. However, transfers can occur unpredictably, which is undesirable in some applications.
Dependencies
To use this parameter, set Ensure data integrity during data transfer to `enabled'.
Block parameter |
|
Value |
|
By default |
|
Initial conditions - initial value
0 (by default)
| scalar
| vector
| matrix
| N-dimensional array
This parameter applies only to transitions from a slow block to a fast block. It sets the output value of the Rate Transition block at the beginning of the transition when there is no output signal due to no input signal coming from the slow block connected to the input of the Rate Transition block.
The set value must be a scalar or have the same dimensions as the input signal.
Dependencies
To use this parameter, set Ensure data integrity during data transfer to `enabled'.
Support for complex numbers: Yes
Block parameter |
|
Value |
|
* By default* |
|
Output port sample time options - method of specifying the output port calculation step
Specify (by default)
| Inherit
| Multiple of input port sample time
Specifies the method of specifying the output port calculation step. Options:
-
Specify
- use the Output port sample time parameter to explicitly specify the output sample rate. -
Inherit
- inherit the calculation step from the block to which the output port is connected. -
Multiple of input port sample time
- set the output rate of the Rate Transition block as a multiple of its input rate (parameter Sample time multiple (>0)).
If you select Inherit
and all blocks connected to the output port also inherit the calculation step, the fastest calculation step in the model is applied.
Block parameter |
|
Value |
|
By default |
|
Output port sample time - output port calculation step
-1 (by default)
| scalar
Enter the value of the calculation step for the output port.
A value by default (-1
) indicates that the Rate Transition block inherits the output rate from the block to which the output port is connected.
Dependencies
To use this parameter, set the Output port sample time options to Specify
.
Block parameter |
|
Value |
|
By default |
|
Sample time multiple(>0) - calculation step multiplier
1 (by default)
| positive scalar
A positive value that sets the output signal calculation step to a multiple of the input signal frequency.
A value by default (1
) indicates that the output rate is the same as the input rate. A value of 0.5
indicates that the output rate is half the input rate. A value of 2
indicates that the output speed is twice the input speed.
Dependencies
To use this parameter, set Output port sample time options to Multiple of input port sample time.
Block parameter |
|
Value |
|
By default |
|