fdesign.lowpass - Lowpass filter specification

Syntax

d = fdesign.lowpass
d = fdesign.lowpass(spec)
d = fdesign.lowpass(spec,specvalue1,specvalue2,...)
d = fdesign.lowpass(specvalue1,specvalue2,specvalue3,specvalue4)
d = fdesign.lowpass(...,fs)
d = fdesign.lowpass(...,magunits)

Description

d = fdesign.lowpass constructs a lowpass filter specification object d, applying default values for the properties fp, fst, ap, and ast.

Using the fdesign.lowpass specification object with a design method generates a dfilt object.

d = fdesign.lowpass(spec) constructs object d and sets its 'Specification' property to the string in 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 fp and fst are transition regions where the filter response is not explicitly defined.

The filter design methods that apply to a lowpass filter specification object change depending on the Specification string. Here are all the valid strings for lowpass filter specification objects.

d = fdesign.lowpass(spec,specvalue1,specvalue2,...) constructs an object d and sets its specification values at construction time using specvalue1, specvalue2, and so on for all of the specification variables in spec.

d = fdesign.lowpass(specvalue1,specvalue2,specvalue3,specvalue4) constructs an object d with values for the default Specification property string fp,fst,ap,ast using the specifications you provide as input arguments specvalue1,specvalue2,specvalue3,specvalue4.

d = fdesign.lowpass(...,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.lowpass(...,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 how to construct a lowpass filter specification object. First, create a default lowpass filter object without using input arguments.

d=fdesign.lowpass
 
d =
 
               Response: 'Minimum-order lowpass'
          Specification: 'Fp,Fst,Ap,Ast'
            Description: {4x1 cell}
    NormalizedFrequency: true
                  Fpass: 0.4500
                  Fstop: 0.5500
                  Apass: 1
                  Astop: 60

Now create an object by passing specifications for the passband and stopband edge frequencies and the passband and stopband attenuations — the resulting object uses the input values for fp, fst, ap, and ast.

hs = fdesign.lowpass(.4,.5,1,80);
hs
 
hs =
 
               Response: 'Minimum-order lowpass'
          Specification: 'Fp,Fst,Ap,Ast'
            Description: {4x1 cell}
    NormalizedFrequency: true
                  Fpass: 0.4000
                  Fstop: 0.5000
                  Apass: 1
                  Astop: 80

Create another filter object, passing the values for n and fc rather than accepting the default values. You can add include the sampling frequency fs as the final input argument.

d=fdesign.lowpass('n,fc',10, 9600,48000)
 
d =
 
               Response: 'Lowpass with cutoff'
          Specification: 'N,Fc'
            Description: {2x1 cell}
    NormalizedFrequency: false
                     Fs: 48000
            FilterOrder: 10
                Fcutoff: 9600

Finally, pass values for the filter specifications that match the default Specification string entries — fp = 0.4, fst = 0.5, ast = 80 and ap = 1.0. Add the sampling frequency on the end.

hs = fdesign.lowpass(.4,.5,1,80)
 
hs =
 
               Response: 'Minimum-order lowpass'
          Specification: 'Fp,Fst,Ap,Ast'
            Description: {4x1 cell}
    NormalizedFrequency: true
                  Fpass: 0.4000
                  Fstop: 0.5000
                  Apass: 1
                  Astop: 80

Finally, the next examples add the sampling frequency specification in Hz, and then the magunits option.

hs = fdesign.lowpass('N,Fp,Ap', 10, 9600, .5, 48000);

and

hsmag = fdesign.lowpass(.4, .5, .98, .02, 'squared');

Using the last example filter object, create a highpass filter.

hd = design(hsmag,'cheby1';

See Also

fdesign, fdesign.bandpass, fdesign.bandstop, fdesign.highpass

  


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