Documentation

fircls

Constrained-least-squares FIR multiband filter design

Syntax

b = fircls(n,f,amp,up,lo)
fircls(n,f,amp,up,lo,'design_flag')

Description

b = fircls(n,f,amp,up,lo)generates a lengthn+1linear phase FIR filterb。The frequency-magnitude characteristics of this filter match those given by vectorsf放大器:

  • fis a vector of transition frequencies in the range from 0 to 1, where 1 corresponds to the Nyquist frequency. The first point off一定是0最后一点1。The frequency points must be in increasing order.

  • 放大器is a vector describing the piecewise-constant desired amplitude of the frequency response. The length of放大器等于响应中的频段数,应等于length(f)-1

  • upLO是与相同长度的向量放大器。They define the upper and lower bounds for the frequency response in each band.

fircls总是使用an even filter order for configurations with a passband at the Nyquist frequency (that is, highpass and bandstop filters). This is because for odd orders, the frequency response at the Nyquist frequency is necessarily 0. If you specify an odd-valuedn,firclsincrements it by 1.

fircls(n,f,amp,up,lo,'design_flag')enables you to monitor the filter design, where'design_flag'can be

  • 'trace', for a textual display of the design error at each iteration step.

  • “绘图”对于显示滤波器的全带幅度响应的集合,以及每个子带中幅度响应的变焦视图。每个迭代步骤都会更新所有图。图上的O是新迭代的估计极端,X是上一个迭代的估计极端,其中极端是滤波器的峰值(最大值和最小值)。只有具有相应O和X的涟漪是相等的。

  • 'both', for both the textual display and plots.

Note

通常,停止带中的较低值将指定为负值。通过设置LOequal to0在挡块中,可以获得非负频率响应幅度。可以在光谱上考虑此类过滤器以获得最小相滤波器。

Examples

collapse all

Design a 150th-order lowpass filter with a normalized cutoff frequency of 0 4 π rad/sample. Specify a maximum absolute error of 0.02 in the passband and 0.01 in the stopband. Display plots of the bands.

n = 150; f = [0 0.4 1]; a = [1 0]; up = [1.02 0.01]; lo = [0.98 -0.01]; b = fircls(n,f,a,up,lo,'both');
Bound Violation = 0.0788344298966
Bound Violation = 0.0096137744998
Bound Violation = 0.0005681345753
Bound Violation = 0.0000051519942
Bound Violation = 0.0000000348656

Bound Violation = 0.0000000006231

The Bound Violations denote the iterations of the procedure as the design converges. Display the magnitude response of the filter.

fvtool(b)

Algorithms

firclsuses an iterative least-squares algorithm to obtain an equiripple response. The algorithm is a multiple exchange algorithm that uses Lagrange multipliers and Kuhn-Tucker conditions on each iteration.

参考

[1] Selesnick, I. W., M. Lang, and C. S. Burrus. “Constrained Least Square Design of FIR Filters without Specified Transition Bands.”Proceedings of the 1995 International Conference on Acoustics, Speech, and Signal Processing.卷。2, 1995, pp. 1260–1263.

[2] Selesnick, I. W., M. Lang, and C. S. Burrus. “Constrained Least Square Design of FIR Filters without Specified Transition Bands.”IEEE®信号处理的交易。卷。44,第8期,1996年,第1879–1892页。

Extended Capabilities

See Also

||

在R2006a之前引入