Release 4.4.2 tarball

This commit is contained in:
Gary Scavone
2013-09-29 23:48:48 +02:00
committed by Stephen Sinclair
parent c37de52787
commit 7fcf920d3e
711 changed files with 28790 additions and 16452 deletions

View File

@@ -8,10 +8,12 @@
<img src="princeton.gif"> &nbsp; <img src="ccrma.gif"> &nbsp; <img src="mcgill.gif"><P>
<a class="qindex" href="index.html">Home</a> &nbsp; <a class="qindex" href="information.html">Information</a> &nbsp; <a class="qindex" href="classes.html">Classes</a> &nbsp; <a class="qindex" href="download.html">Download</a> &nbsp; <a class="qindex" href="usage.html">Usage</a> &nbsp; <a class="qindex" href="maillist.html">Mail List</a> &nbsp; <a class="qindex" href="system.html">Requirements</a> &nbsp; <a class="qindex" href="links.html">Links</a> &nbsp; <a class="qindex" href="faq.html">FAQ</a> &nbsp; <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
<HR>
<!-- Generated by Doxygen 1.5.8 -->
<!-- Generated by Doxygen 1.6.2 -->
<div class="contents">
<h1><a class="anchor" name="filtering">Using Filters </a></h1>In this section, we demonstrate the use of a few of the STK filter classes. The <a class="el" href="classstk_1_1Iir.html" title="STK general infinite impulse response filter class.">stk::Iir</a> class provides functionality to implement a generalized infinite impulse response (IIR) digital filter, similar to the <code>filter</code> function in Matlab. In this example, we create an <a class="el" href="classstk_1_1Iir.html" title="STK general infinite impulse response filter class.">stk::Iir</a> instance and initialize it with specific numerator and denominator coefficients. We then compute its impulse response for 20 samples.<p>
<div class="fragment"><pre class="fragment"><span class="preprocessor">#include "Iir.h"</span>
<h1><a class="anchor" id="filtering">Using Filters </a></h1><p>In this section, we demonstrate the use of a few of the STK filter classes. The <a class="el" href="classstk_1_1Iir.html" title="STK general infinite impulse response filter class.">stk::Iir</a> class provides functionality to implement a generalized infinite impulse response (IIR) digital filter, similar to the <code>filter</code> function in Matlab. In this example, we create an <a class="el" href="classstk_1_1Iir.html" title="STK general infinite impulse response filter class.">stk::Iir</a> instance and initialize it with specific numerator and denominator coefficients. We then compute its impulse response for 20 samples.</p>
<div class="fragment"><pre class="fragment"><span class="preprocessor">#include &quot;Iir.h&quot;</span>
<span class="keyword">using namespace </span>stk;
<span class="keywordtype">int</span> main()
@@ -29,20 +31,20 @@
filter.tick( output );
<span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i&lt;output.size(); i++ ) {
std::cout &lt;&lt; <span class="stringliteral">"i = "</span> &lt;&lt; i &lt;&lt; <span class="stringliteral">" : output = "</span> &lt;&lt; output[i] &lt;&lt; std::endl;
std::cout &lt;&lt; <span class="stringliteral">&quot;i = &quot;</span> &lt;&lt; i &lt;&lt; <span class="stringliteral">&quot; : output = &quot;</span> &lt;&lt; output[i] &lt;&lt; std::endl;
}
<span class="keywordflow">return</span> 0;
}
</pre></div><p>
The <a class="el" href="classstk_1_1Iir.html" title="STK general infinite impulse response filter class.">stk::Iir</a> class implements the standard difference equation <div class="fragment"><pre class="fragment"> a[0]*y[n] = b[0]*x[n] + ... + b[nb]*x[n-nb] - a[1]*y[n-1] - ... - a[na]*y[n-na],
</pre></div><p>
where "b" values are numerator coefficients and "a" values are denominator coefficients. Note that if the first denominator coefficient is not 1.0, the Iir class automatically normalizes all filter coefficients by that value. The coefficient values are passed to the Iir class via a C++ <a href="http://www.roguewave.com/support/docs/sourcepro/stdlibref/vector.html">vector</a>, a container object provided by the C++ Standard Library.<p>
Most STK classes use more specific types of digital filters, such as the <a class="el" href="classstk_1_1OneZero.html" title="STK one-zero filter class.">stk::OneZero</a>, <a class="el" href="classstk_1_1OnePole.html" title="STK one-pole filter class.">stk::OnePole</a>, <a class="el" href="classstk_1_1TwoPole.html" title="STK two-pole filter class.">stk::TwoPole</a>, or <a class="el" href="classstk_1_1BiQuad.html" title="STK biquad (two-pole, two-zero) filter class.">stk::BiQuad</a> varieties. These classes inherit from the <a class="el" href="classstk_1_1Filter.html" title="STK abstract filter class.">stk::Filter</a> abstract base class and provide specific functionality particular to their use, as well as functions to independently control individual coefficient values.<h2><a class="anchor" name="reson">
</pre></div><p>The <a class="el" href="classstk_1_1Iir.html" title="STK general infinite impulse response filter class.">stk::Iir</a> class implements the standard difference equation </p>
<div class="fragment"><pre class="fragment"> a[0]*y[n] = b[0]*x[n] + ... + b[nb]*x[n-nb] - a[1]*y[n-1] - ... - a[na]*y[n-na],
</pre></div><p>where "b" values are numerator coefficients and "a" values are denominator coefficients. Note that if the first denominator coefficient is not 1.0, the Iir class automatically normalizes all filter coefficients by that value. The coefficient values are passed to the Iir class via a C++ <a href="http://www.roguewave.com/support/docs/sourcepro/stdlibref/vector.html">vector</a>, a container object provided by the C++ Standard Library.</p>
<p>Most STK classes use more specific types of digital filters, such as the <a class="el" href="classstk_1_1OneZero.html" title="STK one-zero filter class.">stk::OneZero</a>, <a class="el" href="classstk_1_1OnePole.html" title="STK one-pole filter class.">stk::OnePole</a>, <a class="el" href="classstk_1_1TwoPole.html" title="STK two-pole filter class.">stk::TwoPole</a>, or <a class="el" href="classstk_1_1BiQuad.html" title="STK biquad (two-pole, two-zero) filter class.">stk::BiQuad</a> varieties. These classes inherit from the <a class="el" href="classstk_1_1Filter.html" title="STK abstract filter class.">stk::Filter</a> abstract base class and provide specific functionality particular to their use, as well as functions to independently control individual coefficient values.</p>
<h2><a class="anchor" id="reson">
Resonances:</a></h2>
The STK <a class="el" href="classstk_1_1BiQuad.html" title="STK biquad (two-pole, two-zero) filter class.">stk::BiQuad</a> and <a class="el" href="classstk_1_1TwoPole.html" title="STK two-pole filter class.">stk::TwoPole</a> classes provide functionality for creating resonance filters. The following example demonstrates how to create a resonance centered at 440 Hz that is used to filter the output of a <a class="el" href="classstk_1_1Noise.html" title="STK noise generator.">stk::Noise</a> generator.<p>
<div class="fragment"><pre class="fragment"><span class="preprocessor">#include "BiQuad.h"</span>
<span class="preprocessor">#include "Noise.h"</span>
<p>The STK <a class="el" href="classstk_1_1BiQuad.html" title="STK biquad (two-pole, two-zero) filter class.">stk::BiQuad</a> and <a class="el" href="classstk_1_1TwoPole.html" title="STK two-pole filter class.">stk::TwoPole</a> classes provide functionality for creating resonance filters. The following example demonstrates how to create a resonance centered at 440 Hz that is used to filter the output of a <a class="el" href="classstk_1_1Noise.html" title="STK noise generator.">stk::Noise</a> generator.</p>
<div class="fragment"><pre class="fragment"><span class="preprocessor">#include &quot;BiQuad.h&quot;</span>
<span class="preprocessor">#include &quot;Noise.h&quot;</span>
<span class="keyword">using namespace </span>stk;
<span class="keywordtype">int</span> main()
@@ -55,15 +57,14 @@ The STK <a class="el" href="classstk_1_1BiQuad.html" title="STK biquad (two-pole
<span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i&lt;output.size(); i++ ) {
output[i] = biquad.tick( noise.tick() ); <span class="comment">// single-sample computations</span>
std::cout &lt;&lt; <span class="stringliteral">"i = "</span> &lt;&lt; i &lt;&lt; <span class="stringliteral">" : output = "</span> &lt;&lt; output[i] &lt;&lt; std::endl;
std::cout &lt;&lt; <span class="stringliteral">&quot;i = &quot;</span> &lt;&lt; i &lt;&lt; <span class="stringliteral">&quot; : output = &quot;</span> &lt;&lt; output[i] &lt;&lt; std::endl;
}
<span class="keywordflow">return</span> 0;
}
</pre></div><p>
By passing a boolian value of <code>true</code> as the third argument to the <a class="el" href="classstk_1_1BiQuad.html#55aaa01fd4156f1fac1168f526e3d969" title="Sets the filter coefficients for a resonance at frequency (in Hz).">stk::BiQuad::setResonance()</a> function, the filter coefficients are automatically scaled to achieve unity gain at the resonance peak frequency. The previous code could be easily modified for "vector-based" calculations:<p>
<div class="fragment"><pre class="fragment"><span class="preprocessor">#include "BiQuad.h"</span>
<span class="preprocessor">#include "Noise.h"</span>
</pre></div><p>By passing a boolian value of <code>true</code> as the third argument to the <a class="el" href="classstk_1_1BiQuad.html#a55aaa01fd4156f1fac1168f526e3d969" title="Sets the filter coefficients for a resonance at frequency (in Hz).">stk::BiQuad::setResonance()</a> function, the filter coefficients are automatically scaled to achieve unity gain at the resonance peak frequency. The previous code could be easily modified for "vector-based" calculations:</p>
<div class="fragment"><pre class="fragment"><span class="preprocessor">#include &quot;BiQuad.h&quot;</span>
<span class="preprocessor">#include &quot;Noise.h&quot;</span>
<span class="keyword">using namespace </span>stk;
<span class="keywordtype">int</span> main()
@@ -76,18 +77,18 @@ By passing a boolian value of <code>true</code> as the third argument to the <a
biquad.tick( noise.tick( output ) ); <span class="comment">// vector-based computations</span>
<span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i&lt;output.size(); i++ ) {
std::cout &lt;&lt; <span class="stringliteral">"i = "</span> &lt;&lt; i &lt;&lt; <span class="stringliteral">" : output = "</span> &lt;&lt; output[i] &lt;&lt; std::endl;
std::cout &lt;&lt; <span class="stringliteral">&quot;i = &quot;</span> &lt;&lt; i &lt;&lt; <span class="stringliteral">&quot; : output = &quot;</span> &lt;&lt; output[i] &lt;&lt; std::endl;
}
<span class="keywordflow">return</span> 0;
}
</pre></div><p>
[<a href="tutorial.html">Main tutorial page</a>] &nbsp; [<a href="realtime.html">Next tutorial</a>] </div>
</pre></div><p>[<a href="tutorial.html">Main tutorial page</a>] &nbsp; [<a href="realtime.html">Next tutorial</a>] </p>
</div>
<HR>
<table>
<tr><td><A HREF="http://ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
<tr><td>&copy;1995-2009 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
<tr><td>&copy;1995-2010 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
</table>
</BODY>