| Filter Design Toolbox™ | ![]() |
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)
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.
fst1,fp1,fp2,fst2,ast1,ap,ast2 (default spec)
n,f3dB1,f3dB2
n,f3dB1,f3dB2,ap
n,f3dB1,f3dB2,ast
n,f3dB1,f3dB2,ast1,ap,ast2
n,f3dB1,f3dB2,bwp
n,f3dB1,f3dB2,bwst
n,fc1,fc2
n,fp1,fp2,ap
n,fp1,fp2,ast1,ap,ast2
n,fst1,fp1,fp2,fst2
n,fst1,fp1,fp2,fst2,ap
n,fst1,fst2,ast
nb,na,fst1,fp1,fp2,fst2
The string entries are defined as follows:
ap — amount of ripple allowed in the pass band. Also called Apass.
ast1 — attenuation in the first stop band in decibels (the default units). Also called Astop1.
ast2 — attenuation in the second stop band in decibels (the default units). Also called Astop2.
bwp — bandwidth of the filter passband. Specified in normalized frequency units.
bwst — bandwidth of the filter stopband. Specified in normalized frequency units.
f3dB1 — cutoff frequency for the point 3 dB point below the passband value for the first cutoff. Specified in normalized frequency units. (IIR filters)
f3dB2 — cutoff frequency for the point 3 dB point below the passband value for the second cutoff. Specified in normalized frequency units. (IIR filters)
fc1 — cutoff frequency for the point 3 dB point below the passband value for the first cutoff. Specified in normalized frequency units. (FIR filters)
fc2 — cutoff frequency for the point 3 dB point below the passband value for the second cutoff. Specified in normalized frequency units. (FIR filters)
fp1 — frequency at the edge of the start of the pass band. Specified in normalized frequency units. Also called Fpass1.
fp2 — frequency at the edge of the end of the pass band. Specified in normalized frequency units. Also called Fpass2.
fst1 — frequency at the edge of the start of the first stop band. Specified in normalized frequency units. Also called Fstop1.
fst2 — frequency at the edge of the start of the second stop band. Specified in normalized frequency units. Also called Fstop2.
n — filter order for FIR filters. Or both the numerator and denominator orders for IIR filters when na and nb are not provided.
na — denominator order for IIR filters
nb — numerator order for IIR filters
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
linear — specify the magnitude in linear units
dB — specify the magnitude in dB (decibels)
squared — specify the magnitude in power units
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.
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: 60Now, pass the filter specifications that correspond to the default Specification — fst1,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: 60Next 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.6000Create 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: 14400fdesign, fdesign.bandstop, fdesign.highpass, fdesign.lowpass
![]() | fdesign.arbmagnphase | fdesign.bandstop | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |