Block Category: Fixed Point, Linear System
Inputs: Real, complex, or fixed-point (scaled_int) scalars.
Description: The transferFunction block executes a single-input single-output linear transfer function specified as:
• M file created with Embed: Analyze > Linearize generates ABCD state-space matrices from the nonlinear system by numerically evaluating the matrix perturbation equations at the time the simulation was halted.
• M file created with a text editor: The following is an example of a user-written M file:
function [a,b,c,d] =vabcd
a = [-.396175 -1.17336 ; 5.39707 .145023 ];
b = [-.331182 ; -1.08363 ];
c = [0 1 ];
d = [0 ];
• MAT file created with MATLAB: Generating MAT files is described in the MATLAB documentation. Note that when you save the ABCD matrices to file, the names of the matrices are not important; however, the order in which they appear is.
When you simulate the block diagram, Embed numerically solves the transferFunction block. The transferFunction Properties dialog lets you control how the numerator and denominator polynomials are entered in its Properties dialog.
C2000 and ARM Cortex code generation: When generating code for C2000 or ARM Cortex targets and you include one or more transferFunction blocks in your diagram and you activate Check for Performance Issues in the Code Generation dialog, Embed warns you that large RAM blocks are not supported for the target. You can continue with code generation; however, the generated code may not fit in the target RAM and it will run slower.
Arduino and MSP430 code generation: When generating code for Arduino or MSP430 targets, you cannot include transferFunction blocks in your diagram. Embed halts code generation and issues a message to replace the block.
Digital filter design: The transferFunction block supports IIR and FIR digital filter design.
Display Filter Method Displays the filter specification on the block. When Display Filter Method is not activated, Embed displays the polynomial coefficients.
Gain: Indicates the transfer function gain. If the leading terms of the numerator and denominator coefficients are not unity, Embed will adjust the gain to make it so. The default is 1.
Initial Value: Specifies initial values for the states in the block. The values are right adjusted. The right-most value corresponds to the lowest order state. Unspecified states are set to 0. The initial value can be a variable.
.mat/.m File: Specifies the name of the M or MAT file to be used as input to the transferFunction block. If you do not know the name, click Select File to find it.
Denominator: Indicates the denominator polynomial for the transferFunction block. Separate values with a space. Embed determines the order of the transfer function by the number of denominator coefficients you enter. For example, an nth order transfer function will have n + 1 coefficients. You can specify the denominator as a matrix expression.
Numerator: Indicates the numerator polynomial for the transferFunction block. Separate values with a space. You can specify the numerator as a matrix expression.
Radix Point: Sets the binary point.
Discrete: Indicates a discrete Z-Domain transfer function. Enter the coefficients directly into Numerator and Denominator. Enter the time step for the discrete transfer function in the dT. By default, Embed uses the step size established with the System Properties dialog. When Discrete is de-activated, a continuous transfer function is created. For information on resolving issues with discrete transfer function behavior, see the Embed discrete transferFunction Forum entry.
dT: Specifies the time step for the discrete transfer function. By default, Embed uses the step size parameter from the System Properties dialog.
Poles and Zeros: Lets you enter a transfer function via zeros and poles in Numerator and Denominator. Enter each root in the following format:
(real-part, imaginary-part)
For large order systems, poles and zeros is more numerically accurate.
Polynomial: Indicates that the transfer function is to be specified as numerator and denominator polynomials.
.mat File: Indicates that the transfer function is to be specified as a MAT file. Specify the MAT file name under .mat/.m File.
.m File: Indicates that the transfer function is to be specified as an M file. Specify the M file name under .mat/.m File.
Tapped Delay: Provides tapped delay implementation for high-order FIR filters.
Use 32-Bit Precision: Simulates the behavior of the transfer function at 32-bit precision. Normally, all Embed blocks are 64-bit precision. This parameter allows you to simulate the effect of code running on a floating-point 32-bit target.
Use Scaled Fixed Point: When targeting a fixed-point processor, such as a TI C2000, activate this parameter. Embed uses scaled fixed-point internal operations and will generate scaled fixed-point code.
Word Length: Sets the word size for the target architecture.
Convert S to Z: Uses bilinear transformation to convert a continuous transfer function to an equivalent discrete transfer function with a sampling interval of dT.
Convert Z to S: Uses bilinear transformation to convert a discrete transfer function to an equivalent continuous transfer function.
FIR Filter button: Opens the FIR Filter Setup dialog to construct Regular Finite Impulse Response filters, differentiators, and Hilbert Transformers.
IIR Filter button: Opens the IIR Filters Setup dialog to design a suitable filter using analog prototypes.