root/doc/html/sequence_8h-source.html @ 353

Revision 353, 13.1 kB (checked in by smidl, 16 years ago)

doc

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3<title>mixpp: sequence.h Source File</title>
4<link href="tabs.css" rel="stylesheet" type="text/css">
5<link href="doxygen.css" rel="stylesheet" type="text/css">
6</head><body>
7<!-- Generated by Doxygen 1.5.8 -->
8<script type="text/javascript">
9<!--
10function changeDisplayState (e){
11  var num=this.id.replace(/[^[0-9]/g,'');
12  var button=this.firstChild;
13  var sectionDiv=document.getElementById('dynsection'+num);
14  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
15    sectionDiv.style.display='block';
16    button.src='open.gif';
17  }else{
18    sectionDiv.style.display='none';
19    button.src='closed.gif';
20  }
21}
22function initDynSections(){
23  var divs=document.getElementsByTagName('div');
24  var sectionCounter=1;
25  for(var i=0;i<divs.length-1;i++){
26    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
27      var header=divs[i];
28      var section=divs[i+1];
29      var button=header.firstChild;
30      if (button!='IMG'){
31        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
32        button=document.createElement('img');
33        divs[i].insertBefore(button,divs[i].firstChild);
34      }
35      header.style.cursor='pointer';
36      header.onclick=changeDisplayState;
37      header.id='dynheader'+sectionCounter;
38      button.src='closed.gif';
39      section.id='dynsection'+sectionCounter;
40      section.style.display='none';
41      section.style.marginLeft='14px';
42      sectionCounter++;
43    }
44  }
45}
46window.onload = initDynSections;
47-->
48</script>
49<div class="navigation" id="top">
50  <div class="tabs">
51    <ul>
52      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
53      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
54      <li><a href="modules.html"><span>Modules</span></a></li>
55      <li><a href="annotated.html"><span>Classes</span></a></li>
56      <li class="current"><a href="files.html"><span>Files</span></a></li>
57    </ul>
58  </div>
59  <div class="tabs">
60    <ul>
61      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
62      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
63    </ul>
64  </div>
65<h1>sequence.h</h1><a href="sequence_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
66<a name="l00029"></a>00029 <span class="preprocessor">#ifndef SEQUENCE_H</span>
67<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define SEQUENCE_H</span>
68<a name="l00031"></a>00031 <span class="preprocessor"></span>
69<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;<a class="code" href="vec_8h.html" title="Templated Vector Class Definitions.">itpp/base/vec.h</a>&gt;</span>
70<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;<a class="code" href="mat_8h.html" title="Matrix Class Definitions.">itpp/base/mat.h</a>&gt;</span>
71<a name="l00034"></a>00034
72<a name="l00035"></a>00035
73<a name="l00036"></a>00036 <span class="keyword">namespace </span>itpp
74<a name="l00037"></a>00037 {
75<a name="l00038"></a>00038
76<a name="l00053"></a><a class="code" href="classitpp_1_1LFSR.html">00053</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1LFSR.html" title="Binary Linear Feedback Shift Register (LFSR)The LFSR is on Fibonacci form (see p...">LFSR</a>
77<a name="l00054"></a>00054 {
78<a name="l00055"></a>00055 <span class="keyword">public</span>:
79<a name="l00057"></a><a class="code" href="classitpp_1_1LFSR.html#5aa6d4018f70ea9c9bc2a6b3d1bb314a">00057</a>   <a class="code" href="classitpp_1_1LFSR.html#5aa6d4018f70ea9c9bc2a6b3d1bb314a" title="Constructor.">LFSR</a>(<span class="keywordtype">void</span>) {};
80<a name="l00059"></a>00059   <a class="code" href="classitpp_1_1LFSR.html#5aa6d4018f70ea9c9bc2a6b3d1bb314a" title="Constructor.">LFSR</a>(<span class="keyword">const</span> bvec &amp;connections);
81<a name="l00061"></a>00061   <a class="code" href="classitpp_1_1LFSR.html#5aa6d4018f70ea9c9bc2a6b3d1bb314a" title="Constructor.">LFSR</a>(<span class="keyword">const</span> ivec &amp;connections);
82<a name="l00063"></a>00063   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LFSR.html#1c128f87b923d94683d18cf55bd4b8a1" title="Input connect_polynomial=1+g1*D+g2*D^2+...+gr*D^r in bvec format [g0,g1,...,gr].">set_connections</a>(<span class="keyword">const</span> bvec &amp;connections);
83<a name="l00065"></a>00065   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LFSR.html#1c128f87b923d94683d18cf55bd4b8a1" title="Input connect_polynomial=1+g1*D+g2*D^2+...+gr*D^r in bvec format [g0,g1,...,gr].">set_connections</a>(<span class="keyword">const</span> ivec &amp;connections);
84<a name="l00067"></a>00067   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LFSR.html#5f21f161d25c9cb1f89509451191cb5f" title="Set state (contents in the shift registers) in bvec format.">set_state</a>(<span class="keyword">const</span> bvec &amp;state);
85<a name="l00069"></a>00069   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LFSR.html#5f21f161d25c9cb1f89509451191cb5f" title="Set state (contents in the shift registers) in bvec format.">set_state</a>(<span class="keyword">const</span> ivec &amp;state);
86<a name="l00071"></a>00071   <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> <a class="code" href="classitpp_1_1LFSR.html#ecd42303c0c904246ed3b050e7d8b565" title="Shift one step and output binary symbol.">shift</a>(<span class="keywordtype">void</span>);
87<a name="l00073"></a>00073   bvec <a class="code" href="classitpp_1_1LFSR.html#ecd42303c0c904246ed3b050e7d8b565" title="Shift one step and output binary symbol.">shift</a>(<span class="keywordtype">int</span> no_shifts);
88<a name="l00075"></a>00075   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LFSR.html#7c7b4b548929ed4197b79854b7fa18a9" title="Return length of shift register.">get_length</a>(<span class="keywordtype">void</span>);
89<a name="l00077"></a>00077   bvec <a class="code" href="classitpp_1_1LFSR.html#e25d175a228eac81496bdbba76167f28" title="Returns the state of the shift register.">get_state</a>(<span class="keywordtype">void</span>);
90<a name="l00078"></a>00078 <span class="keyword">private</span>:
91<a name="l00079"></a>00079   bvec memory, Connections;
92<a name="l00080"></a>00080 };
93<a name="l00081"></a>00081
94<a name="l00086"></a><a class="code" href="classitpp_1_1Gold.html">00086</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1Gold.html" title="Gold Sequences.">Gold</a>
95<a name="l00087"></a>00087 {
96<a name="l00088"></a>00088 <span class="keyword">public</span>:
97<a name="l00096"></a>00096   <a class="code" href="classitpp_1_1Gold.html#339ffa5ba7198a79c6a50055cc5e4e45" title="Class constructor.">Gold</a>(<span class="keywordtype">int</span> degree);
98<a name="l00098"></a>00098   <a class="code" href="classitpp_1_1Gold.html#339ffa5ba7198a79c6a50055cc5e4e45" title="Class constructor.">Gold</a>(<span class="keyword">const</span> bvec &amp;mseq1_connections, <span class="keyword">const</span> bvec &amp;mseq2_connections);
99<a name="l00100"></a>00100   <a class="code" href="classitpp_1_1Gold.html#339ffa5ba7198a79c6a50055cc5e4e45" title="Class constructor.">Gold</a>(<span class="keyword">const</span> ivec &amp;mseq1_connections, <span class="keyword">const</span> ivec &amp;mseq2_connections);
100<a name="l00102"></a>00102   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Gold.html#7686ff53c1a732f711e985fdb2c0d779" title="Set state (contents in the shift registers) in bvec format.">set_state</a>(<span class="keyword">const</span> bvec &amp;state1, <span class="keyword">const</span> bvec &amp;state2);
101<a name="l00104"></a>00104   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Gold.html#7686ff53c1a732f711e985fdb2c0d779" title="Set state (contents in the shift registers) in bvec format.">set_state</a>(<span class="keyword">const</span> ivec &amp;state1, <span class="keyword">const</span> ivec &amp;state2);
102<a name="l00106"></a>00106   <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> <a class="code" href="classitpp_1_1Gold.html#bbcd0420d216bcdaff0f6e73d974e6e1" title="Shift one step and output binary symbol.">shift</a>(<span class="keywordtype">void</span>);
103<a name="l00108"></a>00108   bvec <a class="code" href="classitpp_1_1Gold.html#bbcd0420d216bcdaff0f6e73d974e6e1" title="Shift one step and output binary symbol.">shift</a>(<span class="keywordtype">int</span> no_shifts);
104<a name="l00110"></a>00110   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1Gold.html#03c25591def454f8f37f3f4dd1061c9b" title="Returns the length (period) of a Gold-sequence.">get_sequence_length</a>(<span class="keywordtype">void</span>);
105<a name="l00118"></a>00118   <a class="code" href="mat_8h.html#f90acd1af41bf2d1d8a4bb23662fff69" title="bin matrix">bmat</a> <a class="code" href="classitpp_1_1Gold.html#d0b3acdae7420978a7a8114513a1e92d" title="Returns the code family.">get_family</a>(<span class="keywordtype">void</span>);
106<a name="l00119"></a>00119 <span class="keyword">private</span>:
107<a name="l00120"></a>00120   <span class="keywordtype">int</span> N;
108<a name="l00121"></a>00121   <a class="code" href="classitpp_1_1LFSR.html" title="Binary Linear Feedback Shift Register (LFSR)The LFSR is on Fibonacci form (see p...">LFSR</a> mseq1, mseq2;
109<a name="l00122"></a>00122 };
110<a name="l00123"></a>00123
111<a name="l00124"></a>00124 <span class="comment">// --------------- Inlines ---------------------</span>
112<a name="l00125"></a><a class="code" href="classitpp_1_1LFSR.html#ecd42303c0c904246ed3b050e7d8b565">00125</a> <span class="keyword">inline</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> <a class="code" href="classitpp_1_1LFSR.html#ecd42303c0c904246ed3b050e7d8b565" title="Shift one step and output binary symbol.">LFSR::shift</a>(<span class="keywordtype">void</span>) {<a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> temp = memory * Connections;memory.shift_right(temp);<span class="keywordflow">return</span> temp;}
113<a name="l00126"></a><a class="code" href="classitpp_1_1LFSR.html#7c7b4b548929ed4197b79854b7fa18a9">00126</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LFSR.html#7c7b4b548929ed4197b79854b7fa18a9" title="Return length of shift register.">LFSR::get_length</a>(<span class="keywordtype">void</span>) {<span class="keywordflow">return</span> memory.size();}
114<a name="l00127"></a><a class="code" href="classitpp_1_1LFSR.html#e25d175a228eac81496bdbba76167f28">00127</a> <span class="keyword">inline</span> bvec <a class="code" href="classitpp_1_1LFSR.html#e25d175a228eac81496bdbba76167f28" title="Returns the state of the shift register.">LFSR::get_state</a>(<span class="keywordtype">void</span>) {<span class="keywordflow">return</span> memory;}
115<a name="l00128"></a>00128
116<a name="l00129"></a><a class="code" href="classitpp_1_1Gold.html#bbcd0420d216bcdaff0f6e73d974e6e1">00129</a> <span class="keyword">inline</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> <a class="code" href="classitpp_1_1Gold.html#bbcd0420d216bcdaff0f6e73d974e6e1" title="Shift one step and output binary symbol.">Gold::shift</a>(<span class="keywordtype">void</span>) {<span class="keywordflow">return</span> (mseq1.<a class="code" href="classitpp_1_1LFSR.html#ecd42303c0c904246ed3b050e7d8b565" title="Shift one step and output binary symbol.">shift</a>() + mseq2.<a class="code" href="classitpp_1_1LFSR.html#ecd42303c0c904246ed3b050e7d8b565" title="Shift one step and output binary symbol.">shift</a>());}
117<a name="l00130"></a><a class="code" href="classitpp_1_1Gold.html#03c25591def454f8f37f3f4dd1061c9b">00130</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1Gold.html#03c25591def454f8f37f3f4dd1061c9b" title="Returns the length (period) of a Gold-sequence.">Gold::get_sequence_length</a>(<span class="keywordtype">void</span>) {<span class="keywordflow">return</span> N;}
118<a name="l00131"></a>00131
119<a name="l00132"></a>00132
120<a name="l00133"></a>00133 <span class="comment">// --------------- Functions ---------------------</span>
121<a name="l00134"></a>00134
122<a name="l00142"></a>00142 smat <a class="code" href="group__sequence.html#gd5cd3bdba8b1333b3a38bb63550ac3ec" title="Generates the OVSF (orthogonal variable spreading factor) spreading codes used in...">wcdma_spreading_codes</a>(<span class="keywordtype">int</span> SF);
123<a name="l00143"></a>00143
124<a name="l00144"></a>00144 } <span class="comment">// namespace itpp</span>
125<a name="l00145"></a>00145
126<a name="l00146"></a>00146 <span class="preprocessor">#endif // #ifndef SEQUENCE_H</span>
127</pre></div></div>
128<hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:12 2009 for mixpp by&nbsp;
129<a href="http://www.doxygen.org/index.html">
130<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
131</body>
132</html>
Note: See TracBrowser for help on using the browser.