block - Generate block from multirate filter

Syntax

block(hm)
block(hm,'propertyname1',propertyvalue1,'propertyname2',propertyvalue2,...)

Description

block(hm) generates a Signal Processing Blockset block equivalent to hm.

block(hm,'propertyname1',propertyvalue1,'propertyname2',propertyvalue2,...) generates a Signal Processing Blockset block using the options specified in the property name/property value pairs. The valid properties and their values are

Property Name

Description and Values

Destination

Determines which Simulink® model gets the block. Enter current, new, or specify the name of an existing subsystem with subsystemname. Specifying new opens a new model and adds the block. Current adds the block to your current Simulink model. Current is the default setting. If you provide the name of a current subsystem in subsystemname, block adds the new block to your specified subsystem.

Blockname

Specifies the name of the generated block. The name appears below the block in the model. When you do not specify a block name, the default is filter.

OverwriteBlock

Tells block whether to overwrite an existing block of the same name, or create a new block. Off is the default setting—block does not overwrite existing blocks with matching names. Switching from off to on directs block to overwrite existing blocks.

MapStates

Specifies whether to apply the current filter states to the new block. This lets you save states from a filter object you may have used or configured in a specific way. The default setting of off means the states are not transferred to the block. Choosing on preserves the current filter states in the block.

Using block to Realize Fixed-Point Multirate Filters

When the source filter hm is fixed-point, such as an FIR decimator with fixed-point arithmetic, block maps the fixed-point properties for hm to the new block according to a set of rules:

Other fixed-point properties map directly to settings for word and fraction length in the realized block.

Examples

Two examples of using block demonstrate the syntax capabilities. Both examples start from an mfilt object with interpolation factor of three. In the first example, use block with the default syntax, letting the function determine the block name and configuration.

l = 3; % Interpolation factor
hm = mfilt.firdecim(l);

Now use the default syntax to create a block.

block(hm);

In this second example, define the block name to meet your needs by using the property name/property value pair input arguments.

block(hm, 'blockname', 'firdecim');

The figure below shows the blocks in a Simulink model. When you try these examples, you see that the second block writes over the first block location. You can avoid this by moving the first block before you generate the second, always naming your block with the blockname property, or setting the Destination property to new which puts the filter block in a new Simulink model.

See Also

Refer to Realizing Filters as Simulink Subsystem Blocks in FDATool, and realizemdl

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS