invfreqsd (MathScript RT Module Function)

LabVIEW 2012 MathScript RT模块帮助

»查看产品信息 下载帮助（仅限Windows）

Owning Class: modeling and prediction

Requires: MathScript RT Module

Syntax

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

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

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

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

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

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

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

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

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

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

Legacy Name: invfreqs

Description

Computes an analog filter where the least squared fits to the frequency response data. If you do not specify maxiter, tol, and 'trace', invfreqsd computes the filter that minimizes sum|b-h*a|^2*wf. Otherwise, invfreqsd 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', invfreqsd computes a filter with real coefficients. All elements of w must be positive. 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 in 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] = invfreqsd(g, w, nb, na, wf, maxiter, tol, 'trace')

﻿