fdesign.bandpass - Bandpass filter specification object

Syntax

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

Description

d = fdesign.bandpass constructs a bandpass filter specification object d, applying default values for the properties Fstop1, Fpass1, Fpass2, Fstop2, Astop1, Apass, and Astop2 — one possible set of values you use to specify a bandpass filter.

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

d = fdesign.bandpass(spec) constructs object d and sets its Specification property 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 and used to define the bandpass filter. 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 fst1 and fp1 are transition regions where the filter response is not explicitly defined.

The filter design methods that apply to a bandpass 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.bandpass(spec,specvalue1,specvalue2,...) constructs an object d and sets its specifications at construction time.

d = fdesign.bandpass(specvalue1,specvalue2,specvalue3,
specvalue4,...specvalue4,specvalue5,specvalue6)
constructs d, an object with the default Specification property string, using the values you provide as input arguments for specvalue1,specvalue2,specvalue3,specvalue4,specvalue4,specvalue5, specvalue6 and specvalue7.

d = fdesign.bandpass(...,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.bandpass(...,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.bandpass
d =
 
               Response: 'Minimum-order bandpass'
          Specification: 'Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2'
            Description: {7x1 cell}
    NormalizedFrequency: true
                 Fstop1: 0.3500
                 Fpass1: 0.4500
                 Fpass2: 0.5500
                 Fstop2: 0.6500
                 Astop1: 60
                  Apass: 1
                 Astop2: 60

Now, pass the filter specifications that correspond to the default Specificationfst1,fp1,fp2,fst2,ast1,ap,ast2 — without specifying the Specification string. This example adds fs as the final input argument to specify the sampling frequency of 48 Hz.

d = fdesign.bandpass(10, 12, 14, 16, 80, .5, 60, 48)
d =
 
               Response: 'Minimum-order bandpass'
          Specification: 'Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2'
            Description: {7x1 cell}
    NormalizedFrequency: false
                     Fs: 48
                 Fstop1: 10
                 Fpass1: 12
                 Fpass2: 14
                 Fstop2: 16
                 Astop1: 80
                  Apass: 0.5000
						  Astop2: 60

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

d = fdesign.bandpass('n,fc1,fc2')
d =
 
               Response: 'Bandpass with cutoff'
          Specification: 'N,Fc1,Fc2'
            Description: {3x1 cell}
    NormalizedFrequency: true
            FilterOrder: 10
               Fcutoff1: 0.4000
               Fcutoff2: 0.6000

Create the same filter, passing the specification values to the object rather than accepting the default values for n, fc1, and fc2. You can include the sampling frequency fs as the final input argument, and that you specify the cutoff frequencies in Hz since fs is in Hz.

d = fdesign.bandpass('n,fc1,fc2', 10, 9600, 14400, 48000)
d =
 
               Response: 'Bandpass with cutoff'
          Specification: 'N,Fc1,Fc2'
            Description: {3x1 cell}
    NormalizedFrequency: false
                     Fs: 48000
            FilterOrder: 10
               Fcutoff1: 9600
               Fcutoff2: 14400

See Also

fdesign, fdesign.bandstop, fdesign.highpass, fdesign.lowpass

  


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