DSP Blockset | ![]() ![]() |
Example: Zero Tasking Latency. Now try the previous example in the Simulink single-tasking mode. The model and all of the block parameter settings are the same.
To engage the Simulink single-tasking mode, adjust the following settings in the Solver panel of the Simulation Parameters dialog box:
When does the first input sample appear in the output?
The "Latency and Initial Conditions" section of the reference page for Upsample indicates that the block has zero latency for all multirate operations in the Simulink single-tasking mode. To verify this, look at the output from the simulation, squeeze(yout)'. The first few samples are shown below:
The first column of yout
is the Simulink time provided by the Digital Clock block. The four values to the right of each time are the values in the output frame at that time.
You can see that the first input value appears as the first sample of the first output frame (at t=0), as expected for zero-latency operation. Running this model under the Simulink single-tasking mode therefore eliminates the 17-sample delay that the model experiences under the Simulink multitasking mode (for the particular parameter settings in the example).
![]() | Example: Nonzero Tasking Latency | Filters | ![]() |