1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
<HTML>
<TITLE>FILTER2</TITLE>
<CENTER><A NAME="filter2"></A>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <B><A HREF="./SIG_MOD.html">Top of this section</A></B> - <A HREF="./nlfilt.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./lpread.html">Next</A>
<HR></CENTER>
<H2>
filter2, kfilter2, zfilter2</H2>
<TT> a1 <B>filter2</B> asig, iM,iN,ib0,ib1,...,
ibM,ia1,ia2,...,iaN</TT>
<BR><TT> k1 <B>kfilter2</B> ksig, iM,iN,ib0,ib1,...,ibM,ia1,ia2,...,iaN</TT>
<BR><TT> a1 <B>zfilter2</B> asig, kdamp,kfreq,iM,iN,ib0,ib1,...,ibM,ia1,ia2,...,iaN</TT>
<P>
<HR>
<BR>
<H4>
<U>DESCRIPTION</U></H4>
General purpose custom filter with time-varying pole control. The filter
coefficients implement the following difference equation:
<P> <TT> (1)*y(n) = b0*x[n] + b1*x[n-1] + ... + bM*x[n-M] - a1*y[n-1]
- ... - aN*y[n-N]</TT>
<P>the system function for which is represented by:
<BR><TT>
-1
-M</TT>
<BR><TT>
B(Z) b0 + b1*Z + ... +
bM*Z</TT>
<BR><TT> H(Z) = ----
= ---------------------------------</TT>
<BR><TT>
-1
-N</TT>
<BR><TT>
A(Z) 1 + a1*Z
+ ... + aN*Z</TT>
<BR>
<P><B><U>INITIALIZATION</U></B>
<P>At initialization the number of zeros and poles of the filter are specified
along with the corresponding zero and pole coefficients. The coefficients
must be obtained by an external filter-design application such as Matlab
and specified directly or loaded into a table via <B>gen01</B>. With <B>zfilter2,</B>
the roots of the characteristic polynomials are solved at initialization
so that the pole-control operations can be implemented efficiently.
<BR>
<P><B><U>PERFORMANCE</U></B>
<P>The<B> filter2</B> and <B>kfilter2</B> opcodes perform filtering using
a transposed form-II digital filter lattice with no time-varying control.
<B>zfilter2</B> uses the additional operations of radial pole-shearing
and angular pole-warping in the Z plane.
<P>Pole shearing increases the magnitude of poles along radial lines in
the Z-plane. This has the affect of altering filter ring times. The k-rate
variable <I>kdamp</I> is the damping parameter. Positive values (0.01 to
0.99) increase the ring-time of the filter (hi-Q), negative values (-0.01
to -0.99) decrease the ring-time of the filter, (lo-Q).
<P>Pole warping changes the frequency of poles by moving them along angular
paths in the Z plane. This operation leaves the shape of the magnitude
response unchanged but alters the frequencies by a constant factor (preserving
0 and p). The k-rate variable <I>kfreq</I> determines the frequency warp
factor. Positive values (0.01 to 0.99) increase frequencies toward p and
negative values (-0.01 to -0.99) decrease frequencies toward 0.
<P>Since <B>filter2</B> implements generalized recursive filters, it can
be used to specify a large range of general DSP algorithms. For example,
a digital waveguide can be implemented for musical instrument modeling
using a pair of <B><A HREF="./delayr.html">delayr</A> </B>and <B><A HREF="./delayr.html">delayw
</A></B>opcodes in conjunction with the <B>filter2</B> opcode.
<P><B><U>EXAMPLE:</U></B>
<P>A first-order linear-phase lowpass linear-phase FIR filter operating
on a k-rate signal:
<P> <TT> k1 <B>kfilter2</B> ksig, 2, 0, 0.5, 0.5
;; k-rate FIR filter</TT>
<P>A controllable second-order IIR filter operating on an a-rate signal:
<P> <TT> a1 <B>zfilter2</B> asig, kdamp, kfreq, 1, 2,
1, ia1, ia2 ;; controllable a-rate IIR filter</TT>
<BR>
<H4>
<U>AUTHOR:</U></H4>
Michael A. Casey
<BR>M.I.T.
<BR>Cambridge, Mass.
<BR>1997
<BR>
<BR>
<CENTER><P>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <B><A HREF="./SIG_MOD.html">Top of this section</A></B> - <A HREF="./nlfilt.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./lpread.html">Next</A>
<HR></CENTER>
<P><CENTER>
<B><I><FONT COLOR="#006600">HTML Csound Manual - <FONT SIZE=-1>©
Jean Piché & Peter J. Nix, 1994-97</FONT></FONT></I></B>
</CENTER>
</HTML>
|