Guy on Simulink

Simulink & Model-Based Design

Frames… from signals to blocks

Today I want to talk about an important topic for DSP System Toolbox and Communications Toolbox users: Frame-Based Processing

Beginning in R2010b, MathWorks started to significantly change the handling of frame- and sample-based processing. Currently, we are in a transition phase and it's time to update your models to the new paradigm.

Sample-based processing vs. frame-based processing

Let's begin by a quick explanation of the difference between frame-based and sample-based processing.

Let's say I have a signal of dimensions 3x2. If I process this signal in a sample-based manner, every simulation step I will process the 6 elements individually as 6 independent channels:

One sample

In frame-based processing, blocks process signals multiple sequential samples per time step. For example, a 3x2 matrix like in the previous example could contain only 2 independent channels. For each channel, this matrix contains a frame of 3 samples:

One frame

As you can guess, frame-based processing can lead to significant performance improvements because each block operates on frames of data rather than on individual samples, and interblock communication is reduced.

Changes to Frame-Based Processing

Historically, in Simulink the frame status has always been an attribute of the signals, like data type and dimensions.

This can be seen by looking at the CompiledPortFrameData property of an Output port with a code like the following:

modelname([],[],[],'compile')
ph = get_param('modelname/White Noise','PortHandles')
get_param(ph.Outport,'CompiledPortFrameData')
modelname([],[],[],'term')

Beginning in R2010b, we started to significantly change the handling of frame- and sampled-based processing. In the future, frame status will no longer be a signal attribute. Instead, individual blocks will control whether they treat inputs as frames of data or as samples of data.

This means that many blocks in the DSP System Toolbox and Communications Toolbox now have an Input Processing option where they can decide to process columns as channels (frame-based) or elements as channels (sample-based). You can notice in the following image that the block dialog clearly mentions that the option to inherit the processing type from the input signal will be removed in the future.

One frame

To open a demo model highlighting the effects of this setting, type ex_inputprocessing at the MATLAB prompt.

What should I do to update my model?

One word: slupdate

During the transition phase, the frame information is still propagated through the signals in your model. Based on this information, slupdate can automatically configure the blocks for the new paradigm.

In the future, the frame information will be removed from signals and you will no longer be able to upgrade your models using the slupdate function. Therefore, you should upgrade your existing models using slupdate as soon as possible.

Now it's your turn

Give a look at the R2011a and 2011b release notes of the DSP System Toolbox and let us know what you think by leaving a comment here.

|

Comments

To leave a comment, please click here to sign in to your MathWorks Account or create a new one.