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

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

doc

RevLine 
[353]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: rec_syst_conv_code.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>rec_syst_conv_code.h</h1><a href="rec__syst__conv__code_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 REC_SYST_CONV_CODE_H</span>
67<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define REC_SYST_CONV_CODE_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 <span class="preprocessor">#include &lt;<a class="code" href="convcode_8h.html" title="Definition of a binary convolutional encoder class.">itpp/comm/convcode.h</a>&gt;</span>
72<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;<a class="code" href="llr_8h.html" title="Class for numerically efficient log-likelihood algebra.">itpp/comm/llr.h</a>&gt;</span>
73<a name="l00036"></a>00036
74<a name="l00037"></a>00037
75<a name="l00038"></a>00038 <span class="keyword">namespace </span>itpp
76<a name="l00039"></a>00039 {
77<a name="l00040"></a>00040
78<a name="l00051"></a><a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html">00051</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html" title="A Recursive Systematic Convolutional Encoder/Decoder class.">Rec_Syst_Conv_Code</a>
79<a name="l00052"></a>00052 {
80<a name="l00053"></a>00053 <span class="keyword">public</span>:
81<a name="l00054"></a>00054
82<a name="l00056"></a><a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html#78533fa058871b0389072e25c5e87fb9">00056</a>   <a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html#78533fa058871b0389072e25c5e87fb9" title="Class constructor.">Rec_Syst_Conv_Code</a>(): infinity(1e30) {}
83<a name="l00057"></a>00057
84<a name="l00059"></a><a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html#22a6014339d8b5c920eac189e868c11c">00059</a>   <span class="keyword">virtual</span> <a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html#22a6014339d8b5c920eac189e868c11c" title="Class constructor.">~Rec_Syst_Conv_Code</a>() {}
85<a name="l00060"></a>00060
86<a name="l00069"></a>00069   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html#13d3ee61d778b62f3c2c259dfe4a71d3" title="Set generator polynomials.">set_generator_polynomials</a>(<span class="keyword">const</span> ivec &amp;gen, <span class="keywordtype">int</span> constraint_length);
87<a name="l00070"></a>00070
88<a name="l00077"></a>00077   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html#d185b255dcc178cc3933ae430ce0620d" title="Sets the channel parameters needed for MAP-decoding.">set_awgn_channel_parameters</a>(<span class="keywordtype">double</span> Ec, <span class="keywordtype">double</span> N0);
89<a name="l00078"></a>00078
90<a name="l00084"></a>00084   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html#f1e3fba48b14c660a56f168e2e878aa2" title="Set scaling factor for the decoder.">set_scaling_factor</a>(<span class="keywordtype">double</span> in_Lc);
91<a name="l00085"></a>00085
92<a name="l00089"></a>00089   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html#ca7a39ac196545676826c1a16eab8026" title="Set the lookup table for algebra with quantized LLR values (see LLR_calc_unit class)...">set_llrcalc</a>(<a class="code" href="classitpp_1_1LLR__calc__unit.html" title="Log-likelihood algebra calculation unit.">LLR_calc_unit</a> in_llrcalc);
93<a name="l00090"></a>00090
94<a name="l00098"></a>00098   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html#472b5db0388ab3670860f942a756f92b" title="Encode a binary vector of inputs and also adds a tail of K-1 zeros to force the encoder...">encode_tail</a>(<span class="keyword">const</span> bvec &amp;input, bvec &amp;tail, <a class="code" href="mat_8h.html#f90acd1af41bf2d1d8a4bb23662fff69" title="bin matrix">bmat</a> &amp;parity_bits);
95<a name="l00099"></a>00099
96<a name="l00103"></a>00103   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html#2c0878dc5b23f28baa52ac56f55db444" title="Encode a binary vector of inputs starting from zero state without adding of a tail...">encode</a>(<span class="keyword">const</span> bvec &amp;input, <a class="code" href="mat_8h.html#f90acd1af41bf2d1d8a4bb23662fff69" title="bin matrix">bmat</a> &amp;parity_bits);
97<a name="l00104"></a>00104
98<a name="l00120"></a>00120   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html#12c825eac22df94cbc1c5b7518dea14d" title="Maximum A Posteriori (MAP) Probability symbol-by-symbol decoder.">map_decode</a>(<span class="keyword">const</span> vec &amp;rec_systematic, <span class="keyword">const</span> mat &amp;rec_parity, <span class="keyword">const</span> vec &amp;extrinsic_input, vec &amp;extrinsic_output,
99<a name="l00121"></a>00121                           <span class="keywordtype">bool</span> set_terminated = <span class="keyword">false</span>);
100<a name="l00122"></a>00122
101<a name="l00141"></a>00141   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html#f3e37cf8d01e9e79ebfcd93a3e8ebd4c" title="Log domain implementation of the Maximum A Posteriori (MAP) Probability symbol-by-symbol...">log_decode</a>(<span class="keyword">const</span> vec &amp;rec_systematic, <span class="keyword">const</span> mat &amp;rec_parity, <span class="keyword">const</span> vec &amp;extrinsic_input,
102<a name="l00142"></a>00142                           vec &amp;extrinsic_output, <span class="keywordtype">bool</span> set_terminated = <span class="keyword">false</span>, std::string metric = <span class="stringliteral">"LOGMAX"</span>);
103<a name="l00143"></a>00143
104<a name="l00158"></a>00158   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html#b39d08e50d99f8fc83296ea8af338fa6" title="Special Log-MAP/Log-MAX decoder implementation for n = 2.">log_decode_n2</a>(<span class="keyword">const</span> vec &amp;rec_systematic,
105<a name="l00159"></a>00159                              <span class="keyword">const</span> vec &amp;rec_parity,
106<a name="l00160"></a>00160                              <span class="keyword">const</span> vec &amp;extrinsic_input,
107<a name="l00161"></a>00161                              vec &amp;extrinsic_output,
108<a name="l00162"></a>00162                              <span class="keywordtype">bool</span> set_terminated = <span class="keyword">false</span>,
109<a name="l00163"></a>00163                              std::string metric = <span class="stringliteral">"LOGMAX"</span>);
110<a name="l00164"></a>00164
111<a name="l00165"></a>00165   <span class="comment">// ===== EGL: ADDED FUNCTIONS NOV 2005 (THESE ARE DERIVATIVES OF EXISTING FUNCTIONS) ======</span>
112<a name="l00166"></a>00166
113<a name="l00179"></a>00179   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html#f3e37cf8d01e9e79ebfcd93a3e8ebd4c" title="Log domain implementation of the Maximum A Posteriori (MAP) Probability symbol-by-symbol...">log_decode</a>(<span class="keyword">const</span> QLLRvec &amp;rec_systematic,
114<a name="l00180"></a>00180                           <span class="keyword">const</span> QLLRmat &amp;rec_parity,
115<a name="l00181"></a>00181                           <span class="keyword">const</span> QLLRvec &amp;extrinsic_input,
116<a name="l00182"></a>00182                           QLLRvec &amp;extrinsic_output,
117<a name="l00183"></a>00183                           <span class="keywordtype">bool</span> set_terminated = <span class="keyword">false</span>);
118<a name="l00184"></a>00184
119<a name="l00197"></a>00197   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html#b39d08e50d99f8fc83296ea8af338fa6" title="Special Log-MAP/Log-MAX decoder implementation for n = 2.">log_decode_n2</a>(<span class="keyword">const</span> QLLRvec &amp;rec_systematic,
120<a name="l00198"></a>00198                              <span class="keyword">const</span> QLLRvec &amp;rec_parity,
121<a name="l00199"></a>00199                              <span class="keyword">const</span> QLLRvec &amp;extrinsic_input,
122<a name="l00200"></a>00200                              QLLRvec &amp;extrinsic_output,
123<a name="l00201"></a>00201                              <span class="keywordtype">bool</span> set_terminated = <span class="keyword">false</span>);
124<a name="l00202"></a>00202
125<a name="l00203"></a>00203   <span class="comment">// ========================================================</span>
126<a name="l00204"></a>00204
127<a name="l00206"></a><a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html#7d14d798bc1cedcbff45d15bac054f4a">00206</a>   <a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html" title="A Recursive Systematic Convolutional Encoder/Decoder class.">Rec_Syst_Conv_Code</a> &amp; <a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html#7d14d798bc1cedcbff45d15bac054f4a" title="Dummy assignment operator - MSVC++ warning C4512.">operator=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html" title="A Recursive Systematic Convolutional Encoder/Decoder class.">Rec_Syst_Conv_Code</a> &amp;) { <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
128<a name="l00207"></a>00207
129<a name="l00208"></a>00208 <span class="keyword">private</span>:
130<a name="l00210"></a>00210   <span class="keywordtype">int</span> calc_state_transition(<span class="keyword">const</span> <span class="keywordtype">int</span> instate, <span class="keyword">const</span> <span class="keywordtype">int</span> input, ivec &amp;parity);
131<a name="l00211"></a>00211
132<a name="l00212"></a>00212   <span class="keywordtype">int</span> n, K, m;
133<a name="l00213"></a>00213   ivec gen_pol, gen_pol_rev;
134<a name="l00214"></a>00214   <span class="keywordtype">int</span> encoder_state, Nstates;
135<a name="l00215"></a>00215   <span class="keywordtype">double</span> rate, Lc;
136<a name="l00216"></a>00216   imat state_trans, output_parity, rev_state_trans, rev_output_parity;
137<a name="l00217"></a>00217   <span class="keywordtype">bool</span> terminated;
138<a name="l00218"></a>00218   mat gamma, alpha, beta;
139<a name="l00219"></a>00219   QLLRmat gamma_q, alpha_q, beta_q;
140<a name="l00220"></a>00220   vec denom;
141<a name="l00221"></a>00221   QLLRvec denom_q;
142<a name="l00222"></a>00222   <span class="keywordtype">double</span> ln2;
143<a name="l00223"></a>00223
144<a name="l00228"></a>00228   <a class="code" href="classitpp_1_1LLR__calc__unit.html" title="Log-likelihood algebra calculation unit.">LLR_calc_unit</a> llrcalc;
145<a name="l00229"></a>00229
146<a name="l00230"></a>00230   <span class="comment">// This const value replaces INT definition used previously</span>
147<a name="l00231"></a>00231   <span class="keyword">const</span> <span class="keywordtype">double</span> infinity;
148<a name="l00232"></a>00232 };
149<a name="l00233"></a>00233
150<a name="l00234"></a>00234 } <span class="comment">// namespace itpp</span>
151<a name="l00235"></a>00235
152<a name="l00236"></a>00236 <span class="preprocessor">#endif // #ifndef REC_SYST_CONV_CODE_H</span>
153</pre></div></div>
154<hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:12 2009 for mixpp by&nbsp;
155<a href="http://www.doxygen.org/index.html">
156<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
157</body>
158</html>
Note: See TracBrowser for help on using the browser.