main content

equiripple single-凯发k8网页登录

equiripple single-rate fir filter from specification object

syntax

equifilt = design(d,'equiripple','systemobject',true)
equifilt = design(d,'equiripple',designoption,value,...,'systemobject',true)

description

equifilt = design(d,'equiripple','systemobject',true) designs an equiripple fir digital filter using the specifications supplied in the object d. equiripple filter designs minimize the maximum ripple in the passbands and stopbands.

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 in the online help system.

equifilt = design(d,'equiripple',designoption,value,...,'systemobject',true) returns an equiripple fir filter where you specify design options as input arguments.

to determine the available design options, use 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

design 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,'systemobject',true)
design methods that support system objects for class fdesign.halfband (tw,ast):
butter
ellip
iirlinphase
equiripple
kaiserwin
help(d,'equiripple')
 design design a equiripple fir filter.
    hd = design(d, 'equiripple') designs a equiripple filter specified by the
    fdesign object d, and returns the dfilt/mfilt object hd.
 
    hd = design(d, ..., 'systemobject', true) implements the filter, hd,
    using a system object instead of a dfilt/mfilt object.
 
    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'
    'fftfir'
 
    some of the listed structures may not be supported by system object
    filters. type validstructures(d, 'equiripple', 'systemobject', true) to
    get a list of structures supported by system objects.
 
    hd = design(..., 'minphase', mphase) designs a minimum-phase filter
    when mphase is true.  mphase is false by default.
 
    hd = design(..., 'stopbandshape', shape) designs a filter whose stopband
    has the shape defined by shape.  shape can be 'flat', '1/f', or 'linear'.
    shape is 'flat' by default.
    hd = design(..., 'stopbanddecay', decay) specifies the decay to use when
    'stopbandshape' is not set to 'flat'.  when the shape is '1/f' this
    specifies the power that 1/f is raised.  when shaped is 'linear' this
    specifies the slope of the stopband in db/rad/s.
 
    % example #1 - design a halfband lowpass equiripple filter with increased stopband attenuation.
       tw = 0.1; % transition width
       ast = 80; % stopband attenuation (db)
       h  = fdesign.halfband('type','lowpass','tw,ast',tw,ast);
       hd = design(h, 'equiripple', 'stopbandshape','linear','stopbanddecay',50);
       fvtool(hd)
 
designopts(d,'equiripple')
ans = struct with fields:
    filterstructure: 'dffir'
           minphase: 0
      stopbandshape: 'flat'
      stopbanddecay: 0
       systemobject: 0
equifilt = design(d,'equiripple','stopbandshape','flat','systemobject',true);
fvtool(equifilt);

figure figure 1: magnitude response (db) contains an axes object. the axes object with title magnitude response (db), xlabel normalized frequency ( times pi blank r a d / s a m p l e ), ylabel magnitude (db) contains 2 objects of type line.

the fvtool shows the equiripple nature of the filter.

this example designs an equiripple filter with a direct-form transposed 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');
opts = designopts(d,'equiripple');
opts.filterstructure='dffirt';
opts.densityfactor=20
opts = struct with fields:
    filterstructure: 'dffirt'
      densityfactor: 20
           minphase: 0
           maxphase: 0
           minorder: 'any'
      stopbandshape: 'flat'
      stopbanddecay: 0
        uniformgrid: 1
       systemobject: 0
firfilt = design(d,'equiripple','systemobject',true,opts)
firfilt = 
  dsp.firfilter with properties:
            structure: 'direct form transposed'
      numeratorsource: 'property'
            numerator: [-0.0024 -0.0021 0.0068 0.0167 0.0111 -0.0062 -0.0084 0.0093 0.0130 -0.0101 -0.0183 0.0114 0.0262 -0.0125 -0.0380 0.0134 0.0581 -0.0141 -0.1027 0.0145 0.3172 0.4854 0.3172 0.0145 -0.1027 -0.0141 0.0581 0.0134 -0.0380 -0.0125 ... ]
    initialconditions: 0
  show all properties
fvtool(firfilt);

figure figure 1: magnitude response (db) contains an axes object. the axes object with title magnitude response (db), xlabel normalized frequency ( times pi blank r a d / s a m p l e ), ylabel magnitude (db) contains 2 objects of type line.

the maxphase design option for equripple fir filters is currently only available for lowpass, highpass, bandpass, and bandstop filters.

version history

introduced in r2011a

see also

functions

  • | |
网站地图