主要内容

设计

将设计方法应用于过滤规范对象

描述

菲尔特= design(Designspecs,“ SystemObject”,true)uses the filter specification object,Designspecs,为了生成过滤系统对象™,菲尔特。当您不提供设计方法作为输入参数时,设计uses the default design method. UseDesignMethods(DesignSpecs,'default')to see the default design method for your filter design specification object. For more information on filter design specifications, see在FDesign中设计过滤器 - 过程概述

菲尔特= design(Designspecs,方法,“ SystemObject”,true)uses the design method specified by方法方法必须是返回的选项之一设计方法s

example

菲尔特= design(Designspecs,方法,PARAM,VALUE,...,'Systemobject',true)指定设计方法选项。利用DesignOptions(DesignSpecs,方法)要查看可供选择的可用设计方法选项的列表。有关这些选项的详细帮助,请键入帮助(DesignSpecs,方法)在matlab中®命令提示符。

菲尔特= design(Designspecs,方法,opts,“ SystemObject”,true)使用结构指定设计方法选项optsopts通常是从设计optsfunction and then specified as an input to the设计功能。利用帮助(DesignSpecs,方法)有关可选输入的更多信息。

例子

全部收缩

Design an FIR equiripple lowpass filter. Specify a passband edge frequency of 0.2π rad/sample and a stopband edge frequency of 0.25π rad/sample. Set the passband ripple to 0.5 dB and the stopband attenuation to 40 dB..

designspecs = fdesign.lowpass('fp,fst,ap,ast',0.2,0.25,0.5,40)
designspecs =属性属性:响应:'lowpass'规范:'fp,fst,ap,ast'描述:{4x1 cell}归一化频率:1 fpass:0.2000 fstop:0.2500 apass:0.5000 astop:0.5000 astop:40

使用默认的equiripple方法设计过滤器。

菲尔特= design(designSpecs,“系统对象”,true)
菲尔特= dsp.FIRFilter with properties: Structure: 'Direct form' NumeratorSource: 'Property' Numerator: [-0.0057 -0.0010 0.0010 0.0040 0.0065 0.0073 ... ] InitialConditions: 0 Show all properties

Determine the available design methods by running the设计方法s在过滤器设计规范对象上的功能,Designspecs

DesignMethods(DesignSpecs,“系统对象”,true)
支持系统对象的设计方法fdesign.l万博1manbetxowpass(FP,FST,AP,AST):Butter Cheby1 Cheby2 Ellip Equiripple ifir ifir ifir kaiserwin多阶段

您还可以指定设计过滤器中使用的设计选项。要查看可用选项的列表,请运行DesignOptions运行Designspecs

DesignOptions(DesignSpecs,'equiripple')
ans =带有字段的结构:FilterStructure: {'dffir' 'dffirt' 'dfsymfir' 'fftfir'} DensityFactor: 'double' MinPhase: 'bool' MaxPhase: 'bool' MinOrder: {'any' 'even' 'odd'} StopbandShape: {'flat''linear' '1/f'} StopbandDecay: 'double' UniformGrid: 'bool' SystemObject: 'bool' DefaultFilterStructure: 'dffir' DefaultDensityFactor: 16 DefaultMaxPhase: 0 DefaultMinOrder: 'any' DefaultMinPhase: 0 DefaultStopbandDecay: 0 DefaultStopbandShape: 'flat'DefaultSystemObject:0 DefaultuniformGrid:1

通过设置设计最小相相的FIR Equiripple滤波器“ min相”to真的

filtmin = Design(DesignSpecs,'equiripple',“ min相”,true,“系统对象”,true)
filtmin = dsp.Firfilter具有属性:结构:'直接形式'NumeratorSource:'属性'分子:[0.0163 0.0381 0.0724 0.1144 0.1144 0.1562 0.1875 0.1981 ...]

显示默认和最小相设计的极点零图。

fvt = fvtool(filt,filtmin,'分析',“极点”);传奇(fvt,“默认设计”,“最小相设计”)

图极零图包含轴对象。带有标题极点图的轴对象包含6个类型行的对象,文本。这些对象代表默认设计:零,默认设计:极点,最小相设计:零,最小阶段设计:极点。

Redesign the filter using the elliptic method. Determine the available design options for the elliptic method.

DesignOptions(DesignSpecs,“椭圆”)
ans =带有字段的结构:FilterStructure: {1x6 cell} SOSScaleNorm: 'ustring' SOSScaleOpts: 'fdopts.sosscaling' MatchExactly: {'passband' 'stopband' 'both'} SystemObject: 'bool' DefaultFilterStructure: 'df2sos' DefaultMatchExactly: 'both' DefaultSOSScaleNorm: '' DefaultSOSScaleOpts: [1x1 fdopts.sosscaling] DefaultSystemObject: 0

通过设置完全匹配通带“匹配”to'passband'

