MATLAB 帮助中心
本页翻译不是最新的。点击此处可查看最新英文版本。
估计实现滤波器 System object 的成本
c = cost(sysobj)
c = cost(sysobj,Arithmetic=arithType)
c = cost(sysobj) 返回结构体 c,其字段包含有关实现滤波器 System object™ sysobj 的计算成本的信息。
c
sysobj
示例
c = cost(sysobj,Arithmetic=arithType) 返回在由 arithType 指定的算术中滤波器 System object sysobj 的成本估算 c。
arithType
全部折叠
此示例说明如何计算使用 dsp.FIRFilter 对象创建的 FIR 滤波器的实现成本。
dsp.FIRFilter
Fs = 8000; Fcutoff = 2000; firFilt = dsp.FIRFilter('Numerator',designLowpassFIR(FilterOrder=130,CutoffFrequency=Fcutoff/(Fs/2))); cost(firFilt)
ans = struct with fields: NumCoefficients: 131 NumStates: 130 MultiplicationsPerInputSample: 131 AdditionsPerInputSample: 130
输入滤波器,指定为以下滤波器 System object 之一:
dsp.AllpassFilter
dsp.AllpoleFilter
dsp.CICCompensationDecimator
dsp.CICCompensationInterpolator
dsp.CICDecimator
dsp.CICInterpolator
dsp.CoupledAllpassFilter
dsp.Delay
dsp.Differentiator
dsp.FarrowRateConverter
dsp.FilterCascade
dsp.FIRDecimator
dsp.FIRHalfbandDecimator
dsp.FIRHalfbandInterpolator
dsp.FIRInterpolator
dsp.FIRRateConverter
dsp.FourthOrderSectionFilter
dsp.HighpassFilter
dsp.IIRFilter
dsp.IIRHalfbandDecimator
dsp.IIRHalfbandInterpolator
dsp.LowpassFilter
dsp.NotchPeakFilter
dsp.ParallelFilter
dsp.SOSFilter
dsp.VariableBandwidthFIRFilter
dsp.VariableBandwidthIIRFilter
dsp.VariableFIRDecimator
dsp.VariableFIRInterpolator
'double'
'single'
'Fixed'
滤波器分析中使用的算术,指定为 'double'、'single' 或 'Fixed'。当未指定算术输入且滤波器 System object 未锁定时,分析工具假定为双精度滤波器。当未指定算术输入且 System object 锁定时,该函数基于锁定输入的数据类型执行分析。
'Fixed' 值仅适用于具有定点属性的滤波器 System object。
当 'Arithmetic' 输入参量指定为 'Fixed' 且滤波器对象的系数数据类型设置为 'Same word length as input' 时,算术分析取决于 System object 是未锁定还是锁定。
'Arithmetic'
'Same word length as input'
未锁定 - 分析对象函数无法确定系数数据类型。该函数假定系数数据类型为有符号,具有 16 位字长,并且是自动定标的。该函数基于此假设执行定点分析。
锁定 - 当输入数据类型为 'double' 或 'single' 时,分析对象函数无法确定系数数据类型。该函数假定系数的数据类型为有符号,具有 16 位字长,并且是自动定标的。该函数基于此假设执行定点分析。
要检查 System object 是锁定还是未锁定,请使用 isLocked 函数。
isLocked
当算术输入指定为 'Fixed' 且滤波器对象的系数数据类型设置为自定义数值类型时,对象函数基于自定义数值数据类型执行定点分析。
struct
成本估算 c 包含以下字段:
估计值
描述
NumCoefficients
滤波器系数数目(不包括值为 0、1 或 -1 的系数)
NumStates
滤波器状态的数目
MultiplicationsPerInputSample
针对每个输入采样执行的乘法运算次数
AdditionsPerInputSample
针对每个输入采样执行的加法运算次数
全部展开
从 R2024b 开始,cost 分析函数支持 dsp.VariableFIRDecimator 和 dsp.VariableFIRInterpolator 对象。
cost
dsp.BiquadFilter
dsp.BiquadFilter 对象在使用时会发出警告,并将在以后的版本中删除。请改用 dsp.SOSFilter 对象。有关如何替换现有代码的信息,请参阅 dsp.BiquadFilter 参考页中的兼容性注意事项部分。
从 R2023b 开始,cost 分析函数支持 dsp.ParallelFilter 和 dsp.Delay 对象。
dsp.BiquadFilter 对象将在以后的版本中删除。请改用 dsp.SOSFilter 对象。
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处