Contents Previous Next Subchapters Current Chapters-> errorbar garrow ghist gbar bar gstair polar smith fcplot fdplot Parent Chapters-> Omatrix6 graphics specialplots fdplot Search Tools-> contents reference index search

Plotting The Response Of A Digital Filter
 Syntax `fdplot(`dt`, `ymin`, `ymax`, `cutoff`, `num`, `den`)` See Also fdplot

Description
Plots the response of a digital filter in the current viewport, where dt is an integer, real, or double-precision scalar specifying the time between sample points; ymin is an integer, real, or double-precision scalar specifying the minimum value on the `y`-axis; ymax is an integer, real, or double-precision scalar specifying the maximum value on the `y`-axis; cutoff is an integer, real, or double-precision row vector denoting the cutoff frequencies; num is an integer, real, or double-precision column vector specifying the numerator polynomial for the filter; and den is an integer, real, or double-precision column vector specifying the denominator polynomial for the filter. The `y`-axis is log-scaled, and the scaling of the `x`-axis is based on its current settings. Both ymin and ymax must be powers of 10 (e.g., 1, 10, 100). ``` ```The response function plotted is ```      |             __           |2      | num[ exp( \/-1 dt w ) ]  |      ----------------------------      |             __           |2      | den[ exp( \/-1 dt w ) ]  | ```where `w` is between `pi / (100 dt)` and `pi / dt`.

Example
The example below does not plot any cutoff frequencies because the row vector cutoff has zero column dimension. ``` clear # dt     = 1. ymin   = 1e-4 ymax   = 1e2 cutoff = fill(0, 1, 0) num    = {1, 2, 1} den    = 1 fdplot(dt, ymin, ymax, cutoff, num, den) ```