Mercurial > hg > aimc
view trunk/C++/api/html/index.html @ 597:359bcd461dd1
First commit. Refer to the api [1] 'Philosophy of the implementation' for information on the approach used to implement CARFAC in C++.
[1] aimc/C++/api/html/index.html
author | flatmax |
---|---|
date | Sat, 09 Feb 2013 23:53:48 +0000 |
parents | |
children | b4323584c9fa |
line wrap: on
line source
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>CARFAC C++: CARFAC C++</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectlogo"><img alt="Logo" src="icon.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CARFAC C++ </div> <div id="projectbrief">C++ implementation of CARFAC</div> </td> </tr> </tbody> </table> </div> <!-- Generated by Doxygen 1.7.6.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li class="current"><a href="index.html"><span>Main Page</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> initNavTree('index.html',''); </script> <div id="doc-content"> <div class="header"> <div class="headertitle"> <div class="title">CARFAC C++ </div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><dl class="author"><dt><b>Author:</b></dt><dd>{Matt Flax <flatmax@>} </dd></dl> <dl class="date"><dt><b>Date:</b></dt><dd>2013.02.08</dd></dl> <h2><a class="anchor" id="intro_sec"></a> Introduction</h2> <p>This C++ code implements Dick Lyon's CARFAC model for the peripheral hearing circuit.</p> <h2><a class="anchor" id="code_philo"></a> Philosophy of the implementation</h2> <h3><a class="anchor" id="dd"></a> Matching the design document</h3> <p>As requested by the CARFAC design description, this codebase uses Eigen to compute matrix/vector operations.</p> <h3><a class="anchor" id="oo"></a> Object oriented acritecture</h3> <p>Where possible common paradigms inherit from common Objects. This aims to minimise the amount of coding required to implement and modify CARFAC. For example, the <a class="el" href="classEarComponent.html">EarComponent</a> encapsulates the <a class="el" href="classCAR.html">CAR</a>, <a class="el" href="classAGC.html">AGC</a> and <a class="el" href="classIHC.html">IHC</a> where all of the have the common features of <a class="el" href="classCoefficients.html">Coefficients</a>, <a class="el" href="classParameters.html">Parameters</a> and <a class="el" href="classState.html">State</a>.</p> <h3><a class="anchor" id="cc"></a> Common code</h3> <p>Where possible typedefs, definitions, includes and namespace inclusions which are common to the code, or usefull outside of class definitions are put in the <a class="el" href="CARFACCommon_8H.html">CARFACCommon.H</a> file.</p> <h3><a class="anchor" id="fileNames"></a> File naming convention and header guards</h3> <p>C++ files in this codebase are named using the .C and .H suffixes (C code uses .c and .h).</p> <p>Header guards are labeled using the files name with '_' characters, for example.H would become EXAMPLE_H_.</p> <h3><a class="anchor" id="globalVars"></a> Global variables</h3> <p>In general the use of global variables is discouraged. Where possible the code must be instantiated many times on the same computer system and the use of global variables complicates having multiple instances of shared library classes.</p> <h3><a class="anchor" id="cvns"></a> Class and variable naming convention</h3> <p>In general, classes begin with capitol letters and a variable name begis with a lower case character. The consider a class for example :</p> <div class="fragment"><pre class="fragment"> <span class="keyword">class </span>ForExample { <span class="keyword">class </span>def here }; ForExample forExample; <span class="keyword">class </span>OMG { <span class="keyword">class </span>def here }; OMG omg; <span class="comment">// here it is clear what is the type and what is the variable.</span> </pre></div><p>The class 'ForExample' is defined, and the variable name 'forExample' may be used in the code, which clearly indicates the type of the variable.</p> <p>The concept of labeling variables using 'p' for pointer, and type name references is not necessary, and in some cases discouraged. Consider for example, </p> <div class="fragment"><pre class="fragment"> <span class="keywordtype">float</span> *fs </pre></div><p> defining the pointer to the sample rate. If we were to use </p> <div class="fragment"><pre class="fragment"> <span class="keywordtype">float</span> * pFFs <span class="comment">// don't do this - difficult to see that pFFs references fs - the sample rate </span> </pre></div><p> , it becomes rather difficult to understand that pFFs actualy points to the sample rate.</p> <p>A deeper argument for using simple variable names (in C++) is as follows. Good engineers program classes and methods which are short and concise. As monitors (LCDs) get larger, most of your methods and in some cases classes are visible in one or two pages of your monitor. Consequently if the exact type of a variable named 'fs' needs to be found, it is as simple as looking at the top of your monitor or scrolling up a little to find a method's input variable name/type. In the case of class member variables, a class 'SoundCard' is expected to define a sound card. Consequently certain member variables are expected to exist, for example, fs, inputChannels, outputChannels and so on. If the actual types of these variables have been forgotten, then the header file is referenced, and this is normally as simple as a few key strokes to change from the SoundCard.C file to the SoundCard.H file to inspect the names and types of available member variables.</p> <dl class="copyright"><dt><b>Copyright:</b></dt><dd>{ <div class="fragment"><pre class="fragment"> Copyright 2013 Matt R. Flax <flatmax\@> All Rights Reserved. Author Matt Flax <flatmax@> This C++ file is part of an implementation of Lyon<span class="stringliteral">'s cochlear model:</span> <span class="stringliteral"></span> <span class="stringliteral"> "Cascade of Asymmetric Resonators with Fast-Acting Compression"</span> <span class="stringliteral"></span> <span class="stringliteral"> to supplement Lyon'</span>s upcoming book <span class="stringliteral">"Human and Machine Hearing"</span> Licensed under the Apache License, Version 2.0 (the <span class="stringliteral">"License"</span>); you may not use <span class="keyword">this</span> file except in compliance with the License. You may obtain a copy of the License at http:<span class="comment">//www.apache.org/licenses/LICENSE-2.0</span> Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an <span class="stringliteral">"AS IS"</span> BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License <span class="keywordflow">for</span> the specific language governing permissions and limitations under the License. </pre></div>} </dd></dl> </div></div><!-- contents --> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Defines</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div> <div id="nav-path" class="navpath"> <ul> <li class="footer">Generated on Sun Feb 10 2013 10:47:46 for CARFAC C++ by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li> </ul> </div> </body> </html>