DSP Blockset | ![]() ![]() |
Basic Algorithmic Delay
A typical example of a block that does have algorithmic delay is the Variable Integer Delay block.
The input to the Delay
port of the block specifies the number of sample periods that should elapse before an input to the In
port is released to the output. This value represents the block's algorithmic delay. For example, if the input to the Delay
port is a constant 3
, and the sample period at both ports is 1
, then a sample that arrives at the block's In
port at time t=0 is released to the output at time t=3.
Example: Basic Algorithmic Delay. Create the model shown below to observe the operation of a block with basic delay.
Use the default settings for the Digital Clock, Mux, and To Workspace blocks, and adjust the Signal From Workspace block's parameters to the values below:
Set the DSP Constant block's Constant value parameter to 3
, and set the Variable Integer Delay block's Initial conditions parameter to -1
.
Now run the simulation and look at the output, yout
. The first few samples are shown below:
The first column of yout
is the Simulink time provided by the Digital Clock block, and the second column is the delayed input. As expected, the input to the block at t=0 is delayed three samples, and appears as the fourth output sample, at t=3. You can also see that the first three outputs from the Variable Integer Delay block inherit the value of the block's Initial conditions parameter, -1
. This period of time, from the start of the simulation until the first input is propagated to the output, is sometimes called the initial delay of the block.
Many blocks in the DSP Blockset have some degree of fixed or adjustable algorithmic delay. These include any blocks whose algorithms rely on delay or storage elements, such as filters or buffers. Often (but not always), such blocks provide an Initial conditions parameter that allows you to specify the output values generated by the block during the initial delay. In other cases, the initial conditions are internally fixed at 0.
Consult the online block reference, Blocks -- By Category, for the delay characteristics of particular DSP blocks.
![]() | Zero Algorithmic Delay and Algebraic Loops | Excess Algorithmic Delay (Tasking Latency) | ![]() |