annotate trunk/C++/api/html/index.html @ 618:e01caec17186

Added JSON output for use with node.js and backbone.js
author sness@sness.net
date Fri, 10 May 2013 20:12:49 +0000
parents b4323584c9fa
children
rev   line source
flatmax@597 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
flatmax@597 2 <html xmlns="http://www.w3.org/1999/xhtml">
flatmax@597 3 <head>
flatmax@597 4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
flatmax@597 5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
flatmax@597 6 <title>CARFAC C++: CARFAC C++</title>
flatmax@597 7
flatmax@597 8 <link href="tabs.css" rel="stylesheet" type="text/css"/>
flatmax@597 9 <link href="doxygen.css" rel="stylesheet" type="text/css" />
flatmax@597 10 <link href="navtree.css" rel="stylesheet" type="text/css"/>
flatmax@597 11 <script type="text/javascript" src="jquery.js"></script>
flatmax@597 12 <script type="text/javascript" src="resize.js"></script>
flatmax@597 13 <script type="text/javascript" src="navtree.js"></script>
flatmax@597 14 <script type="text/javascript">
flatmax@597 15 $(document).ready(initResizable);
flatmax@597 16 </script>
flatmax@597 17 <link href="search/search.css" rel="stylesheet" type="text/css"/>
flatmax@597 18 <script type="text/javascript" src="search/search.js"></script>
flatmax@597 19 <script type="text/javascript">
flatmax@597 20 $(document).ready(function() { searchBox.OnSelectItem(0); });
flatmax@597 21 </script>
flatmax@597 22
flatmax@597 23 </head>
flatmax@597 24 <body>
flatmax@597 25 <div id="top"><!-- do not remove this div! -->
flatmax@597 26
flatmax@597 27
flatmax@597 28 <div id="titlearea">
flatmax@597 29 <table cellspacing="0" cellpadding="0">
flatmax@597 30 <tbody>
flatmax@597 31 <tr style="height: 56px;">
flatmax@597 32
flatmax@597 33 <td id="projectlogo"><img alt="Logo" src="icon.png"/></td>
flatmax@597 34
flatmax@597 35
flatmax@597 36 <td style="padding-left: 0.5em;">
flatmax@597 37 <div id="projectname">CARFAC C++
flatmax@597 38
flatmax@597 39 </div>
flatmax@597 40 <div id="projectbrief">C++ implementation of CARFAC</div>
flatmax@597 41 </td>
flatmax@597 42
flatmax@597 43
flatmax@597 44
flatmax@597 45 </tr>
flatmax@597 46 </tbody>
flatmax@597 47 </table>
flatmax@597 48 </div>
flatmax@597 49
flatmax@597 50 <!-- Generated by Doxygen 1.7.6.1 -->
flatmax@597 51 <script type="text/javascript">
flatmax@597 52 var searchBox = new SearchBox("searchBox", "search",false,'Search');
flatmax@597 53 </script>
flatmax@597 54 <div id="navrow1" class="tabs">
flatmax@597 55 <ul class="tablist">
flatmax@597 56 <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
flatmax@597 57 <li><a href="annotated.html"><span>Classes</span></a></li>
flatmax@597 58 <li><a href="files.html"><span>Files</span></a></li>
flatmax@597 59 <li>
flatmax@597 60 <div id="MSearchBox" class="MSearchBoxInactive">
flatmax@597 61 <span class="left">
flatmax@597 62 <img id="MSearchSelect" src="search/mag_sel.png"
flatmax@597 63 onmouseover="return searchBox.OnSearchSelectShow()"
flatmax@597 64 onmouseout="return searchBox.OnSearchSelectHide()"
flatmax@597 65 alt=""/>
flatmax@597 66 <input type="text" id="MSearchField" value="Search" accesskey="S"
flatmax@597 67 onfocus="searchBox.OnSearchFieldFocus(true)"
flatmax@597 68 onblur="searchBox.OnSearchFieldFocus(false)"
flatmax@597 69 onkeyup="searchBox.OnSearchFieldChange(event)"/>
flatmax@597 70 </span><span class="right">
flatmax@597 71 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
flatmax@597 72 </span>
flatmax@597 73 </div>
flatmax@597 74 </li>
flatmax@597 75 </ul>
flatmax@597 76 </div>
flatmax@597 77 </div>
flatmax@597 78 <div id="side-nav" class="ui-resizable side-nav-resizable">
flatmax@597 79 <div id="nav-tree">
flatmax@597 80 <div id="nav-tree-contents">
flatmax@597 81 </div>
flatmax@597 82 </div>
flatmax@597 83 <div id="splitbar" style="-moz-user-select:none;"
flatmax@597 84 class="ui-resizable-handle">
flatmax@597 85 </div>
flatmax@597 86 </div>
flatmax@597 87 <script type="text/javascript">
flatmax@597 88 initNavTree('index.html','');
flatmax@597 89 </script>
flatmax@597 90 <div id="doc-content">
flatmax@597 91 <div class="header">
flatmax@597 92 <div class="headertitle">
flatmax@597 93 <div class="title">CARFAC C++ </div> </div>
flatmax@597 94 </div><!--header-->
flatmax@597 95 <div class="contents">
flatmax@597 96 <div class="textblock"><dl class="author"><dt><b>Author:</b></dt><dd>{Matt Flax &lt;flatmax@&gt;} </dd></dl>
flatmax@597 97 <dl class="date"><dt><b>Date:</b></dt><dd>2013.02.08</dd></dl>
flatmax@597 98 <h2><a class="anchor" id="intro_sec"></a>
flatmax@597 99 Introduction</h2>
flatmax@597 100 <p>This C++ code implements Dick Lyon's CARFAC model for the peripheral hearing circuit.</p>
flatmax@597 101 <h2><a class="anchor" id="code_philo"></a>
flatmax@597 102 Philosophy of the implementation</h2>
flatmax@597 103 <h3><a class="anchor" id="dd"></a>
flatmax@597 104 Matching the design document</h3>
flatmax@597 105 <p>As requested by the CARFAC design description, this codebase uses Eigen to compute matrix/vector operations.</p>
flatmax@597 106 <h3><a class="anchor" id="oo"></a>
flatmax@597 107 Object oriented acritecture</h3>
flatmax@597 108 <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>
flatmax@597 109 <h3><a class="anchor" id="cc"></a>
flatmax@597 110 Common code</h3>
flatmax@597 111 <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>
flatmax@597 112 <h3><a class="anchor" id="fileNames"></a>
flatmax@597 113 File naming convention and header guards</h3>
flatmax@597 114 <p>C++ files in this codebase are named using the .C and .H suffixes (C code uses .c and .h).</p>
flatmax@597 115 <p>Header guards are labeled using the files name with '_' characters, for example.H would become EXAMPLE_H_.</p>
flatmax@597 116 <h3><a class="anchor" id="globalVars"></a>
flatmax@597 117 Global variables</h3>
flatmax@597 118 <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>
flatmax@597 119 <h3><a class="anchor" id="cvns"></a>
flatmax@597 120 Class and variable naming convention</h3>
flatmax@597 121 <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>
flatmax@597 122 <div class="fragment"><pre class="fragment"> <span class="keyword">class </span>ForExample { <span class="keyword">class </span>def here };
flatmax@597 123
flatmax@597 124 ForExample forExample;
flatmax@597 125
flatmax@597 126 <span class="keyword">class </span>OMG { <span class="keyword">class </span>def here };
flatmax@597 127
flatmax@597 128 OMG omg; <span class="comment">// here it is clear what is the type and what is the variable.</span>
flatmax@597 129 </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>
flatmax@597 130 <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>
flatmax@597 131 <div class="fragment"><pre class="fragment"> <span class="keywordtype">float</span> *fs
flatmax@597 132 </pre></div><p> defining the pointer to the sample rate. If we were to use </p>
flatmax@597 133 <div class="fragment"><pre class="fragment"> <span class="keywordtype">float</span> * pFFs <span class="comment">// don&#39;t do this - difficult to see that pFFs references fs - the sample rate </span>
flatmax@597 134 </pre></div><p> , it becomes rather difficult to understand that pFFs actualy points to the sample rate.</p>
flatmax@597 135 <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>
flatmax@597 136 <dl class="copyright"><dt><b>Copyright:</b></dt><dd>{ <div class="fragment"><pre class="fragment"> Copyright 2013 Matt R. Flax &lt;flatmax\@&gt; All Rights Reserved.
flatmax@597 137
flatmax@597 138 Author Matt Flax &lt;flatmax@&gt;
flatmax@597 139
flatmax@597 140
flatmax@597 141 This C++ file is part of an implementation of Lyon<span class="stringliteral">&#39;s cochlear model:</span>
flatmax@597 142 <span class="stringliteral"></span>
flatmax@597 143 <span class="stringliteral"> &quot;Cascade of Asymmetric Resonators with Fast-Acting Compression&quot;</span>
flatmax@597 144 <span class="stringliteral"></span>
flatmax@597 145 <span class="stringliteral"> to supplement Lyon&#39;</span>s upcoming book <span class="stringliteral">&quot;Human and Machine Hearing&quot;</span>
flatmax@597 146
flatmax@597 147
flatmax@597 148 Licensed under the Apache License, Version 2.0 (the <span class="stringliteral">&quot;License&quot;</span>);
flatmax@597 149
flatmax@597 150 you may not use <span class="keyword">this</span> file except in compliance with the License.
flatmax@597 151
flatmax@597 152 You may obtain a copy of the License at
flatmax@597 153
flatmax@597 154
flatmax@597 155 http:<span class="comment">//www.apache.org/licenses/LICENSE-2.0</span>
flatmax@597 156
flatmax@597 157
flatmax@597 158 Unless required by applicable law or agreed to in writing, software
flatmax@597 159
flatmax@597 160 distributed under the License is distributed on an <span class="stringliteral">&quot;AS IS&quot;</span> BASIS,
flatmax@597 161
flatmax@597 162 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
flatmax@597 163
flatmax@597 164 See the License <span class="keywordflow">for</span> the specific language governing permissions and
flatmax@597 165
flatmax@597 166 limitations under the License.
flatmax@597 167 </pre></div>} </dd></dl>
flatmax@597 168 </div></div><!-- contents -->
flatmax@597 169 <!-- window showing the filter options -->
flatmax@597 170 <div id="MSearchSelectWindow"
flatmax@597 171 onmouseover="return searchBox.OnSearchSelectShow()"
flatmax@597 172 onmouseout="return searchBox.OnSearchSelectHide()"
flatmax@597 173 onkeydown="return searchBox.OnSearchSelectKey(event)">
flatmax@599 174 <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>
flatmax@597 175
flatmax@597 176 <!-- iframe showing the search results (closed by default) -->
flatmax@597 177 <div id="MSearchResultsWindow">
flatmax@597 178 <iframe src="javascript:void(0)" frameborder="0"
flatmax@597 179 name="MSearchResults" id="MSearchResults">
flatmax@597 180 </iframe>
flatmax@597 181 </div>
flatmax@597 182
flatmax@597 183 </div>
flatmax@597 184 <div id="nav-path" class="navpath">
flatmax@597 185 <ul>
flatmax@597 186
flatmax@599 187 <li class="footer">Generated on Thu Feb 21 2013 09:31:11 for CARFAC C++ by
flatmax@597 188 <a href="http://www.doxygen.org/index.html">
flatmax@597 189 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
flatmax@597 190 </ul>
flatmax@597 191 </div>
flatmax@597 192
flatmax@597 193
flatmax@597 194 </body>
flatmax@597 195 </html>