Implement discrete transfer function
Simulink / Discrete
HDL Coder / Discrete
HDL Coder / HDL Floating Point Operations
The Discrete Transfer Fcn block implements the ztransform transfer function as follows:
$$H(z)=\frac{num(z)}{den(z)}=\frac{nu{m}_{0}{z}^{m}+nu{m}_{1}{z}^{m1}+\mathrm{...}+nu{m}_{m}}{de{n}_{0}{z}^{n}+de{n}_{1}{z}^{n1}+\mathrm{...}+de{n}_{n}}$$
where m+1 and n+1 are the number of numerator and denominator coefficients, respectively. num and den contain the coefficients of the numerator and denominator in descending powers of z. num can be a vector or matrix, while den must be a vector. The order of the denominator must be greater than or equal to the order of the numerator.
Specify the coefficients of the numerator and denominator polynomials in descending powers of z. This block lets you use polynomials in z to represent a discrete system, a method that control engineers typically use. Conversely, the Discrete Filter block lets you use polynomials in z^{1} (the delay operator) to represent a discrete system, a method that signal processing engineers typically use. The two methods are identical when the numerator and denominator polynomials have the same length.
The Discrete Transfer Fcn block applies the ztransform transfer function to each independent channel of the input. The Input processing parameter allows you to specify whether the block treats each column of the input as an individual channel (framebased processing) or each element of the input as an individual channel (samplebased processing). To perform framebased processing, you must have a DSP System Toolbox™ license.
Use the Initial states parameter to specify initial filter states. To determine the number of initial states you must specify and how to specify them, use the following tables.
FrameBased Processing
Input  Number of Channels  Valid Initial States (Dialog Box)  Valid Initial States (Input Port) 

 1 


 N 


SampleBased Processing
Input  Number of Channels  Valid Initial States (Dialog Box)  Valid Initial States (Input Port) 

 1 


 N 


 K × N 


When the Initial states is a scalar, the block initializes all filter
states to the same scalar value. To initialize all states to zero, enter
0
. When the Initial states is a vector
or a matrix, each vector or matrix element specifies a unique initial state for a
corresponding delay element in a corresponding channel:
The vector length must equal the number of delay elements in the
filter, M = max(number of zeros, number of
poles)
.
The matrix must have the same number of rows as the number of delay
elements in the filter, M = max(number of zeros, number of
poles)
. The matrix must also have one column for each
channel of the input signal.
The following example shows the relationship between the initial filter output and the initial input and state. Given an initial input u_{1}, the first output y_{1} is related to the initial state [x_{1}, x_{2}] and initial input by as follows:
$$\begin{array}{l}y1=4x1\\ x2=1/2(u13x1)\end{array}$$
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

^{[a]} This block only supports signed fixedpoint data types. 