fdesign.bandstop - Bandstop filter specification object

Syntax

d = fdesign.bandstop
d = fdesign.bandstop(spec)
d = fdesign.bandstop(spec,specvalue1,specvalue2,...)
d = fdesign.bandstop(specvalue1,specvalue2,specvalue3,specvalue4,...
specvalue5,specvalue6,specvalue7)
d = fdesign.bandstop(...,fs)
d = fdesign.bandstop(...,magunits)

Description

d = fdesign.bandstop constructs a bandstop filter specification object d, applying default values for the properties Fpass1, Fstop1, Fstop2, Fpass2, Apass1, Astop1 and Apass2.

Using fdesign.bandstop with a design method generates a dfilt object.

d = fdesign.bandstop(spec) constructs object d and sets its 'Specification' to spec. Entries in the spec string represent various filter response features, such as the filter order, that govern the filter design. Valid entries for spec are shown below. The strings are not case sensitive.

The string entries are defined as follows:

Graphically, the filter specifications look similar to those shown in the following figure.

Regions between specification values like fp1 and fst1 are transition regions where the filter response is not explicitly defined.

The filter design methods that apply to a bandstop filter specification object change depending on the Specification string. Use designmethods to determine which design method applies to an object and its specification string.

d = fdesign.bandstop(spec,specvalue1,specvalue2,...) constructs an object d and sets its specifications at construction time.

d = fdesign.bandstop(specvalue1,specvalue2,specvalue3,specvalue4,...
specvalue5,specvalue6,specvalue7)
constructs an object d with the default Specification property string fpass1,fstop1,fstop2,fpass2,apass1,astop,apass2, using the values you provide in specvalue1,specvalue2,specvalue3,specvalue4,specvalue5, specvalue6 and specvalue7.

d = fdesign.bandstop(...,fs) adds the argument fs, specified in Hz to define the sampling frequency to use. In this case, all frequencies in the specifications are in Hz as well.

d = fdesign.bandstop(...,magunits) specifies the units for any magnitude specification you provide in the input arguments. magunits can be one of

When you omit the magunits argument, fdesign assumes that all magnitudes are in decibels. Note that fdesign stores all magnitude specifications in decibels (converting to decibels when necessary) regardless of how you specify the magnitudes.

Examples

These examples show how to construct a bandpass filter specification object. First, create a default specifications object without using input arguments.

d = fdesign.bandstop
d =
 
               Response: 'Minimum-order bandstop'
            Description: {7x1 cell}
          Specification: 'Fp1,Fst1,Fst2,Fp2,Ap1,Ast,Ap2'
    NormalizedFrequency: true
                 Fpass1: 0.3500
                 Fstop1: 0.4500
                 Fstop2: 0.5500
                 Fpass2: 0.6500
                 Apass1: 1
                  Astop: 60
                 Apass2: 1

Now create an object by passing a specification type string 'n,fc1,fc2' — the resulting object uses default values for n, fc1, and fc2.

d=fdesign.bandstop('n,f3dB1,f3dB2')
 
d =
 
               Response: 'Bandstop with cutoff'
          Specification: 'N,F3dB1,F3dB2'
            Description: {3x1 cell}
    NormalizedFrequency: true
            FilterOrder: 10
               Fcutoff1: 0.4000
               Fcutoff2: 0.6000

designmethods(d)

Design Methods for class fdesign.bandstop:

butter
cheby1
cheby2
ellip

Create another bandstop filter, passing the specification values to the object rather than accepting the default values for n, f3db1, and fc2. You can add fs as the final input argument to specify the sampling frequency of 48 kHz.

d = fdesign.bandstop('n,f3db1,f3db2', 10, 9600, ...
  14400, 48000)
 
d =
 
               Response: 'Bandstop with cutoff'
          Specification: 'N,F3dB1,F3dB2'
            Description: {3x1 cell}
    NormalizedFrequency: false
                     Fs: 48000
            FilterOrder: 10
               Fcutoff1: 9600
               Fcutoff2: 14400

For this bandstop filter, pass the filter specifications that correspond to the default Specificationfp1,fst1,fst2,fp2,ap1,ast,ap2.

d = fdesign.bandstop(0.3,0.4,0.6,0.7,0.5,60,1)
 
d =
 
               Response: 'Minimum-order bandstop'
          Specification: 'Fp1,Fst1,Fst2,Fp2,Ap1,Ast,Ap2'
            Description: {7x1 cell}
    NormalizedFrequency: true
                 Fpass1: 0.3000
                 Fstop1: 0.4000
                 Fstop2: 0.6000
                 Fpass2: 0.7000
                 Apass1: 0.5000
                  Astop: 60
                 Apass2: 1

And for the final example, pass the magnitude specifications in squared units, using the magunits option squared.

d = fdesign.bandstop(0.4,0.5,0.6,0.7,0.98,...
0.01,0.99,'squared')
d =
 
               Response: 'Minimum-order bandstop'
          Specification: 'Fp1,Fst1,Fst2,Fp2,Ap1,Ast,Ap2'
            Description: {7x1 cell}
    NormalizedFrequency: true
                 Fpass1: 0.4000
                 Fstop1: 0.5000
                 Fstop2: 0.6000
                 Fpass2: 0.7000
                 Apass1: 0.0877
                  Astop: 20
                 Apass2: 0.0436

See Also

fdesign, fdesign.bandpass, fdesign.highpass, fdesign.lowpass

  


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