Main Content

filtic

Initial conditions for transposed direct-form II filter implementation

Description

z = filtic(b,a,y,x) finds the initial conditions z for the delays in the transposed direct-form II filter implementation given past outputs y and inputs x. The vectors b and a represent the numerator and denominator coefficients, respectively, of the filter's transfer function.

z = filtic(b,a,y) assumes that the input x is 0 in the past.

example

Examples

collapse all

Determine the zero input response of the following system: y(n)+1.12y(n-1)=0.1x(n)+0.2x(n-1) with initial condition y(-1)=1. Set the numerator and denominator coefficients and the initial conditions for the output.

b = [0.1 0.2];
a = [1 1.12];
Y = 1;

Calculate the zero input initial conditions for the system.

xic = filtic(b,a,Y);

Compute the zero input response.

yzi = filter(b,a,zeros(1,20),xic);
stem(yzi)

Figure contains an axes object. The axes object contains an object of type stem.

Input Arguments

collapse all

Transfer function coefficients, specified as vectors.

Example: b = [1 3 3 1]/6 and a = [3 0 1 0]/3 specify a third-order Butterworth filter with a normalized 3-dB frequency of 0.5π rad/sample.

Data Types: double

Past output, specified as a vector. The vector y contains the most recent output first, and oldest output last as in

y=[y(1),y(2),y(3),,y(m)]

where m is length(a)-1 (the denominator order). If length(y) is less than m, the function pads it with zeros to length m.

Data Types: double

Past input, specified as a vector. The vector x contains the most recent input first, and oldest input last as in

x=[x(1),x(2),x(3),,x(n)]

where n is length(b)-1 (the numerator order). If length(x) is less than n, the function pads it with zeros to length n.

Data Types: double

Output Arguments

collapse all

Initial conditions, returned as a column vector. The length of z is equal to the larger of n and m. z describes the state of the delays given past inputs x and past outputs y.

Algorithms

The filtic function performs a reverse difference equation to obtain the delay states z. Elements of x beyond x(n-1) and elements of y beyond y(m-1) are unnecessary so filtic ignores them.

The transposed direct-form II structure is shown in this illustration, where n – 1 is the filter order.

Block diagram representing the transposed direct form II implementation of a filter with order n-1, input x(m) and output y(m).

References

[1] Oppenheim, A.V., and R.W. Schafer, Discrete-Time Signal Processing, Prentice-Hall, 1989, pp. 296, 301-302.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced before R2006a

See Also

|