equiripple

Equiripple single-rate or multirate FIR filter from specification object

Syntax

hd = design(d,'equiripple')
hd = design(d,'equiripple',designoption,value,designoption,
...value,...)

Description

hd = design(d,'equiripple') designs an equiripple FIR digital filter or multirate filter using the specifications supplied in the object d. Equiripple filter designs minimize the maximum ripple in the passbands and stopbands.

hd is either a dfilt object (a single-rate digital filter) or an mfilt object (a multirate digital filter) depending on the Specification property of the filter specification object d and the specifications object type — halfband or interpolator.

When you use equiripple with Nyquist filter specification objects, you might encounter design cases where the filter design does not converge. Convergence errors occur mostly at large filter orders, or small transition widths, or large stopband attenuations. These specifications, alone or combined, can cause design failures. For more information, refer to fdesign.nyquist in the online Help system.

hd = design(d,'equiripple',designoption,value,designoption,
...value,...)
returns an equiripple FIR filter where you specify design options as input arguments.

To determine the available design options, use designopts with the specification object and the design method as input arguments as shown.

designopts(d,'method')

For complete help about using equiripple, refer to the command line help system. For example, to get specific information about using equiripple with d, the specification object, enter the following at the MATLAB prompt.

help(d,'equiripple')

Examples

Here is an example of designing a single-rate equiripple filter from a halfband filter specification object. Notice the help command used to learn about the options for the specification object and method.

d = fdesign.halfband(tw,ast,0.1,80);
designmethods(d)

Design Methods for class fdesign.halfband (TW,Ast):

butter
ellip
iirlinphase
equiripple
kaiserwin

help(d,'equiripple')

DESIGN Design an equiripple FIR filter
HD = DESIGN(D, 'equiripple') designs an equiripple filter 
specified by the FDESIGN object D.
 
HD = DESIGN(..., 'FilterStructure', STRUCTURE) returns a filter 
with the structure STRUCTURE.  STRUCTURE is 'dffir' by default and 
can be any of the following:

    'dffir'
    'dffirt'
    'dfsymfir'
    'dfasymfir'
    'fftfir'

designopts(d,'equiripple')

ans = 

    FilterStructure: 'dffir'
           MinPhase: 0
      StopbandShape: 'flat'
      StopbandDecay: 0

hd = design(d,'equiripple','stopbandshape','flat');
fvtool(hd);

Displaying the filter in FVTool shows the equiripple nature of the filter.

equiripple also designs multirate filters. This example generates a halfband interpolator filter.

d = fdesign.interpolator(2); % Interpolation factor = 2.
hd = design(d,'equiripple');

hd
 
hd =
 
        FilterStructure: 'Direct-Form FIR Polyphase Interpolator'
             Arithmetic: 'double'                                
              Numerator: [1x95 double]                           
    InterpolationFactor: 2                                       
       PersistentMemory: false                                   

This final example designs an equiripple filter with a direct-form structure by specifying the filterstructure argument. To set the design options for the filter, use the designopts method and options object opts.

d = fdesign.lowpass('fp,fst,ap,ast');
designopts(d,'equiripple')

ans = 

    FilterStructure: 'dffir'
      DensityFactor: 16
           MinPhase: 0
           MinOrder: 'any'
      StopbandShape: 'flat'
      StopbandDecay: 0

opts=designopts(d,'equiripple')

opts = 

    FilterStructure: 'dffir'
      DensityFactor: 16
           MinPhase: 0
           MinOrder: 'any'
      StopbandShape: 'flat'
      StopbandDecay: 0

opts.FilterStructure='dffirt'

opts = 

    FilterStructure: 'dffirt'
      DensityFactor: 16
           MinPhase: 0
           MinOrder: 'any'
      StopbandShape: 'flat'
      StopbandDecay: 0

opts.MinPhase=1;

opts.DensityFactor=20;

opts = 

    FilterStructure: 'dffirt'
      DensityFactor: 20
           MinPhase: 1
           MinOrder: 'any'
      StopbandShape: 'flat'
      StopbandDecay: 0

hd=design(d,'equiripple',opts)
 
hd =
 
     FilterStructure: 'Direct-Form FIR Transposed'
          Arithmetic: 'double'                    
           Numerator: [1x37 double]               
    PersistentMemory: false                       

See Also

fdesign.nyquist, firls, kaiserwin

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS