invfreqzd (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info Download Help (Windows Only)

Owning Class: modeling and prediction

Requires: MathScript RT Module

Syntax

[b, a] = invfreqzd(h, w, nb, na)

[b, a] = invfreqzd(h, w, nb, na, wf)

[b, a] = invfreqzd(h, w, nb, na, wf, maxiter)

[b, a] = invfreqzd(h, w, nb, na, wf, maxiter, tol)

[b, a] = invfreqzd(h, w, nb, na, wf, maxiter, tol, 'trace')

[b, a] = invfreqzd(h, w, 'complex', nb, na)

[b, a] = invfreqzd(h, w, 'complex', nb, na, wf)

[b, a] = invfreqzd(h, w, 'complex', nb, na, wf, maxiter)

[b, a] = invfreqzd(h, w, 'complex', nb, na, wf, maxiter, tol)

[b, a] = invfreqzd(h, w, 'complex', nb, na, wf, maxiter, tol, 'trace')

Legacy Name: invfreqz

Description

Computes a digital filter where the least squared fits to the frequency response data. If you do not specify maxiter, tol, and 'trace', invfreqzd computes the filter that minimizes sum|b-h*a|^2*wf. Otherwise, invfreqzd uses the Gauss-Newton method to compute the filter that minimizes sum|b/a-h|^2*wf.

Examples

Inputs

Name Description
h Specifies the desired complex frequency response.
w Specifies the normalized frequency points in radians/sample. If you do not specify 'complex', invfreqzd computes a filter with real coefficients. All elements of w must fall in the range [0, pi]. length(w) must equal length(h).
'complex' Computes a filter with complex coefficients.
nb Specifies the order of the numerator.
na Specifies the order of the denominator.
wf Specifies the weight at each frequency point. wf can be an empty array or an array of the same length as h. All elements of wf must be larger than 0. The default is ones(1, length(h)). length(wf) must equal length(w).
maxiter Specifies the maximum number of iterations in the Gauss-Newton method. The default is 30.
tol Specifies the tolerance of the norm of gradient. The default is 0.01.
'trace' Generates a textual progress report of each iteration.

Outputs

Name Description
b Returns the numerator coefficients.
a Returns the denominator coefficients. The first element of a is 1 .

Details

The following table lists the support characteristics of this function.

 Supported in the LabVIEW Run-Time Engine Yes Supported on RT targets Yes Suitable for bounded execution times on RT No (affects entire script)

Examples

w = 0:0.1:pi;
l = length(w);
g = ones(1, l);
g(1:l/2) = 0;
na = 2;
nb = 2;
wf = ones(1, l);
maxiter = 20;
tol = 1e-5;
[b, a] = invfreqzd(g, w, nb, na, wf, maxiter, tol)