No finite set of prefabricated filters could fill every possible need, and so
Pd provides the elementary filters of Sections
<AHREF="node133.html#sect8.nonrecirculating">8.2.1</A>-<AHREF="node135.html#sect8.recirculating">8.2.3</A> in raw form, so that the
user can supply the filter coefficients explicitly. In this section we will
describe patches that realize the shelving and peaking filters of Sections
<AHREF="node142.html#sect8.shelving">8.3.3</A> and <AHREF="node144.html#sect8.peaking">8.3.5</A> directly from elementary filters.
First we introduce the six Pd objects that realize elementary filters:
<P>
<BR><!-- MATH
$\fbox{ \texttt{rzero\~}}$
-->
<IMG
WIDTH="69" HEIGHT="39" ALIGN="MIDDLE" BORDER="0"
SRC="img1028.png"
ALT="\fbox{ \texttt{rzero\~}}">,
<BR><!-- MATH
$\fbox{ \texttt{rzero\_rev\~}}$
-->
<IMG
WIDTH="100" HEIGHT="39" ALIGN="MIDDLE" BORDER="0"
SRC="img1029.png"
ALT="\fbox{ \texttt{rzero\_rev\~}}">,
<BR><!-- MATH
$\fbox{ \texttt{rpole\~}}$
-->
<IMG
WIDTH="69" HEIGHT="39" ALIGN="MIDDLE" BORDER="0"
SRC="img1030.png"
ALT="\fbox{ \texttt{rpole\~}}">:
<ANAME="10847"></A><ANAME="10848"></A><ANAME="10849"></A>elementary filters with real-valued coefficients operating on real-valued
signals. The three implement non-recirculating filters of the first and
second types, and the recirculating filter. They all have one inlet, at
right, to supply the coefficient that sets the location of the zero or pole.
The inlet
for the coefficient (as well as the left inlet for the signal to filter) take
audio signals. No stability check is performed.
<P>
<BR><!-- MATH
$\fbox{ \texttt{czero\~}}$
-->
<IMG
WIDTH="69" HEIGHT="39" ALIGN="MIDDLE" BORDER="0"
SRC="img1034.png"
ALT="\fbox{ \texttt{czero\~}}">,
<BR><!-- MATH
$\fbox{ \texttt{czero\_rev\~}}$
-->
<IMG
WIDTH="100" HEIGHT="39" ALIGN="MIDDLE" BORDER="0"
SRC="img1035.png"
ALT="\fbox{ \texttt{czero\_rev\~}}">,
<BR><!-- MATH
$\fbox{ \texttt{cpole\~}}$
-->
<IMG
WIDTH="69" HEIGHT="39" ALIGN="MIDDLE" BORDER="0"
SRC="img1036.png"
ALT="\fbox{ \texttt{cpole\~}}">:
<ANAME="10850"></A><ANAME="10851"></A><ANAME="10852"></A>elementary filters with complex-valued coefficients, operating on complex-valued
signals, corresponding to the real-valued ones above. Instead of two inlets and
one outlet, each of these filters has four inlets (real and imaginary part of
the signal to filter, and real and imaginary part of the coefficient) and
two outlets for the complex-valued output.
<P>
The example patches use a pair of abstractions to graph the frequency and phase
responses of filters as explained in Example H10.measurement.pd. Example H11.shelving.pd (Figure <AHREF="#fig08.32">8.32</A>, part a) shows how to make a shelving filter. One
elementary non-recirculating filter (<TT>rzero~</TT>) and one elementary
recirculating one (<TT>rpole~</TT>) are put in series. As the analysis of
Section <AHREF="node148.html#sect8.timevarying">8.3.9</A> might suggest, the <TT>rzero~</TT> object is placed
first.
<P>
Example H12.peaking.pd (part (b) of the figure) implements a peaking filter. Here the
pole and the zero are rotated by an angle <IMG
WIDTH="14" HEIGHT="13" ALIGN="BOTTOM" BORDER="0"
SRC="img27.png"
ALT="$\omega $"> to control the center
frequency of the filter. The bandwidth and center frequency gain are equal to
the shelf frequency and the DC gain of the corresponding shelving filter.
<P>
Example H13.butterworth.pd demonstrates a three-pole, three-zero Butterworth shelving
filter. The filter itself is an abstraction, <TT>butterworth3~</TT>, for