菲尔特= design(designSpecs,“椭圆”,“匹配”,'passband',“系统对象”,true)
菲尔特= dsp.BiquadFilter with properties: Structure: 'Direct form II' SOSMatrixSource: 'Property' SOSMatrix: [3x6 double] ScaleValues: [4x1 double] InitialConditions: 0 OptimizeUnityScaleValues: true Show all properties

您可以在二阶部分上指定PTH规范缩放。在时域中使用L-内范围标准。

filtl = Design(Designspecs,“椭圆”,“匹配”,'passband','sosscalenorm','linf',。。。“系统对象”,true)
菲尔特L = dsp.BiquadFilter with properties: Structure: 'Direct form II' SOSMatrixSource: 'Property' SOSMatrix: [3x6 double] ScaleValues: [4x1 double] InitialConditions: 0 OptimizeUnityScaleValues: true Show all properties

Display the frequency responses of the filters.

fvt = fvtool(filt,filtl);传奇(fvt,“默认缩放”,“ l-Infinity Norm缩放”)

图量响应(DB)包含一个轴对象。带有标题幅度响应(DB)的轴对象包含3个类型线的对象。这些对象代表默认缩放,L- infinity norm缩放。

输入参数

全部收缩

fdesignreturns a filter design specification object. Every filter design specification object has these properties.

Property Name

Default Value

描述

回复

取决于所选类型

定义要设计的过滤器类型,例如插装器或带通滤波器。这是一个只读的价值。

规格

取决于所选类型

定义用于定义所需过滤性能的过滤特性,例如截止频率FC或过滤器订单N

描述

Depends on the filter type you choose

Contains descriptions of the filter specifications used to define the object, and the filter specifications you use when you create a filter from the object. This is a read-only value.

NormalizedFrequency

Logical真的

Determines whether the filter calculation uses a normalized frequency from 0 to 1, or the frequency band from 0 toFs/2,采样频率。接受真的或者错误的没有单引号。音频加权过滤器不支持归一化频率。万博1manbetx

In addition to these properties, filter design specification objects may have other properties as well, depending on whether they design single-rate filters or multirate filters.

Added Properties for Multirate Filters

描述

分解器

指定decrease the sampling rate. Always a positive integer.

插际反应器

指定增加采样率的金额。总是一个积极的整数。

多重强度

多相度长度是组成插图器或插值器或速率变化因子过滤器的每个多相子滤光器的长度。总过滤长度是pl以及速率变化因素。pl必须是一个整数。

设计方法,指定为字符向量。您提供的设计方法作为输入参数必须是返回的方法之一:

DesignMethods(DesignSpecs,“系统对象”,true)

该表列出了所有设计方法。根据过滤器设计规范对象,这些子集可用Designspecs

设计方法s

描述

牛油

Butterworth过滤器

cheby1

Chebyshev I型过滤器

cheby2

Chebyshev II型过滤器

椭圆

椭圆滤波器

equiripple

Equiripple FIR滤波器

firls

最小二乘线性相位FIR滤波器

Freqsamp

频率采样的FIR过滤器

ifir

Interpolated FIR filter

iirlinphase

准线性相IIR过滤器

iirrpnorm

Least P-norm optimal IIR filter

艾尔斯

最小二乘IIR过滤器

fircls

FIR constrained least squares filter

kaiserwin

Kaiser窗口过滤器

maxflat

maxflat Fir滤波器

多阶段

Multistage filter

窗户

使用窗口脉冲响应的FIR过滤器

To help you design filters more quickly, the input argument方法accepts a variety of special keywords that force设计to behave in different ways. This table presents the keywords you can use for方法and how设计responds to the keyword:

设计方法关键字

描述of the Design Response

'冷杉'

军队设计生产FIR过滤器。当对象存在FIR设计方法时d,设计返回错误。

'iir'

军队设计生产IIR过滤器。当对象存在IIR设计方法时d,设计返回错误。

'allfir'

从每种适用的FIR设计方法中生成过滤器,用于d, one filter for each design method. As a result,设计在输出对象中返回多个过滤器。

'alliir'

从每种适用的IIR设计方法中生成过滤器d, one filter for each design method. As a result,设计在输出对象中返回多个过滤器。

'全部'

Designs filters using all applicable design methods for the specifications objectd。因此,设计返回多个过滤器,每种设计方法一个。设计按顺序使用设计方法设计方法s(D,'Systemobject',true)returns them.

关键字不敏感。

什么时候设计返回输出对象中的多个过滤器,使用索引查看单个过滤器。例如,查看第三个过滤器菲尔特, 进入:

菲尔特(3)

例子:filt = design(designspecs,'butter','systemObject',true)

例子:菲尔特= design(designSpecs,'ALLFIR','SystemObject',true)

通过通过opts结构作为输入设计功能。这opts结构是通过运行获得的设计opts(designSpecs,method)

designspecs = fdesign.notch opts = DesignOpts(DesignSpecs,'牛油') opts.FilterStructure ='df1sos'菲尔特= design(designSpecs,'牛油',opts,“系统对象”,true)

Version History

Introduced in R2009a