| Filter Design Toolbox™ | ![]() |
d = fdesign.differentiator
d = fdesign.differentiator(spec)
d = fdesign.differentiator(spec,specvalue1,specvalue2,
...)
d = fdesign.differentiator(specvalue1)
d = fdesign.differentiator(...,fs)
d = fdesign.differentiator(...,magunits)
d = fdesign.differentiator constructs a default differentiator filter designer d with the filter order set to 31.
d = fdesign.differentiator(spec) initializes the filter designer Specification property to spec. You provide one of the following strings as input to replace spec. The string you provide is not case sensitive:
n — full band differentiator (default).
n,fp,fst — partial band differentiator.
ap — minimum-order full band differentiator.
fp,fst,ap,ast — minimum-order partial band differentiator.
The string entries are defined as follows:
ap — amount of ripple allowed in the pass band in decibels (the default units). Also called Apass.
ast — attenuation in the stop band in decibels (the default units). Also called Astop.
fp — frequency at the start of the pass band. Specified in normalized frequency units. Also called Fpass.
fst — frequency at the end of the stop band. Specified in normalized frequency units. Also called Fstop.
n — filter order.
By default, fdesign.differentiator assumes that all frequency specifications are provided in normalized frequency units. Also, decibels is the default for all magnitude specifications.
Different specification strings may have different design methods available. Use designmethods(d) to get a list of the design methods available for a given specification string.
d = fdesign.differentiator(spec,specvalue1,specvalue2, ...) initializes the filter designer specifications in spec with specvalue1, specvalue2, and so on. To get a description of the specifications specvalue1, specvalue2, and more, enter
get(d,'description')
at the Command prompt.
d = fdesign.differentiator(specvalue1) assumes the default specification string n, setting the filter order to the value you provide.
d = fdesign.differentiator(...,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.differentiator(...,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.
The toolbox lets you design a range of differentiators. These examples present a few possible designs. The first example designs a 33rd-order full band differentiator. The FVTool plot following the code shows the resulting 33rd-order filter.
d = fdesign.differentiator(33); % Filter order is 33. designmethods(d); hd = design(d,'firls'); fvtool(hd,'magnitudedisplay','zero-phase',... 'frequencyrange','[-pi, pi)') Design Methods for class fdesign.differentiator (N): equiripple firls

For the second example, design a narrow band differentiator. Differentiate the first 25 percent of the frequencies in the Nyquist range and filter the higher frequencies.
d = fdesign.differentiator('n,fp,fst',54,.25,.3);
designmethods(d);
hd = design(d,'equiripple');
fvtool(hd,'magnitudedisplay','zero-phase');
set(hf,'frequencyrange','[-fs/2, fs/2)')Here is the view from FVTool.

Finally, design a minimum-order, wide-band differentiator.
d = fdesign.differentiator('fp,fst,ap,ast',.8,.9,1,80);
designmethods(d);
hd = design(d,'equiripple');
fvtool(hd,'magnitudedisplay','zero-phase','frequencyrange')FVTool returns this plot.

![]() | fdesign.decimator | fdesign.fracdelay | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |