This example shows how to model multirate signal processing systems using the dataflow subsystem. When you set the domain of a subsystem to dataflow and enable the Automatic frame size calculation parameter, the software calculates the signal sizes of frame-based multirate models and inserts buffers so that the model compiles with no frame size propagation errors.
For more information on dataflow domains, see Dataflow Domain.
To begin, open the model.
addpath (fullfile(docroot, 'toolbox', 'dsp', 'examples')); ex_multistage_filter
The subsystem of this model contains several rate conversion blocks.
When you update the model diagram, Simulink® generates an error due to a port dimension mismatch in the model. To fix this error, set the domain of the subsystem to dataflow.
If the Property Inspector is not visible, in the Modeling tab, under Design, select Property Inspector.
With the subsystem selected, in the Execution tab of the Property
Inspector, select Set execution domain. Set the
Domain to Dataflow
.
Select Automatic frame size calculation to have the software automatically calculate frame sizes and insert buffers where needed.
Update the diagram again. The model now updates successfully.
Badges on the model canvas at the input of the subsystem indicate the places where buffers are inserted.