[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: turbo.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 | <!-- |
---|
| 10 | function 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 | } |
---|
| 22 | function 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 | } |
---|
| 46 | window.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 Page</span></a></li> |
---|
| 53 | <li><a href="pages.html"><span>Related 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 List</span></a></li> |
---|
| 62 | <li><a href="globals.html"><span>File Members</span></a></li> |
---|
| 63 | </ul> |
---|
| 64 | </div> |
---|
| 65 | <h1>turbo.h</h1><a href="turbo_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 TURBO_H</span> |
---|
| 67 | <a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define TURBO_H</span> |
---|
| 68 | <a name="l00031"></a>00031 <span class="preprocessor"></span> |
---|
| 69 | <a name="l00032"></a>00032 <span class="preprocessor">#include <<a class="code" href="rec__syst__conv__code_8h.html" title="Definitions of a Recursive Systematic Convolutional codec class.">itpp/comm/rec_syst_conv_code.h</a>></span> |
---|
| 70 | <a name="l00033"></a>00033 <span class="preprocessor">#include <<a class="code" href="interleave_8h.html" title="Definitions of interleaver classes.">itpp/comm/interleave.h</a>></span> |
---|
| 71 | <a name="l00034"></a>00034 <span class="preprocessor">#include <<a class="code" href="llr_8h.html" title="Class for numerically efficient log-likelihood algebra.">itpp/comm/llr.h</a>></span> |
---|
| 72 | <a name="l00035"></a>00035 |
---|
| 73 | <a name="l00036"></a>00036 |
---|
| 74 | <a name="l00037"></a>00037 <span class="keyword">namespace </span>itpp |
---|
| 75 | <a name="l00038"></a>00038 { |
---|
| 76 | <a name="l00039"></a>00039 |
---|
| 77 | <a name="l00054"></a><a class="code" href="classitpp_1_1Turbo__Codec.html">00054</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1Turbo__Codec.html" title="Turbo encoder/decoder ClassTo set up the turbo encoder used in e.g. WCDMA the following...">Turbo_Codec</a> |
---|
| 78 | <a name="l00055"></a>00055 { |
---|
| 79 | <a name="l00056"></a>00056 <span class="keyword">public</span>: |
---|
| 80 | <a name="l00057"></a>00057 |
---|
| 81 | <a name="l00059"></a><a class="code" href="classitpp_1_1Turbo__Codec.html#802079855069ba583ecabc0b87281c9b">00059</a> <a class="code" href="classitpp_1_1Turbo__Codec.html#802079855069ba583ecabc0b87281c9b" title="Class constructor.">Turbo_Codec</a>(<span class="keywordtype">void</span>) {} |
---|
| 82 | <a name="l00060"></a>00060 |
---|
| 83 | <a name="l00062"></a><a class="code" href="classitpp_1_1Turbo__Codec.html#1cfebb8122e48404eb685633a9695973">00062</a> <span class="keyword">virtual</span> <a class="code" href="classitpp_1_1Turbo__Codec.html#1cfebb8122e48404eb685633a9695973" title="Class destructor.">~Turbo_Codec</a>(<span class="keywordtype">void</span>) {} |
---|
| 84 | <a name="l00063"></a>00063 |
---|
| 85 | <a name="l00084"></a>00084 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Turbo__Codec.html#d06b57aa228a2f4984b87cccd7e26d53" title="Set parameters for the turbo encoder/decoder.">set_parameters</a>(ivec gen1, ivec gen2, <span class="keywordtype">int</span> constraint_length, |
---|
| 86 | <a name="l00085"></a>00085 <span class="keyword">const</span> ivec &interleaver_sequence, <span class="keywordtype">int</span> in_iterations = 8, |
---|
| 87 | <a name="l00086"></a>00086 std::string in_metric = <span class="stringliteral">"LOGMAX"</span>, <span class="keywordtype">double</span> in_logmax_scale_factor = 1.0, |
---|
| 88 | <a name="l00087"></a>00087 <span class="keywordtype">bool</span> in_adaptive_stop = <span class="keyword">false</span>, <a class="code" href="classitpp_1_1LLR__calc__unit.html" title="Log-likelihood algebra calculation unit.">LLR_calc_unit</a> lcalc = <a class="code" href="classitpp_1_1LLR__calc__unit.html" title="Log-likelihood algebra calculation unit.">LLR_calc_unit</a>()); |
---|
| 89 | <a name="l00088"></a>00088 |
---|
| 90 | <a name="l00095"></a>00095 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Turbo__Codec.html#8fe840d1a8a93baadd8b53f479ddc9dd" title="Set a new internal interleaver sequence for the turbo encoder/decoder.">set_interleaver</a>(<span class="keyword">const</span> ivec &interleaver_sequence); |
---|
| 91 | <a name="l00096"></a>00096 |
---|
| 92 | <a name="l00109"></a>00109 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Turbo__Codec.html#31ea59c9a56e20d8016efd730204d1c2" title="Set the decoder metric.">set_metric</a>(std::string in_metric = <span class="stringliteral">"LOGMAX"</span>, <span class="keywordtype">double</span> in_logmax_scale_factor = 1.0, |
---|
| 93 | <a name="l00110"></a>00110 <a class="code" href="classitpp_1_1LLR__calc__unit.html" title="Log-likelihood algebra calculation unit.">LLR_calc_unit</a> lcalc = <a class="code" href="classitpp_1_1LLR__calc__unit.html" title="Log-likelihood algebra calculation unit.">LLR_calc_unit</a>()); |
---|
| 94 | <a name="l00111"></a>00111 |
---|
| 95 | <a name="l00115"></a>00115 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Turbo__Codec.html#28962bbc5c084cf3a7d1d1b22a8657a6" title="Sets the number of decoding iterations. Default value is 8.">set_iterations</a>(<span class="keywordtype">int</span> in_iterations = 8); |
---|
| 96 | <a name="l00116"></a>00116 |
---|
| 97 | <a name="l00123"></a>00123 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Turbo__Codec.html#60f04c11332860b10e2f44aac414604a" title="Use and adaptive number of iterations.">set_adaptive_stop</a>(<span class="keywordtype">bool</span> in_adaptive_stop = <span class="keyword">true</span>); |
---|
| 98 | <a name="l00124"></a>00124 |
---|
| 99 | <a name="l00131"></a>00131 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Turbo__Codec.html#5628f72b58efd0425cbf94e6db23e57e" title="Set parameters for decoding on an AWGN channel.">set_awgn_channel_parameters</a>(<span class="keywordtype">double</span> in_Ec, <span class="keywordtype">double</span> in_N0); |
---|
| 100 | <a name="l00132"></a>00132 |
---|
| 101 | <a name="l00155"></a>00155 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Turbo__Codec.html#ea92e6bef3a0d537eccd49d5ef6d09c4" title="Set scaling factor for decoding on e.g. Rayleigh fading channels.">set_scaling_factor</a>(<span class="keywordtype">double</span> in_Lc); |
---|
| 102 | <a name="l00156"></a>00156 |
---|
| 103 | <a name="l00176"></a>00176 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Turbo__Codec.html#1d60ee8b4c48a768850e2915b6193fc8" title="Encoder function.">encode</a>(<span class="keyword">const</span> bvec &input, bvec &output); |
---|
| 104 | <a name="l00177"></a>00177 |
---|
| 105 | <a name="l00189"></a>00189 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Turbo__Codec.html#fc1136d97669fcdc0a7a72e8b27ed450" title="Decoder function.">decode</a>(<span class="keyword">const</span> vec &received_signal, bvec &decoded_bits, <span class="keyword">const</span> bvec &true_bits = <span class="stringliteral">"0"</span>); |
---|
| 106 | <a name="l00190"></a>00190 |
---|
| 107 | <a name="l00203"></a>00203 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Turbo__Codec.html#fc1136d97669fcdc0a7a72e8b27ed450" title="Decoder function.">decode</a>(<span class="keyword">const</span> vec &received_signal, bvec &decoded_bits, ivec &nrof_used_iterations, |
---|
| 108 | <a name="l00204"></a>00204 <span class="keyword">const</span> bvec &true_bits = <span class="stringliteral">"0"</span>); |
---|
| 109 | <a name="l00205"></a>00205 |
---|
| 110 | <a name="l00222"></a>00222 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Turbo__Codec.html#dba243060d5bbf6076173e6d48589f7b" title="Encode a single block.">encode_block</a>(<span class="keyword">const</span> bvec &input, bvec &in1, bvec &in2, <a class="code" href="mat_8h.html#f90acd1af41bf2d1d8a4bb23662fff69" title="bin matrix">bmat</a> &parity1, <a class="code" href="mat_8h.html#f90acd1af41bf2d1d8a4bb23662fff69" title="bin matrix">bmat</a> &parity2); |
---|
| 111 | <a name="l00223"></a>00223 |
---|
| 112 | <a name="l00253"></a>00253 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Turbo__Codec.html#3e5e49a33be7d478a15b4d3b4168f7eb" title="Decode a single block.">decode_block</a>(<span class="keyword">const</span> vec &rec_syst1, <span class="keyword">const</span> vec &rec_syst2, <span class="keyword">const</span> mat &rec_parity1, <span class="keyword">const</span> mat &rec_parity2, |
---|
| 113 | <a name="l00254"></a>00254 <a class="code" href="mat_8h.html#f90acd1af41bf2d1d8a4bb23662fff69" title="bin matrix">bmat</a> &decoded_bits_i, <span class="keywordtype">int</span> &nrof_used_iterations_i, <span class="keyword">const</span> bvec &true_bits = <span class="stringliteral">"0"</span>); |
---|
| 114 | <a name="l00255"></a>00255 |
---|
| 115 | <a name="l00257"></a><a class="code" href="classitpp_1_1Turbo__Codec.html#6b835939de5517fd6546035688ca30e3">00257</a> <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1Turbo__Codec.html#6b835939de5517fd6546035688ca30e3" title="Get number of coded bits.">get_Ncoded</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> Ncoded; } |
---|
| 116 | <a name="l00258"></a>00258 |
---|
| 117 | <a name="l00260"></a><a class="code" href="classitpp_1_1Turbo__Codec.html#50198727339a68f0e38e278ea69b440c">00260</a> <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1Turbo__Codec.html#50198727339a68f0e38e278ea69b440c" title="Get number of uncoded bits.">get_Nuncoded</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> Nuncoded; } |
---|
| 118 | <a name="l00261"></a>00261 |
---|
| 119 | <a name="l00262"></a>00262 <span class="keyword">private</span>: |
---|
| 120 | <a name="l00263"></a>00263 |
---|
| 121 | <a name="l00267"></a>00267 <span class="keywordtype">void</span> decode_n3(<span class="keyword">const</span> vec &received_signal, bvec &decoded_bits, ivec &nrof_used_iterations, |
---|
| 122 | <a name="l00268"></a>00268 <span class="keyword">const</span> bvec &true_bits = <span class="stringliteral">"0"</span>); |
---|
| 123 | <a name="l00269"></a>00269 |
---|
| 124 | <a name="l00270"></a>00270 <span class="comment">//Scalars:</span> |
---|
| 125 | <a name="l00271"></a>00271 <span class="keywordtype">int</span> interleaver_size; |
---|
| 126 | <a name="l00272"></a>00272 <span class="keywordtype">int</span> Ncoded, Nuncoded; |
---|
| 127 | <a name="l00273"></a>00273 <span class="keywordtype">int</span> m_tail, n1, n2, n_tot, iterations; |
---|
| 128 | <a name="l00274"></a>00274 <span class="keywordtype">double</span> Ec, N0, Lc, R, logmax_scale_factor; |
---|
| 129 | <a name="l00275"></a>00275 <span class="keywordtype">bool</span> adaptive_stop; |
---|
| 130 | <a name="l00276"></a>00276 std::string metric; |
---|
| 131 | <a name="l00277"></a>00277 |
---|
| 132 | <a name="l00278"></a>00278 <span class="comment">//Vectors:</span> |
---|
| 133 | <a name="l00279"></a>00279 bvec decoded_bits_previous_iteration; |
---|
| 134 | <a name="l00280"></a>00280 |
---|
| 135 | <a name="l00281"></a>00281 <span class="comment">//Classes:</span> |
---|
| 136 | <a name="l00282"></a>00282 <a class="code" href="classitpp_1_1Rec__Syst__Conv__Code.html" title="A Recursive Systematic Convolutional Encoder/Decoder class.">Rec_Syst_Conv_Code</a> rscc1, rscc2; |
---|
| 137 | <a name="l00283"></a>00283 <a class="code" href="classitpp_1_1Sequence__Interleaver.html">Sequence_Interleaver<bin></a> bit_interleaver; |
---|
| 138 | <a name="l00284"></a>00284 <a class="code" href="classitpp_1_1Sequence__Interleaver.html">Sequence_Interleaver<double></a> float_interleaver; |
---|
| 139 | <a name="l00285"></a>00285 }; |
---|
| 140 | <a name="l00286"></a>00286 |
---|
| 141 | <a name="l00291"></a>00291 ivec wcdma_turbo_interleaver_sequence(<span class="keywordtype">int</span> interleaver_size); |
---|
| 142 | <a name="l00292"></a>00292 |
---|
| 143 | <a name="l00293"></a>00293 } <span class="comment">// namespace itpp</span> |
---|
| 144 | <a name="l00294"></a>00294 |
---|
| 145 | <a name="l00295"></a>00295 <span class="preprocessor">#endif // #ifndef TURBO_H</span> |
---|
| 146 | </pre></div></div> |
---|
| 147 | <hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:13 2009 for mixpp by |
---|
| 148 | <a href="http://www.doxygen.org/index.html"> |
---|
| 149 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> |
---|
| 150 | </body> |
---|
| 151 | </html> |
---|