mirror of
https://github.com/thestk/stk
synced 2026-04-20 06:26:55 +00:00
Release 4.4.3 tarball
This commit is contained in:
committed by
Stephen Sinclair
parent
cfdfe7736a
commit
f13d5bb3cd
@@ -79,7 +79,7 @@ StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="
|
||||
<hr/><a name="_details"></a><h2>Detailed Description</h2>
|
||||
<p>STK biquad (two-pole, two-zero) filter class. </p>
|
||||
<p>This class implements a two-pole, two-zero digital filter. Methods are provided for creating a resonance or notch in the frequency response while maintaining a constant filter gain.</p>
|
||||
<p>by Perry R. Cook and Gary P. Scavone, 1995 - 2010. </p>
|
||||
<p>by Perry R. Cook and Gary P. Scavone, 1995-2011. </p>
|
||||
<hr/><h2>Member Function Documentation</h2>
|
||||
<a class="anchor" id="a55aaa01fd4156f1fac1168f526e3d969"></a><!-- doxytag: member="stk::BiQuad::setResonance" ref="a55aaa01fd4156f1fac1168f526e3d969" args="(StkFloat frequency, StkFloat radius, bool normalize=false)" -->
|
||||
<div class="memitem">
|
||||
@@ -113,7 +113,7 @@ StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="
|
||||
<div class="memdoc">
|
||||
|
||||
<p>Sets the filter coefficients for a resonance at <em>frequency</em> (in Hz). </p>
|
||||
<p>This method determines the filter coefficients corresponding to two complex-conjugate poles with the given <em>frequency</em> (in Hz) and <em>radius</em> from the z-plane origin. If <em>normalize</em> is true, the filter zeros are placed at z = 1, z = -1, and the coefficients are then normalized to produce a constant unity peak gain (independent of the filter <em>gain</em> parameter). The resulting filter frequency response has a resonance at the given <em>frequency</em>. The closer the poles are to the unit-circle (<em>radius</em> close to one), the narrower the resulting resonance width. </p>
|
||||
<p>This method determines the filter coefficients corresponding to two complex-conjugate poles with the given <em>frequency</em> (in Hz) and <em>radius</em> from the z-plane origin. If <em>normalize</em> is true, the filter zeros are placed at z = 1, z = -1, and the coefficients are then normalized to produce a constant unity peak gain (independent of the filter <em>gain</em> parameter). The resulting filter frequency response has a resonance at the given <em>frequency</em>. The closer the poles are to the unit-circle (<em>radius</em> close to one), the narrower the resulting resonance width. An unstable filter will result for <em>radius</em> >= 1.0. The <em>frequency</em> value should be between zero and half the sample rate. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -143,7 +143,7 @@ StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="
|
||||
<div class="memdoc">
|
||||
|
||||
<p>Set the filter coefficients for a notch at <em>frequency</em> (in Hz). </p>
|
||||
<p>This method determines the filter coefficients corresponding to two complex-conjugate zeros with the given <em>frequency</em> (in Hz) and <em>radius</em> from the z-plane origin. No filter normalization is attempted. </p>
|
||||
<p>This method determines the filter coefficients corresponding to two complex-conjugate zeros with the given <em>frequency</em> (in Hz) and <em>radius</em> from the z-plane origin. No filter normalization is attempted. The <em>frequency</em> value should be between zero and half the sample rate. The <em>radius</em> value should be positive. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -198,6 +198,31 @@ StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="
|
||||
|
||||
<p>Implements <a class="el" href="classstk_1_1Filter.html#a3260a238824c4a748ac057b84b7d3f21">stk::Filter</a>.</p>
|
||||
|
||||
<p><div class="fragment"><pre class="fragment"><a name="l00133"></a>00133 {
|
||||
<a name="l00134"></a>00134 <span class="preprocessor">#if defined(_STK_DEBUG_)</span>
|
||||
<a name="l00135"></a>00135 <span class="preprocessor"></span> <span class="keywordflow">if</span> ( channel >= frames.channels() ) {
|
||||
<a name="l00136"></a>00136 oStream_ << <span class="stringliteral">"BiQuad::tick(): channel and StkFrames arguments are incompatible!"</span>;
|
||||
<a name="l00137"></a>00137 <a class="code" href="classstk_1_1Stk.html#a48ac73a0d8ca28445ba1a054e1f061ff" title="Static function for error reporting and handling using c-strings.">handleError</a>( StkError::FUNCTION_ARGUMENT );
|
||||
<a name="l00138"></a>00138 }
|
||||
<a name="l00139"></a>00139 <span class="preprocessor">#endif</span>
|
||||
<a name="l00140"></a>00140 <span class="preprocessor"></span>
|
||||
<a name="l00141"></a>00141 StkFloat *samples = &frames[channel];
|
||||
<a name="l00142"></a>00142 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> hop = frames.channels();
|
||||
<a name="l00143"></a>00143 <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i<frames.frames(); i++, samples += hop ) {
|
||||
<a name="l00144"></a>00144 inputs_[0] = gain_ * *samples;
|
||||
<a name="l00145"></a>00145 *samples = b_[0] * inputs_[0] + b_[1] * inputs_[1] + b_[2] * inputs_[2];
|
||||
<a name="l00146"></a>00146 *samples -= a_[2] * outputs_[2] + a_[1] * outputs_[1];
|
||||
<a name="l00147"></a>00147 inputs_[2] = inputs_[1];
|
||||
<a name="l00148"></a>00148 inputs_[1] = inputs_[0];
|
||||
<a name="l00149"></a>00149 outputs_[2] = outputs_[1];
|
||||
<a name="l00150"></a>00150 outputs_[1] = *samples;
|
||||
<a name="l00151"></a>00151 }
|
||||
<a name="l00152"></a>00152
|
||||
<a name="l00153"></a>00153 lastFrame_[0] = outputs_[1];
|
||||
<a name="l00154"></a>00154 <span class="keywordflow">return</span> frames;
|
||||
<a name="l00155"></a>00155 }
|
||||
</pre></div></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ac9836f0e074ea9516727f27eb9b411aa"></a><!-- doxytag: member="stk::BiQuad::tick" ref="ac9836f0e074ea9516727f27eb9b411aa" args="(StkFrames &iFrames, StkFrames &oFrames, unsigned int iChannel=0, unsigned int oChannel=0)" -->
|
||||
@@ -240,6 +265,32 @@ StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="
|
||||
<p>Take a channel of the <code>iFrames</code> object as inputs to the filter and write outputs to the <code>oFrames</code> object. </p>
|
||||
<p>The <code>iFrames</code> object reference is returned. Each channel argument must be less than the number of channels in the corresponding <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> argument (the first channel is specified by 0). However, range checking is only performed if _STK_DEBUG_ is defined during compilation, in which case an out-of-range value will trigger an <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> exception. </p>
|
||||
|
||||
<p><div class="fragment"><pre class="fragment"><a name="l00158"></a>00158 {
|
||||
<a name="l00159"></a>00159 <span class="preprocessor">#if defined(_STK_DEBUG_)</span>
|
||||
<a name="l00160"></a>00160 <span class="preprocessor"></span> <span class="keywordflow">if</span> ( iChannel >= iFrames.channels() || oChannel >= oFrames.channels() ) {
|
||||
<a name="l00161"></a>00161 oStream_ << <span class="stringliteral">"BiQuad::tick(): channel and StkFrames arguments are incompatible!"</span>;
|
||||
<a name="l00162"></a>00162 <a class="code" href="classstk_1_1Stk.html#a48ac73a0d8ca28445ba1a054e1f061ff" title="Static function for error reporting and handling using c-strings.">handleError</a>( StkError::FUNCTION_ARGUMENT );
|
||||
<a name="l00163"></a>00163 }
|
||||
<a name="l00164"></a>00164 <span class="preprocessor">#endif</span>
|
||||
<a name="l00165"></a>00165 <span class="preprocessor"></span>
|
||||
<a name="l00166"></a>00166 StkFloat *iSamples = &iFrames[iChannel];
|
||||
<a name="l00167"></a>00167 StkFloat *oSamples = &oFrames[oChannel];
|
||||
<a name="l00168"></a>00168 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> iHop = iFrames.channels(), oHop = oFrames.channels();
|
||||
<a name="l00169"></a>00169 <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i<iFrames.frames(); i++, iSamples += iHop, oSamples += oHop ) {
|
||||
<a name="l00170"></a>00170 inputs_[0] = gain_ * *iSamples;
|
||||
<a name="l00171"></a>00171 *oSamples = b_[0] * inputs_[0] + b_[1] * inputs_[1] + b_[2] * inputs_[2];
|
||||
<a name="l00172"></a>00172 *oSamples -= a_[2] * outputs_[2] + a_[1] * outputs_[1];
|
||||
<a name="l00173"></a>00173 inputs_[2] = inputs_[1];
|
||||
<a name="l00174"></a>00174 inputs_[1] = inputs_[0];
|
||||
<a name="l00175"></a>00175 outputs_[2] = outputs_[1];
|
||||
<a name="l00176"></a>00176 outputs_[1] = *oSamples;
|
||||
<a name="l00177"></a>00177 }
|
||||
<a name="l00178"></a>00178
|
||||
<a name="l00179"></a>00179 lastFrame_[0] = outputs_[1];
|
||||
<a name="l00180"></a>00180 <span class="keywordflow">return</span> iFrames;
|
||||
<a name="l00181"></a>00181 }
|
||||
</pre></div></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<hr/>The documentation for this class was generated from the following file:<ul>
|
||||
@@ -250,7 +301,7 @@ StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="
|
||||
|
||||
<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-2010 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
||||
<tr><td>©1995-2011 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
||||
</table>
|
||||
|
||||
</BODY>
|
||||
|
||||
Reference in New Issue
Block a user