Main Content

cheby2

Chebyshev Type II filter using specification object

Description

chebTwoFilter = cheby2(designSpecs,SystemObject=true) designs a type II Chebyshev IIR digital filter using specifications in the object designSpecs.

Depending on the filter specification object designSpecs, the cheby2 design method might not be valid. Use designmethods with the filter specification object to determine if a Chebyshev type II filter design is possible.

designmethods(designSpecs,SystemObject=true)

example

chebTwoFilter = cheby2(designSpecs,designoption=value,... SystemObject=true) returns a type II Chebyshev IIR digital filter with one or more specified designed options and the corresponding values.

To view a list of available design options, run the designoptions function on the specification object. The function also lists the default design options the filter uses.

designoptions(designSpecs,'cheby2')

chebTwoFilter = design(designSpecs,'cheby2',SystemObject=true) is an alternative syntax for designing the type II Chebyshev IIR digital filter.

For complete help about using the cheby2 design method for a specification object, designSpecs, enter the following at the MATLAB® command prompt.

help(designSpecs,'cheby2')

Examples

collapse all

Design a type II Chebyshev IIR filter with lowpass and highpass frequency responses. The filter design procedure is:

  1. Specify the filter design specifications using a fdesign function.

  2. Pick a design method provided by the designmethods function.

  3. To determine the available design options to choose from, use the designoptions function.

  4. Design the filter using the design function.

Lowpass Filter

Construct a default lowpass filter specification object using fdesign.lowpass.

designSpecs = fdesign.lowpass
designSpecs = 
  lowpass with properties:

               Response: 'Lowpass'
          Specification: 'Fp,Fst,Ap,Ast'
            Description: {4x1 cell}
    NormalizedFrequency: 1
                  Fpass: 0.4500
                  Fstop: 0.5500
                  Apass: 1
                  Astop: 60

Determine the available design methods using the designmethods function. To design a type II Chebyshev filter, pick cheby2.

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


butter
cheby1
cheby2
ellip
equiripple
ifir
kaiserwin
multistage

While designing the filter, you can specify additional design options. View a list of the options using the designoptions function. This function also shows the default design options the filter uses.

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

Use the design function to design the filter. Pass 'cheby2' and the specifications given by the variable designSpecs, as input arguments. Specify the 'matchexactly' design option to 'passband' to ensure the performance of the filter in the passband.

LowpassCheb2 = design(designSpecs,'cheby2',matchexactly='passband',...
    SystemObject=true)
LowpassCheb2 = 
  dsp.SOSFilter with properties:

            Structure: 'Direct form II'
    CoefficientSource: 'Property'
            Numerator: [5x3 double]
          Denominator: [5x3 double]
       HasScaleValues: true
          ScaleValues: [0.6953 0.5722 0.4687 0.3882 0.3426 1]

  Use get to show all properties

View the frequency response of the designed filter.

filterAnalyzer(LowpassCheb2)

Highpass Filter

Construct a highpass filter specification object using fdesign.highpass. Specify the filter order, stopband edge frequency, and the stopband attenuation to get the filter exactly as required.

designSpecs = fdesign.highpass('n,fst,ast',5,20,55,50);

Determine the available design methods. To design a type II Chebyshev IIR filter, pick cheby2.

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


cheby2

While designing the filter, you can specify additional design options. View a list of the options using the designoptions function. This function also shows the default design options the filter uses.

HighpassCheb2 = design(designSpecs,'cheby2',SystemObject=true)
HighpassCheb2 = 
  dsp.SOSFilter with properties:

            Structure: 'Direct form II'
    CoefficientSource: 'Property'
            Numerator: [3x3 double]
          Denominator: [3x3 double]
       HasScaleValues: true
          ScaleValues: [0.1995 0.0880 0.1450 1]

  Use get to show all properties

Visualize the highpass frequency response.

filterAnalyzer(HighpassCheb2)

By design, cheby2 returns filters that use second-order sections (SOS). For many applications, and for most fixed-point applications, SOS filters are particularly well-suited.

Input Arguments

collapse all

Filter specification object, specified as one of the following:

Output Arguments

collapse all

Type II Chebyshev IIR digital filter, returned as a filter System object. The System object and the values of its properties depend on the input designSpecs object and the other design options specified to the function.

Version History

Introduced in R2011a

expand all