Identify continuous-time filter parameters from frequency response data

`[b,a]`

` = `

invfreqs(h,w,n,m)

[b,a]` = `

invfreqs(h,w,n,m,wt)

[b,a]` = `

invfreqs(h,w,n,m,wt,iter)

[b,a]` = invfreqs(h,w,n,m,wt,iter,tol)`

[b,a]` = `

invfreqs(h,w,n,m,wt,iter,tol,'`trace`

')

[b,a]` = `

invfreqs(h,w,'`complex`

',n,m,...)

`invfreqs`

is the inverse operation of `freqs`

.
It finds a continuous-time transfer function that corresponds to a
given complex frequency response. From a laboratory analysis standpoint, `invfreqs`

is
useful in converting magnitude and phase data into transfer functions.

`[b,a]`

returns
the real numerator and denominator coefficient vectors ` = `

invfreqs(h,w,n,m)`b`

and `a`

of
the transfer function

$$H(s)=\frac{B(s)}{A(s)}=\frac{b(1){s}^{n}+b(2){s}^{n-1}+\cdots +b(n+1)}{a(1){s}^{m}+a(2){s}^{m-1}+\cdots +a(m+1)}$$

whose complex frequency response is given in vector `h`

at
the frequency points specified in vector `w`

. Scalars `n`

and `m `

specify
the desired orders of the numerator and denominator polynomials.

The length of `h`

must be the same as the length
of `w`

. `invfreqs`

uses `conj(h)`

at `-w`

to
ensure the proper frequency domain symmetry for a real filter.

`[b,a]`

weights
the fit-errors versus frequency, where ` = `

invfreqs(h,w,n,m,wt)`wt`

is a
vector of weighting factors the same length as `w`

.

`[b,a]`

and ` = `

invfreqs(h,w,n,m,wt,iter)

`[b,a]`

provide
a superior algorithm that guarantees stability of the resulting linear
system and searches for the best fit using a numerical, iterative
scheme. The ` = invfreqs(h,w,n,m,wt,iter,tol)`

`iter`

parameter tells `invfreqs`

to
end the iteration when the solution has converged, or after `iter`

iterations,
whichever comes first. `invfreqs`

defines convergence
as occurring when the norm of the (modified) gradient vector is less
than `tol`

, where `tol`

is an optional
parameter that defaults to 0.01. To obtain a weight vector of all
ones, use

invfreqs(h,w,n,m,[],iter,tol)

`[b,a]`

displays
a textual progress report of the iteration. ` = `

invfreqs(h,w,n,m,wt,iter,tol,'`trace`

')

`[b,a]`

creates
a complex filter. In this case no symmetry is enforced, and the frequency
is specified in radians between ` = `

invfreqs(h,w,'`complex`

',n,m,...)*–π* and *π*.

Convert a simple transfer function to frequency response data and then back to the original filter coefficients.

a = [1 2 3 2 1 4]; b = [1 2 3 2 3]; [h,w] = freqs(b,a,64); [bb,aa] = invfreqs(h,w,4,5)

bb = 1.0000 2.0000 3.0000 2.0000 3.0000 aa = 1.0000 2.0000 3.0000 2.0000 1.0000 4.0000

`bb`

and `aa`

are equivalent
to `b`

and `a`

, respectively. However, `aa`

has
poles in the right half-plane and thus the system is unstable. Use `invfreqs`

's
iterative algorithm to find a stable approximation to the system.

[bbb,aaa] = invfreqs(h,w,4,5,[],30)

bbb = 0.6816 2.1015 2.6694 0.9113 -0.1218 aaa = 1.0000 3.4676 7.4060 6.2102 2.5413 0.0001

You have two vectors, `mag`

and `phase`

,
that contain magnitude and phase data gathered in a laboratory, and
a third vector `w`

of frequencies. Convert the data
into a continuous-time transfer function using `invfreqs`

.

[b,a] = invfreqs(mag.*exp(j*phase),w,2,3);

[1] Levi, E. C. "Complex-Curve Fitting." *IRE
Trans. on Automatic Control*. Vol. AC-4, 1959, pp. 37–44.

[2] Dennis, J. E., Jr., and R. B. Schnabel. *Numerical
Methods for Unconstrained Optimization and Nonlinear Equations.*Englewood
Cliffs, NJ: Prentice-Hall, 1983.

Was this topic helpful?