Identify discrete-time filter parameters from frequency response data
Stable Approximate Transfer Function
Convert a simple transfer function to frequency response data and then back to the original filter coefficients. Sketch the zeros and poles of the function.
a = [1 2 3 2 1 4]; b = [1 2 3 2 3]; [h,w] = freqz(b,a,64); [bb,aa] = invfreqz(h,w,4,5)
bb = 1×5 1.0000 2.0000 3.0000 2.0000 3.0000
aa = 1×6 1.0000 2.0000 3.0000 2.0000 1.0000 4.0000
aa are equivalent to
a, respectively. However, the system is unstable because it has poles outside the unit circle. Use
invfreqz's iterative algorithm to find a stable approximation to the system. Verify that the poles are within the unit circle.
[bbb,aaa] = invfreqz(h,w,4,5,,30)
bbb = 1×5 0.2427 0.2788 0.0069 0.0971 0.1980
aaa = 1×6 1.0000 -0.8944 0.6954 0.9997 -0.8933 0.6949
h — Frequency response
Frequency response, specified as a vector.
m — Desired order
positive integer scalar
Desired order of the numerator and denominator polynomials, specified as positive integer scalars.
wt — Weighting factors
Weighting factors, specified as a vector.
wt is a vector of
weighting factors that is the same length as
iter — Number of iterations in the search algorithm
positive real scalar
Number of iterations in the search algorithm, specified as a positive real scalar.
iter parameter tells
invfreqz to end the
iteration when the solution has converged, or after
iterations, whichever comes first.
tol — Tolerance
0.01 (default) | scalar
Tolerance, specified as a scalar.
invfreqz defines convergence
as occurring when the norm of the (modified) gradient vector is less than
To obtain a weight vector of all ones, use
a — Transfer function coefficients
Transfer function coefficients, returned as vectors. Express the transfer function
in terms of
b = [1 3 3 1]/6 and
a = [3 0 1 0]/3
specify a third-order Butterworth filter with normalized 3 dB frequency
Complex Number Support: Yes
invfreqz uses an equation error method to identify the best
model from the data. The method finds
by creating a system of linear equations and solving them with the MATLAB®
\ operator. Here A(ω(k)) and
B(ω(k)) are the Fourier transforms of the polynomials
b, respectively, at the frequency ω(k), and
n is the number of frequency points (the length of
w). This algorithm is a based on Levi .
The superior ("output-error") algorithm uses the damped Gauss-Newton method for iterative search , with the output of the first algorithm as the initial estimate. This solves the direct problem of minimizing the weighted sum of the squared error between the actual and the desired frequency response points.
 Levi, E. C. “Complex-Curve Fitting.” IRE Transactions on Automatic Control. Vol. AC-4, 1959, pp. 37–44.
 Dennis, J. E., Jr., and R. B. Schnabel. Numerical Methods for Unconstrained Optimization and Nonlinear Equations. Englewood Cliffs, NJ: Prentice-Hall, 1983.
Introduced before R2006a