主要内容

ellip

使用设定对象的椭圆滤波器

说明

ellipFilter = ellip(designSpecs,SystemObject=true) 使用对象 designSpecs 中的设定设计椭圆 IIR 数字滤波器。

根据滤波器设定对象 designSpecsellip 设计方法可能无效。将 designmethods 与滤波器设定对象结合使用,以确定某椭圆 IIR 滤波器设计是否可行。

designmethods(designSpecs,SystemObject=true)

示例

ellipFilter = ellip(designSpecs,designoption=value,... SystemObject=true) 返回具有一个或多个指定设计选项及其对应值的椭圆 IIR 数字滤波器。

要查看可用设计选项的列表,请对设定对象运行 designoptions 函数。该函数还会列出滤波器使用的默认设计选项。

designoptions(designSpecs,'ellip')

示例

ellipFilter = design(designSpecs,'ellip',SystemObject=true) 是设计椭圆 IIR 数字滤波器的备选语法。

有关对设定对象 designSpecs 使用 ellip 设计方法的完整帮助,请在 MATLAB® 命令提示符下输入以下命令。

help(designSpecs,'ellip')

示例

全部折叠

设计一个具有带通频率响应的椭圆数字滤波器。滤波器设计过程如下:

  1. 使用 fdesign 函数指定滤波器设计设定。

  2. 选取 designmethods 函数提供的一种设计方法。

  3. 要确定可选的设计选项,请使用 designoptions 函数。

  4. 使用 design 函数设计滤波器。

使用 fdesign.bandpass 构造默认带通滤波器设定对象。

designSpecs = fdesign.bandpass
designSpecs = 
  bandpass with properties:

               Response: 'Bandpass'
          Specification: 'Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2'
            Description: {7×1 cell}
    NormalizedFrequency: 1
                 Fstop1: 0.3500
                 Fpass1: 0.4500
                 Fpass2: 0.5500
                 Fstop2: 0.6500
                 Astop1: 60
                  Apass: 1
                 Astop2: 60

使用 designmethods 函数确定可用的设计方法。要设计椭圆数字滤波器,请选择 ellip

designmethods(designSpecs,SystemObject=true)
Design Methods that support System objects for class fdesign.bandpass (Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2):


butter
cheby1
cheby2
ellip
equiripple
kaiserwin

在设计滤波器时,您可以指定其他设计选项。使用 designoptions 函数查看选项列表。此函数还会显示滤波器使用的默认设计选项。

designoptions(designSpecs,'ellip',SystemObject=true)
ans = struct with fields:
           FilterStructure: {'df1sos'  'df2sos'  'df1tsos'  'df2tsos'  'cascadeallpass'  'cascadewdfallpass'}
              SOSScaleNorm: 'ustring'
              SOSScaleOpts: 'fdopts.sosscaling'
              MatchExactly: {'passband'  'stopband'  'both'}
    DefaultFilterStructure: 'df2sos'
       DefaultMatchExactly: 'both'
       DefaultSOSScaleNorm: ''
       DefaultSOSScaleOpts: [1×1 fdopts.sosscaling]

使用 design 函数设计滤波器。将 'ellip' 和变量 designSpecs 给定的设定作为输入参量传递。将 'matchexactly' 设计选项指定为 'both' 以确保滤波器在通带和阻带区域的性能。

bandpassEllip = design(designSpecs,'ellip',matchexactly='both',...
    SystemObject=true)
bandpassEllip = 
  dsp.SOSFilter with properties:

            Structure: 'Direct form II'
    CoefficientSource: 'Property'
            Numerator: [4×3 double]
          Denominator: [4×3 double]
       HasScaleValues: true
          ScaleValues: [0.4705 0.4705 0.0936 0.0936 1]

  Show all properties

查看所设计滤波器的频率响应。

freqz(bandpassEllip)

Figure contains 2 axes objects. Axes object 1 with title Phase, xlabel Normalized Frequency (\times\pi rad/sample), ylabel Phase (degrees) contains an object of type line. Axes object 2 with title Magnitude, xlabel Normalized Frequency (\times\pi rad/sample), ylabel Magnitude (dB) contains an object of type line.

设计一个具有低通频率响应的椭圆数字滤波器。

使用 fdesign.lowpass 构造一个低通滤波器设定对象。指定滤波器的阶数、通带边缘频率、阻带边缘频率和通带波纹。

designSpecs = fdesign.lowpass('n,fp,fst,ap',6,20,25,.8,80);

确定可用的设计方法。要设计椭圆滤波器,请选择 ellip

designmethods(designSpecs,SystemObject=true)
Design Methods that support System objects for class fdesign.lowpass (N,Fp,Fst,Ap):


ellip
equiripple

使用 design 函数设计滤波器。将 'ellip' 和变量 designSpecs 给定的设定作为输入参量传递。

ellipLowpass = design(designSpecs,'ellip',SystemObject=true)
ellipLowpass = 
  dsp.SOSFilter with properties:

            Structure: 'Direct form II'
    CoefficientSource: 'Property'
            Numerator: [3×3 double]
          Denominator: [3×3 double]
       HasScaleValues: true
          ScaleValues: [0.0968 0.4116 0.6792 1]

  Show all properties

可视化低通频率响应。

filterAnalyzer(ellipLowpass)

输入参数

输出参量

全部折叠

椭圆数字滤波器,以滤波器 System object 形式返回。System object 及其属性值取决于输入 designSpecs 对象及为函数指定的其他设计选项。

版本历史记录

在 R2011a 中推出

全部展开