Nyquist filter specification
d = fdesign.nyquist
d = fdesign.nyquist(l, spec)
d = fdesign.nyquist(l,spec,specvalue1,specvalue2,...)
d = fdesign.nyquist(l,specvalue1,specvalue2)
d = fdesign.
d = fdesign.
a Nyquist or L-band filter specification object
d = fdesign.nyquist
applying default values for the properties
By default, the filter object designs a minimum-order half-band (L=2)
fdesign.nyquist with a design method
d = fdesign.nyquist(l, spec) constructs
d and sets its
l to specify
the desired value for L. L = 2
designs 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
Entries in the
spec string represent various
filter response features, such as the filter order, that govern the
filter design. Valid entries for
shown below. The strings are not case sensitive.
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
The filter design methods that apply to a Nyquist filter specification
object change depending on the
designmethods to determine
which design method applies to an object and its specification string.
Different filter design methods also have options that you can specify.
designopts with the design
method string to see the available options. For example:
d = fdesign.nyquist(l,spec,specvalue1,specvalue2,...) constructs
d and sets its specification to
and the specification values to
and so on at construction time.
d = fdesign.nyquist(l,specvalue1,specvalue2) constructs
d with the values you provide in
the values for
d = fdesign. adds
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. specifies
the units for any magnitude specification you provide in the input
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
that all magnitudes are in decibels. Note that
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
When you request a minimum-order design from
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
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
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.
Now create an object by passing a specification type string
ast' — the resulting
object uses default values for
Create another Nyquist filter object, passing the specification
values to the object rather than accepting the default values for
Finally, pass the filter specifications that correspond to the
When you pass only the values,
d = fdesign.nyquist(4,.01,80)
Now design a Nyquist filter using the
hd = design(d,'kaiserwin')
Create two equiripple Nyquist 4th–band filters with and without a nonnegative zero phase response:
f=fdesign.nyquist(4,'N,TW',12,0.2); % Equiripple Nyquist 4th-band filter with % nonnegative zero phase response Hd1=design(f,'equiripple','zerophase',true); % Equiripple Nyquist 4th-band filter with 'ZeroPhase' set to false % 'zerophase',false is the default Hd2=design(f,'equiripple','zerophase',false); %Obtain real-valued amplitudes (not magnitudes) [Hr_zerophase,W]=zerophase(Hd1); [Hr,W]=zerophase(Hd2); % Plot and compare response plot(W,Hr_zerophase,'k','linewidth',2); xlabel('Radians/sample'); ylabel('Amplitude'); hold on; plot(W,Hr,'r'); axis tight; grid on; legend('with ''ZeroPhase'', true','with ''ZeroPhase'' false');
Note that the amplitude of the zero phase response (black line) is nonnegative for all frequencies.
'ZeroPhase' option is valid only for
equiripple Nyquist designs with the
You cannot specify