mirror of
https://github.com/thestk/stk
synced 2026-01-20 16:01:54 +00:00
Release 4.3.0 tarball
This commit is contained in:
committed by
Stephen Sinclair
parent
554a74374b
commit
1a8403e203
@@ -6,7 +6,7 @@
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
<CENTER>
|
||||
<img src="princeton.gif"> <img src="ccrma.gif"> <img src="mcgill.gif"><P>
|
||||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="information.html">Information</a> <a class="qindex" href="classes.html">Classes</a> <a class="qindex" href="download.html">Download</a> <a class="qindex" href="usage.html">Usage</a> <a class="qindex" href="maillist.html">Mail List</a> <a class="qindex" href="system.html">Requirements</a> <a class="qindex" href="links.html">Links</a> <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
|
||||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="information.html">Information</a> <a class="qindex" href="classes.html">Classes</a> <a class="qindex" href="download.html">Download</a> <a class="qindex" href="usage.html">Usage</a> <a class="qindex" href="maillist.html">Mail List</a> <a class="qindex" href="system.html">Requirements</a> <a class="qindex" href="links.html">Links</a> <a class="qindex" href="faq.html">FAQ</a> <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
|
||||
<HR>
|
||||
<!-- Generated by Doxygen 1.4.4 -->
|
||||
<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="classFilter.html">Filter</a> class provides functionality to implement a generalized digital filter of any type, similar to the <code>filter</code> function in Matlab. In this example, we create a <a class="el" href="classFilter.html">Filter</a> instance and initialize it with specific numerator and denominator coefficients. We then compute its impulse response for 20 samples.<p>
|
||||
@@ -48,17 +48,17 @@ The STK <a class="el" href="classBiQuad.html">BiQuad</a> and <a class="el" href=
|
||||
<a class="code" href="classNoise.html">Noise</a> noise;
|
||||
|
||||
<a class="code" href="classBiQuad.html">BiQuad</a> biquad;
|
||||
biquad.<a class="code" href="classBiQuad.html#a8">setResonance</a>( 440.0, 0.98, <span class="keyword">true</span> ); <span class="comment">// automatically normalize for unity peak gain</span>
|
||||
biquad.<a class="code" href="classBiQuad.html#a9">setResonance</a>( 440.0, 0.98, <span class="keyword">true</span> ); <span class="comment">// automatically normalize for unity peak gain</span>
|
||||
|
||||
<span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i<output.size(); i++ ) {
|
||||
output[i] = biquad.<a class="code" href="classBiQuad.html#a14">tick</a>( noise.<a class="code" href="classGenerator.html#a3">tick</a>() ); <span class="comment">// single-sample computations</span>
|
||||
output[i] = biquad.<a class="code" href="classBiQuad.html#a15">tick</a>( noise.<a class="code" href="classGenerator.html#a3">tick</a>() ); <span class="comment">// single-sample computations</span>
|
||||
std::cout << <span class="stringliteral">"i = "</span> << i << <span class="stringliteral">" : output = "</span> << output[i] << 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="classBiQuad.html#a8">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>
|
||||
By passing a boolian value of <code>true</code> as the third argument to the <a class="el" href="classBiQuad.html#a9">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>
|
||||
|
||||
@@ -68,9 +68,9 @@ By passing a boolian value of <code>true</code> as the third argument to the <a
|
||||
<a class="code" href="classNoise.html">Noise</a> noise;
|
||||
|
||||
<a class="code" href="classBiQuad.html">BiQuad</a> biquad;
|
||||
biquad.<a class="code" href="classBiQuad.html#a8">setResonance</a>( 440.0, 0.98, <span class="keyword">true</span> ); <span class="comment">// automatically normalize for unity peak gain</span>
|
||||
biquad.<a class="code" href="classBiQuad.html#a9">setResonance</a>( 440.0, 0.98, <span class="keyword">true</span> ); <span class="comment">// automatically normalize for unity peak gain</span>
|
||||
|
||||
biquad.<a class="code" href="classBiQuad.html#a14">tick</a>( noise.<a class="code" href="classGenerator.html#a3">tick</a>( output ) ); <span class="comment">// vector-based computations</span>
|
||||
biquad.<a class="code" href="classBiQuad.html#a15">tick</a>( noise.<a class="code" href="classGenerator.html#a3">tick</a>( 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<output.size(); i++ ) {
|
||||
std::cout << <span class="stringliteral">"i = "</span> << i << <span class="stringliteral">" : output = "</span> << output[i] << std::endl;
|
||||
}
|
||||
@@ -82,7 +82,7 @@ By passing a boolian value of <code>true</code> as the third argument to the <a
|
||||
|
||||
<table>
|
||||
<tr><td><A HREF="http://ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
|
||||
<tr><td>©1995-2005 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
||||
<tr><td>©1995-2007 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
||||
</table>
|
||||
|
||||
</BODY>
|
||||
|
||||
Reference in New Issue
Block a user