| Filter Design Toolbox™ | ![]() |
d = fdesign.nyquist
d = fdesign.nyquist(l,spec)
d = fdesign.nyquist(l,spec,specvalue1,specvalue2,...)
d = fdesign.nyquist(l,specvalue1,specvalue2)
d = fdesign.nyquist(...,fs)
d = fdesign.nyquist(...,magunits)
d = fdesign.nyquist constructs a Nyquist or L-band filter specification object d, applying default values for the properties tw and ast. By default, the filter object designs a minimum-order half-band (L=2) Nyquist filter.
Using fdesign.nyquist with a design method generates a dfilt object.
d = fdesign.nyquist(l,spec) constructs object d and sets its Specification property to spec. Use l to specify the desired value for L. L = 2 design a half-band FIR filter, L = 3 a third-band FIR filter, and so on. When you use a Nyquist filter as an interpolator, l or L is the interpolation factor. The first input argument must be l when you are not using the default syntax d = fdesign.nyquist.
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.
tw,ast (default spec)
n,tw
n
n,ast
The string entries are defined as follows:
ast — attenuation in the stop band in decibels (the default units).
n — filter order.
tw — width of the transition region between the pass and stop bands. Specified in normalized frequency units.
The filter design methods that apply to an interpolating filter specification object change depending on the Specification string. Paired with each string in the following table are the design methods for interpolating filter specification objects that use that string.
Specification String | Applicable Design Method |
|---|---|
tw,ast | |
n,tw | |
n | |
n,ast |
d = fdesign.nyquist(l,spec,specvalue1,specvalue2,...) constructs an object d and sets its specification to spec, and the specification values to specvalue1, specvalue2, and so on at construction time.
d = fdesign.nyquist(l,specvalue1,specvalue2) constructs an object d with the values you provide in l, specvalue1,specvalue2 as the values for l, tw and ast.
d = fdesign.nyquist(...,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.nyquist(...,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.
Using Nyquist filter specification objects with the equiripple design method imposes a few limitations on the resulting filter, caused by the equiripple design algorithm.
When you request a minimum-order design from equiripple with your Nyquist object, the design algorithm might not converge and can fail with a filter convergence error.
When you specify the order of your desired filter, and use the equiripple design method, the design might not converge.
Generally, the following specifications, alone or in combination with one another, can cause filter convergence problems with Nyquist objects and the equiripple design method.
very high order
small transition width
very large stopband attenuation
Note that halfband filters (filters where band = 2) do not exhibit convergence problems.
When convergence issues arise, either in the cases mentioned or in others, you might be able to design your filter with the kaiserwin method.
In addition, if you use Nyquist objects to design decimators or interpolators (where the interpolation or decimation factor is not a prime number), using multistage filter designs might be your best approach.
These examples show how to construct a Nyquist filter specification object. First, create a default specifications object without using input arguments.
d=fdesign.nyquist
d =
Response: 'Nyquist'
Specification: 'TW,Ast'
Description: {'Transition Width';'Stopband Attenuation (dB)'}
Band: 2
NormalizedFrequency: true
TransitionWidth: 0.1
Astop: 80 Now create an object by passing a specification type string 'n,ast' — the resulting object uses default values for n and ast.
d=fdesign.nyquist(2,'n,ast')
d =
Response: 'Nyquist'
Specification: 'N,Ast'
Description: {'Filter Order';'Stopband Attenuation (dB)'}
Band: 2
NormalizedFrequency: true
FilterOrder: 10
Astop: 80 Create another Nyquist filter object, passing the specification values to the object rather than accepting the default values for n and ast.
d=fdesign.nyquist(3,'n,ast',42,80)
d =
Response: 'Nyquist'
Specification: 'N,Ast'
Description: {'Filter Order';'Stopband Attenuation (dB)'}
Band: 3
NormalizedFrequency: true
FilterOrder: 42
Astop: 80 Finally, pass the filter specifications that correspond to the default Specification — tw,ast. When you pass only the values, fdesign.nyquist assumes the default Specification string.
d = fdesign.nyquist(4,.01,80)
d =
Response: 'Nyquist'
Specification: 'TW,Ast'
Description: {'Transition Width';'Stopband Attenuation (dB)'}
Band: 4
NormalizedFrequency: true
TransitionWidth: 0.01
Astop: 80 Now design a Nyquist filter using the kaiserwin design method.
hd = design(d,'kaiserwin')
hd =
FilterStructure: 'Direct-Form FIR'
Arithmetic: 'double'
Numerator: [1x1005 double]
PersistentMemory: false fdesign, fdesign.interpolator, fdesign.halfband, fdesign.interpolator, fdesign.rsrc
![]() | fdesign.notch | fdesign.octave | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |