Files
stk/doc/html/classstk_1_1Fir.html
2013-09-29 23:44:33 +02:00

214 lines
14 KiB
HTML

<HTML>
<HEAD>
<TITLE>The Synthesis ToolKit in C++ (STK)</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<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 -->
<div class="navpath"><a class="el" href="namespacestk.html">stk</a>::<a class="el" href="classstk_1_1Fir.html">Fir</a>
</div>
<div class="contents">
<h1>stk::Fir Class Reference</h1><!-- doxytag: class="stk::Fir" --><!-- doxytag: inherits="stk::Filter" -->STK general finite impulse response filter class.
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="Fir_8h-source.html">Fir.h</a>&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for stk::Fir:</div>
<div class="dynsection">
<p><center><img src="classstk_1_1Fir.png" usemap="#stk::Fir_map" border="0" alt=""></center>
<map name="stk::Fir_map">
<area href="classstk_1_1Filter.html" alt="stk::Filter" shape="rect" coords="0,56,62,80">
<area href="classstk_1_1Stk.html" alt="stk::Stk" shape="rect" coords="0,0,62,24">
</map>
</div>
<p>
<a href="classstk_1_1Fir-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4ad986b7f644d3e22e75b0744b2f948a"></a><!-- doxytag: member="stk::Fir::Fir" ref="4ad986b7f644d3e22e75b0744b2f948a" args="(void)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Fir.html#4ad986b7f644d3e22e75b0744b2f948a">Fir</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor creates a zero-order pass-through "filter". <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Fir.html#6f47a21d9fa7641aad2872df70432265">Fir</a> (std::vector&lt; StkFloat &gt; &amp;coefficients)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Overloaded constructor which takes filter coefficients. <a href="#6f47a21d9fa7641aad2872df70432265"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2a9db698672fcac97a77d95f3891b68f"></a><!-- doxytag: member="stk::Fir::~Fir" ref="2a9db698672fcac97a77d95f3891b68f" args="(void)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Fir.html#2a9db698672fcac97a77d95f3891b68f">~Fir</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Class destructor. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Fir.html#a3f72042fb8b13e9dcc31acbff4e1672">setCoefficients</a> (std::vector&lt; StkFloat &gt; &amp;coefficients, bool clearState=false)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set filter coefficients. <a href="#a3f72042fb8b13e9dcc31acbff4e1672"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5182288d564977bf172439f6ecaf2377"></a><!-- doxytag: member="stk::Fir::lastOut" ref="5182288d564977bf172439f6ecaf2377" args="(void) const " -->
StkFloat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Fir.html#5182288d564977bf172439f6ecaf2377">lastOut</a> (void) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the last computed output value. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="fc5fd95f6bf72edaf4ee3060ca947793"></a><!-- doxytag: member="stk::Fir::tick" ref="fc5fd95f6bf72edaf4ee3060ca947793" args="(StkFloat input)" -->
StkFloat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Fir.html#fc5fd95f6bf72edaf4ee3060ca947793">tick</a> (StkFloat input)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Input one sample to the filter and return one output. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Fir.html#602e5ce0cd93f5103796ffd50ed8c988">tick</a> (<a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp;frames, unsigned int channel=0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Take a channel of the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> object as inputs to the filter and replace with corresponding outputs. <a href="#602e5ce0cd93f5103796ffd50ed8c988"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Fir.html#53bcdfc2e9ad757d2ec549529b7a9738">tick</a> (<a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp;iFrames, <a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp;oFrames, unsigned int iChannel=0, unsigned int oChannel=0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Take a channel of the <code>iFrames</code> object as inputs to the filter and write outputs to the <code>oFrames</code> object. <a href="#53bcdfc2e9ad757d2ec549529b7a9738"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
STK general finite impulse response filter class.
<p>
This class provides a generic digital filter structure that can be used to implement FIR filters. For filters with feedback terms, the <a class="el" href="classstk_1_1Iir.html" title="STK general infinite impulse response filter class.">Iir</a> class should be used.<p>
In particular, this class implements the standard difference equation:<p>
y[n] = b[0]*x[n] + ... + b[nb]*x[n-nb]<p>
The <em>gain</em> parameter is applied at the filter input and does not affect the coefficient values. The default gain value is 1.0. This structure results in one extra multiply per computed sample, but allows easy control of the overall filter gain.<p>
by Perry R. Cook and Gary P. Scavone, 1995 - 2009. <hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="6f47a21d9fa7641aad2872df70432265"></a><!-- doxytag: member="stk::Fir::Fir" ref="6f47a21d9fa7641aad2872df70432265" args="(std::vector&lt; StkFloat &gt; &amp;coefficients)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">stk::Fir::Fir </td>
<td>(</td>
<td class="paramtype">std::vector&lt; StkFloat &gt; &amp;&nbsp;</td>
<td class="paramname"> <em>coefficients</em> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Overloaded constructor which takes filter coefficients.
<p>
An <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> can be thrown if the coefficient vector size is zero.
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a3f72042fb8b13e9dcc31acbff4e1672"></a><!-- doxytag: member="stk::Fir::setCoefficients" ref="a3f72042fb8b13e9dcc31acbff4e1672" args="(std::vector&lt; StkFloat &gt; &amp;coefficients, bool clearState=false)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void stk::Fir::setCoefficients </td>
<td>(</td>
<td class="paramtype">std::vector&lt; StkFloat &gt; &amp;&nbsp;</td>
<td class="paramname"> <em>coefficients</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&nbsp;</td>
<td class="paramname"> <em>clearState</em> = <code>false</code></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set filter coefficients.
<p>
An <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> can be thrown if the coefficient vector size is zero. The internal state of the filter is not cleared unless the <em>clearState</em> flag is <code>true</code>.
</div>
</div><p>
<a class="anchor" name="602e5ce0cd93f5103796ffd50ed8c988"></a><!-- doxytag: member="stk::Fir::tick" ref="602e5ce0cd93f5103796ffd50ed8c988" args="(StkFrames &amp;frames, unsigned int channel=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp; stk::Fir::tick </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp;&nbsp;</td>
<td class="paramname"> <em>frames</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&nbsp;</td>
<td class="paramname"> <em>channel</em> = <code>0</code></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Take a channel of the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> object as inputs to the filter and replace with corresponding outputs.
<p>
The <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> argument reference is returned. The <code>channel</code> argument must be less than the number of channels in the <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>Implements <a class="el" href="classstk_1_1Filter.html#3260a238824c4a748ac057b84b7d3f21">stk::Filter</a>.</p>
</div>
</div><p>
<a class="anchor" name="53bcdfc2e9ad757d2ec549529b7a9738"></a><!-- doxytag: member="stk::Fir::tick" ref="53bcdfc2e9ad757d2ec549529b7a9738" args="(StkFrames &amp;iFrames, StkFrames &amp;oFrames, unsigned int iChannel=0, unsigned int oChannel=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp; stk::Fir::tick </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp;&nbsp;</td>
<td class="paramname"> <em>iFrames</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp;&nbsp;</td>
<td class="paramname"> <em>oFrames</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&nbsp;</td>
<td class="paramname"> <em>iChannel</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&nbsp;</td>
<td class="paramname"> <em>oChannel</em> = <code>0</code></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<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>
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.
</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Fir_8h-source.html">Fir.h</a></ul>
</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>
</table>
</BODY>
</HTML>