[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: itpp::Turbo_Codec Class Reference</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 class="current"><a href="annotated.html"><span>Classes</span></a></li> |
---|
| 56 | <li><a href="files.html"><span>Files</span></a></li> |
---|
| 57 | </ul> |
---|
| 58 | </div> |
---|
| 59 | <div class="tabs"> |
---|
| 60 | <ul> |
---|
| 61 | <li><a href="annotated.html"><span>Class List</span></a></li> |
---|
| 62 | <li><a href="classes.html"><span>Class Index</span></a></li> |
---|
| 63 | <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> |
---|
| 64 | <li><a href="functions.html"><span>Class Members</span></a></li> |
---|
| 65 | </ul> |
---|
| 66 | </div> |
---|
| 67 | <div class="navpath"><b>itpp</b>::<a class="el" href="classitpp_1_1Turbo__Codec.html">Turbo_Codec</a> |
---|
| 68 | </div> |
---|
| 69 | </div> |
---|
| 70 | <div class="contents"> |
---|
| 71 | <h1>itpp::Turbo_Codec Class Reference<br> |
---|
| 72 | <small> |
---|
| 73 | [<a class="el" href="group__fec.html">Forward Error Correcting Codes</a>]</small> |
---|
| 74 | </h1><!-- doxytag: class="itpp::Turbo_Codec" -->Turbo encoder/decoder Class<p> |
---|
| 75 | To set up the turbo encoder used in e.g. WCDMA the following code can be used (assuming a code block size of 320 bits):. |
---|
| 76 | <a href="#_details">More...</a> |
---|
| 77 | <p> |
---|
| 78 | <code>#include <<a class="el" href="turbo_8h-source.html">turbo.h</a>></code> |
---|
| 79 | <p> |
---|
| 80 | |
---|
| 81 | <p> |
---|
| 82 | <a href="classitpp_1_1Turbo__Codec-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> |
---|
| 83 | <tr><td></td></tr> |
---|
| 84 | <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> |
---|
| 85 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="802079855069ba583ecabc0b87281c9b"></a><!-- doxytag: member="itpp::Turbo_Codec::Turbo_Codec" ref="802079855069ba583ecabc0b87281c9b" args="(void)" --> |
---|
| 86 | </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Turbo__Codec.html#802079855069ba583ecabc0b87281c9b">Turbo_Codec</a> (void)</td></tr> |
---|
| 87 | |
---|
| 88 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Class constructor. <br></td></tr> |
---|
| 89 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1cfebb8122e48404eb685633a9695973"></a><!-- doxytag: member="itpp::Turbo_Codec::~Turbo_Codec" ref="1cfebb8122e48404eb685633a9695973" args="(void)" --> |
---|
| 90 | virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Turbo__Codec.html#1cfebb8122e48404eb685633a9695973">~Turbo_Codec</a> (void)</td></tr> |
---|
| 91 | |
---|
| 92 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Class destructor. <br></td></tr> |
---|
| 93 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Turbo__Codec.html#d06b57aa228a2f4984b87cccd7e26d53">set_parameters</a> (ivec gen1, ivec gen2, int constraint_length, const ivec &interleaver_sequence, int in_iterations=8, std::string in_metric="LOGMAX", double in_logmax_scale_factor=1.0, bool in_adaptive_stop=false, <a class="el" href="classitpp_1_1LLR__calc__unit.html">LLR_calc_unit</a> lcalc=<a class="el" href="classitpp_1_1LLR__calc__unit.html">LLR_calc_unit</a>())</td></tr> |
---|
| 94 | |
---|
| 95 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Set parameters for the turbo encoder/decoder. <a href="#d06b57aa228a2f4984b87cccd7e26d53"></a><br></td></tr> |
---|
| 96 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Turbo__Codec.html#8fe840d1a8a93baadd8b53f479ddc9dd">set_interleaver</a> (const ivec &interleaver_sequence)</td></tr> |
---|
| 97 | |
---|
| 98 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Set a new internal interleaver sequence for the turbo encoder/decoder. <a href="#8fe840d1a8a93baadd8b53f479ddc9dd"></a><br></td></tr> |
---|
| 99 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Turbo__Codec.html#31ea59c9a56e20d8016efd730204d1c2">set_metric</a> (std::string in_metric="LOGMAX", double in_logmax_scale_factor=1.0, <a class="el" href="classitpp_1_1LLR__calc__unit.html">LLR_calc_unit</a> lcalc=<a class="el" href="classitpp_1_1LLR__calc__unit.html">LLR_calc_unit</a>())</td></tr> |
---|
| 100 | |
---|
| 101 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the decoder metric. <a href="#31ea59c9a56e20d8016efd730204d1c2"></a><br></td></tr> |
---|
| 102 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="28962bbc5c084cf3a7d1d1b22a8657a6"></a><!-- doxytag: member="itpp::Turbo_Codec::set_iterations" ref="28962bbc5c084cf3a7d1d1b22a8657a6" args="(int in_iterations=8)" --> |
---|
| 103 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Turbo__Codec.html#28962bbc5c084cf3a7d1d1b22a8657a6">set_iterations</a> (int in_iterations=8)</td></tr> |
---|
| 104 | |
---|
| 105 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the number of decoding iterations. Default value is 8. <br></td></tr> |
---|
| 106 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Turbo__Codec.html#60f04c11332860b10e2f44aac414604a">set_adaptive_stop</a> (bool in_adaptive_stop=true)</td></tr> |
---|
| 107 | |
---|
| 108 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Use and adaptive number of iterations. <a href="#60f04c11332860b10e2f44aac414604a"></a><br></td></tr> |
---|
| 109 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Turbo__Codec.html#5628f72b58efd0425cbf94e6db23e57e">set_awgn_channel_parameters</a> (double in_Ec, double in_N0)</td></tr> |
---|
| 110 | |
---|
| 111 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Set parameters for decoding on an AWGN channel. <a href="#5628f72b58efd0425cbf94e6db23e57e"></a><br></td></tr> |
---|
| 112 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Turbo__Codec.html#ea92e6bef3a0d537eccd49d5ef6d09c4">set_scaling_factor</a> (double in_Lc)</td></tr> |
---|
| 113 | |
---|
| 114 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Set scaling factor for decoding on e.g. Rayleigh fading channels. <a href="#ea92e6bef3a0d537eccd49d5ef6d09c4"></a><br></td></tr> |
---|
| 115 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Turbo__Codec.html#1d60ee8b4c48a768850e2915b6193fc8">encode</a> (const bvec &input, bvec &output)</td></tr> |
---|
| 116 | |
---|
| 117 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Encoder function. <a href="#1d60ee8b4c48a768850e2915b6193fc8"></a><br></td></tr> |
---|
| 118 | <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Turbo__Codec.html#fc1136d97669fcdc0a7a72e8b27ed450">decode</a> (const vec &received_signal, bvec &decoded_bits, const bvec &true_bits="0")</td></tr> |
---|
| 119 | |
---|
| 120 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Decoder function. <a href="#fc1136d97669fcdc0a7a72e8b27ed450"></a><br></td></tr> |
---|
| 121 | <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Turbo__Codec.html#ece7e9bdabdf933ec49562c3aa7cb77c">decode</a> (const vec &received_signal, bvec &decoded_bits, ivec &nrof_used_iterations, const bvec &true_bits="0")</td></tr> |
---|
| 122 | |
---|
| 123 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Decoder function. <a href="#ece7e9bdabdf933ec49562c3aa7cb77c"></a><br></td></tr> |
---|
| 124 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Turbo__Codec.html#dba243060d5bbf6076173e6d48589f7b">encode_block</a> (const bvec &input, bvec &in1, bvec &in2, <a class="el" href="mat_8h.html#f90acd1af41bf2d1d8a4bb23662fff69">bmat</a> &parity1, <a class="el" href="mat_8h.html#f90acd1af41bf2d1d8a4bb23662fff69">bmat</a> &parity2)</td></tr> |
---|
| 125 | |
---|
| 126 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Encode a single block. <a href="#dba243060d5bbf6076173e6d48589f7b"></a><br></td></tr> |
---|
| 127 | <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Turbo__Codec.html#3e5e49a33be7d478a15b4d3b4168f7eb">decode_block</a> (const vec &rec_syst1, const vec &rec_syst2, const mat &rec_parity1, const mat &rec_parity2, <a class="el" href="mat_8h.html#f90acd1af41bf2d1d8a4bb23662fff69">bmat</a> &decoded_bits_i, int &nrof_used_iterations_i, const bvec &true_bits="0")</td></tr> |
---|
| 128 | |
---|
| 129 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Decode a single block. <a href="#3e5e49a33be7d478a15b4d3b4168f7eb"></a><br></td></tr> |
---|
| 130 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6b835939de5517fd6546035688ca30e3"></a><!-- doxytag: member="itpp::Turbo_Codec::get_Ncoded" ref="6b835939de5517fd6546035688ca30e3" args="() const " --> |
---|
| 131 | int </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Turbo__Codec.html#6b835939de5517fd6546035688ca30e3">get_Ncoded</a> () const </td></tr> |
---|
| 132 | |
---|
| 133 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Get number of coded bits. <br></td></tr> |
---|
| 134 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="50198727339a68f0e38e278ea69b440c"></a><!-- doxytag: member="itpp::Turbo_Codec::get_Nuncoded" ref="50198727339a68f0e38e278ea69b440c" args="() const " --> |
---|
| 135 | int </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Turbo__Codec.html#50198727339a68f0e38e278ea69b440c">get_Nuncoded</a> () const </td></tr> |
---|
| 136 | |
---|
| 137 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Get number of uncoded bits. <br></td></tr> |
---|
| 138 | <tr><td colspan="2"><br><h2>Related Functions</h2></td></tr> |
---|
| 139 | <tr><td colspan="2">(Note that these are not member functions.) <br><br></td></tr> |
---|
| 140 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="96521dd86ec9b627d0d109eae83154a0"></a><!-- doxytag: member="itpp::Turbo_Codec::wcdma_turbo_interleaver_sequence" ref="96521dd86ec9b627d0d109eae83154a0" args="(int interleaver_size)" --> |
---|
| 141 | ivec </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Turbo__Codec.html#96521dd86ec9b627d0d109eae83154a0">wcdma_turbo_interleaver_sequence</a> (int interleaver_size)</td></tr> |
---|
| 142 | |
---|
| 143 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Generates the interleaver sequence for the internal turbo encoder interleaver used in WCDMA. <br></td></tr> |
---|
| 144 | </table> |
---|
| 145 | <hr><a name="_details"></a><h2>Detailed Description</h2> |
---|
| 146 | Turbo encoder/decoder Class<p> |
---|
| 147 | To set up the turbo encoder used in e.g. WCDMA the following code can be used (assuming a code block size of 320 bits):. |
---|
| 148 | <p> |
---|
| 149 | <div class="fragment"><pre class="fragment"> <a class="code" href="classitpp_1_1Turbo__Codec.html#802079855069ba583ecabc0b87281c9b" title="Class constructor.">Turbo_Codec</a> turbo; |
---|
| 150 | ivec gen(2); |
---|
| 151 | gen(0) = 013; gen(1) = 015; |
---|
| 152 | <span class="keywordtype">int</span> constraint_length = 4; |
---|
| 153 | ivec interleaver_sequence = <a class="code" href="classitpp_1_1Turbo__Codec.html#96521dd86ec9b627d0d109eae83154a0" title="Generates the interleaver sequence for the internal turbo encoder interleaver used...">wcdma_turbo_interleaver_sequence</a>( 320 ); |
---|
| 154 | turbo.set_parameters(gen, gen, constraint_length, interleaver_sequence); |
---|
| 155 | </pre></div> <hr><h2>Member Function Documentation</h2> |
---|
| 156 | <a class="anchor" name="ece7e9bdabdf933ec49562c3aa7cb77c"></a><!-- doxytag: member="itpp::Turbo_Codec::decode" ref="ece7e9bdabdf933ec49562c3aa7cb77c" args="(const vec &received_signal, bvec &decoded_bits, ivec &nrof_used_iterations, const bvec &true_bits="0")" --> |
---|
| 157 | <div class="memitem"> |
---|
| 158 | <div class="memproto"> |
---|
| 159 | <table class="memname"> |
---|
| 160 | <tr> |
---|
| 161 | <td class="memname">void itpp::Turbo_Codec::decode </td> |
---|
| 162 | <td>(</td> |
---|
| 163 | <td class="paramtype">const vec & </td> |
---|
| 164 | <td class="paramname"> <em>received_signal</em>, </td> |
---|
| 165 | </tr> |
---|
| 166 | <tr> |
---|
| 167 | <td class="paramkey"></td> |
---|
| 168 | <td></td> |
---|
| 169 | <td class="paramtype">bvec & </td> |
---|
| 170 | <td class="paramname"> <em>decoded_bits</em>, </td> |
---|
| 171 | </tr> |
---|
| 172 | <tr> |
---|
| 173 | <td class="paramkey"></td> |
---|
| 174 | <td></td> |
---|
| 175 | <td class="paramtype">ivec & </td> |
---|
| 176 | <td class="paramname"> <em>nrof_used_iterations</em>, </td> |
---|
| 177 | </tr> |
---|
| 178 | <tr> |
---|
| 179 | <td class="paramkey"></td> |
---|
| 180 | <td></td> |
---|
| 181 | <td class="paramtype">const bvec & </td> |
---|
| 182 | <td class="paramname"> <em>true_bits</em> = <code>"0"</code></td><td> </td> |
---|
| 183 | </tr> |
---|
| 184 | <tr> |
---|
| 185 | <td></td> |
---|
| 186 | <td>)</td> |
---|
| 187 | <td></td><td></td><td><code> [virtual]</code></td> |
---|
| 188 | </tr> |
---|
| 189 | </table> |
---|
| 190 | </div> |
---|
| 191 | <div class="memdoc"> |
---|
| 192 | |
---|
| 193 | <p> |
---|
| 194 | Decoder function. |
---|
| 195 | <p> |
---|
| 196 | This function can decode several consecutive coding blocks that were encoded with the encode member function<p> |
---|
| 197 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 198 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 199 | <tr><td valign="top"></td><td valign="top"><em>received_signal</em> </td><td>The vector of received bits </td></tr> |
---|
| 200 | <tr><td valign="top"></td><td valign="top"><em>decoded_bits</em> </td><td>A vector of decoded bits </td></tr> |
---|
| 201 | <tr><td valign="top"></td><td valign="top"><em>nrof_used_iterations</em> </td><td>Returns the number of used iterations for each code block. </td></tr> |
---|
| 202 | <tr><td valign="top"></td><td valign="top"><em>true_bits</em> </td><td>If this input vector is provided then the iterations will stop as soon as the decoded bits equals the <code>true_bits</code>. Note that this feature can not be used if the <code>in_adaptive_stop</code> parameter in the setup function is set to <code>true</code>. </td></tr> |
---|
| 203 | </table> |
---|
| 204 | </dl> |
---|
| 205 | |
---|
| 206 | <p>References <a class="el" href="turbo_8cpp-source.html#l00341">decode_block()</a>, and <a class="el" href="itassert_8h-source.html#l00094">it_assert</a>.</p> |
---|
| 207 | |
---|
| 208 | </div> |
---|
| 209 | </div><p> |
---|
| 210 | <a class="anchor" name="fc1136d97669fcdc0a7a72e8b27ed450"></a><!-- doxytag: member="itpp::Turbo_Codec::decode" ref="fc1136d97669fcdc0a7a72e8b27ed450" args="(const vec &received_signal, bvec &decoded_bits, const bvec &true_bits="0")" --> |
---|
| 211 | <div class="memitem"> |
---|
| 212 | <div class="memproto"> |
---|
| 213 | <table class="memname"> |
---|
| 214 | <tr> |
---|
| 215 | <td class="memname">void itpp::Turbo_Codec::decode </td> |
---|
| 216 | <td>(</td> |
---|
| 217 | <td class="paramtype">const vec & </td> |
---|
| 218 | <td class="paramname"> <em>received_signal</em>, </td> |
---|
| 219 | </tr> |
---|
| 220 | <tr> |
---|
| 221 | <td class="paramkey"></td> |
---|
| 222 | <td></td> |
---|
| 223 | <td class="paramtype">bvec & </td> |
---|
| 224 | <td class="paramname"> <em>decoded_bits</em>, </td> |
---|
| 225 | </tr> |
---|
| 226 | <tr> |
---|
| 227 | <td class="paramkey"></td> |
---|
| 228 | <td></td> |
---|
| 229 | <td class="paramtype">const bvec & </td> |
---|
| 230 | <td class="paramname"> <em>true_bits</em> = <code>"0"</code></td><td> </td> |
---|
| 231 | </tr> |
---|
| 232 | <tr> |
---|
| 233 | <td></td> |
---|
| 234 | <td>)</td> |
---|
| 235 | <td></td><td></td><td><code> [virtual]</code></td> |
---|
| 236 | </tr> |
---|
| 237 | </table> |
---|
| 238 | </div> |
---|
| 239 | <div class="memdoc"> |
---|
| 240 | |
---|
| 241 | <p> |
---|
| 242 | Decoder function. |
---|
| 243 | <p> |
---|
| 244 | This function can decode several consecutive coding blocks that were encoded with the encode member function<p> |
---|
| 245 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 246 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 247 | <tr><td valign="top"></td><td valign="top"><em>received_signal</em> </td><td>The vector of received bits </td></tr> |
---|
| 248 | <tr><td valign="top"></td><td valign="top"><em>decoded_bits</em> </td><td>A vector of decoded bits </td></tr> |
---|
| 249 | <tr><td valign="top"></td><td valign="top"><em>true_bits</em> </td><td>If this input vector is provided then the iterations will stop as soon as the decoded bits equals the <code>true_bits</code>. Note that this feature can not be used if the <code>in_adaptive_stop</code> parameter in the setup function is set to <code>true</code>. </td></tr> |
---|
| 250 | </table> |
---|
| 251 | </dl> |
---|
| 252 | |
---|
| 253 | </div> |
---|
| 254 | </div><p> |
---|
| 255 | <a class="anchor" name="3e5e49a33be7d478a15b4d3b4168f7eb"></a><!-- doxytag: member="itpp::Turbo_Codec::decode_block" ref="3e5e49a33be7d478a15b4d3b4168f7eb" args="(const vec &rec_syst1, const vec &rec_syst2, const mat &rec_parity1, const mat &rec_parity2, bmat &decoded_bits_i, int &nrof_used_iterations_i, const bvec &true_bits="0")" --> |
---|
| 256 | <div class="memitem"> |
---|
| 257 | <div class="memproto"> |
---|
| 258 | <table class="memname"> |
---|
| 259 | <tr> |
---|
| 260 | <td class="memname">void itpp::Turbo_Codec::decode_block </td> |
---|
| 261 | <td>(</td> |
---|
| 262 | <td class="paramtype">const vec & </td> |
---|
| 263 | <td class="paramname"> <em>rec_syst1</em>, </td> |
---|
| 264 | </tr> |
---|
| 265 | <tr> |
---|
| 266 | <td class="paramkey"></td> |
---|
| 267 | <td></td> |
---|
| 268 | <td class="paramtype">const vec & </td> |
---|
| 269 | <td class="paramname"> <em>rec_syst2</em>, </td> |
---|
| 270 | </tr> |
---|
| 271 | <tr> |
---|
| 272 | <td class="paramkey"></td> |
---|
| 273 | <td></td> |
---|
| 274 | <td class="paramtype">const mat & </td> |
---|
| 275 | <td class="paramname"> <em>rec_parity1</em>, </td> |
---|
| 276 | </tr> |
---|
| 277 | <tr> |
---|
| 278 | <td class="paramkey"></td> |
---|
| 279 | <td></td> |
---|
| 280 | <td class="paramtype">const mat & </td> |
---|
| 281 | <td class="paramname"> <em>rec_parity2</em>, </td> |
---|
| 282 | </tr> |
---|
| 283 | <tr> |
---|
| 284 | <td class="paramkey"></td> |
---|
| 285 | <td></td> |
---|
| 286 | <td class="paramtype"><a class="el" href="mat_8h.html#f90acd1af41bf2d1d8a4bb23662fff69">bmat</a> & </td> |
---|
| 287 | <td class="paramname"> <em>decoded_bits_i</em>, </td> |
---|
| 288 | </tr> |
---|
| 289 | <tr> |
---|
| 290 | <td class="paramkey"></td> |
---|
| 291 | <td></td> |
---|
| 292 | <td class="paramtype">int & </td> |
---|
| 293 | <td class="paramname"> <em>nrof_used_iterations_i</em>, </td> |
---|
| 294 | </tr> |
---|
| 295 | <tr> |
---|
| 296 | <td class="paramkey"></td> |
---|
| 297 | <td></td> |
---|
| 298 | <td class="paramtype">const bvec & </td> |
---|
| 299 | <td class="paramname"> <em>true_bits</em> = <code>"0"</code></td><td> </td> |
---|
| 300 | </tr> |
---|
| 301 | <tr> |
---|
| 302 | <td></td> |
---|
| 303 | <td>)</td> |
---|
| 304 | <td></td><td></td><td><code> [virtual]</code></td> |
---|
| 305 | </tr> |
---|
| 306 | </table> |
---|
| 307 | </div> |
---|
| 308 | <div class="memdoc"> |
---|
| 309 | |
---|
| 310 | <p> |
---|
| 311 | Decode a single block. |
---|
| 312 | <p> |
---|
| 313 | This function can decode a single coding blocks that was encoded with the encode_block member function. In order to speed up the decoding process it is possible to input the correct data bits. If this information is provided the decoder can stop iterating as soon as the decoded bits match the correct data bits. This simulation trick can greatly speed up the simulation time for high SNR cases when only a few iterations are required. If errors still exist after the maximum number of iterations have been performed, the decoding process stops.<p> |
---|
| 314 | The matrix <em>decoded_bits_i</em> contains the result from decoding iteration <em>i</em> on row <em>i</em>. Even though both <em>rec_syst1</em> and <em>rec_syst2</em> are given as inputs, the systematic bits in <em>rec_syst2</em> will in most cases be punctured and only the tailbits at the end of the vector <em>rec_syst2</em> will have values different from zero.<p> |
---|
| 315 | <dl class="note" compact><dt><b>Note:</b></dt><dd>This decoding function assumes that the input is scaled as +-2*SNR + noise. This means that the channel reliability factor <em>Lc</em> must be equal to 1.0. No additional scaling is performed by this function.</dd></dl> |
---|
| 316 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 317 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 318 | <tr><td valign="top"></td><td valign="top"><em>rec_syst1</em> </td><td>The received input bits to the first constituent decoder with a tail added at the end </td></tr> |
---|
| 319 | <tr><td valign="top"></td><td valign="top"><em>rec_syst2</em> </td><td>The received input bits to the second constituent decoder with a tail added at the end </td></tr> |
---|
| 320 | <tr><td valign="top"></td><td valign="top"><em>rec_parity1</em> </td><td>The received parity bits for the first constituent decoder (including parity bits for the first tail) </td></tr> |
---|
| 321 | <tr><td valign="top"></td><td valign="top"><em>rec_parity2</em> </td><td>The received parity bits for the second constituent decoder (including parity bits for the second tail) </td></tr> |
---|
| 322 | <tr><td valign="top"></td><td valign="top"><em>decoded_bits_i</em> </td><td>Contains the result from decoding iteration <em>i</em> on row <em>i</em>. </td></tr> |
---|
| 323 | <tr><td valign="top"></td><td valign="top"><em>nrof_used_iterations_i</em> </td><td>Returns the number of iterations used for decoding of this block. </td></tr> |
---|
| 324 | <tr><td valign="top"></td><td valign="top"><em>true_bits</em> </td><td>Optional input parameter. If given, the iterations will stop as soon as the decoded bits match the true bits. </td></tr> |
---|
| 325 | </table> |
---|
| 326 | </dl> |
---|
| 327 | |
---|
| 328 | <p>References <a class="el" href="interleave_8h-source.html#l00521">itpp::Sequence_Interleaver< T >::deinterleave()</a>, <a class="el" href="interleave_8h-source.html#l00474">itpp::Sequence_Interleaver< T >::interleave()</a>, <a class="el" href="itassert_8h-source.html#l00094">it_assert</a>, <a class="el" href="itassert_8h-source.html#l00126">it_error</a>, <a class="el" href="vec_8h-source.html#l01330">itpp::Vec< Num_T >::left()</a>, <a class="el" href="rec__syst__conv__code_8cpp-source.html#l00282">itpp::Rec_Syst_Conv_Code::log_decode()</a>, <a class="el" href="rec__syst__conv__code_8cpp-source.html#l00166">itpp::Rec_Syst_Conv_Code::map_decode()</a>, <a class="el" href="vec_8h-source.html#l01319">itpp::Vec< Num_T >::right()</a>, and <a class="el" href="group__specmat.html#g10723ecada06221cbe64fe2736a59de1">itpp::zeros()</a>.</p> |
---|
| 329 | |
---|
| 330 | <p>Referenced by <a class="el" href="turbo_8cpp-source.html#l00212">decode()</a>.</p> |
---|
| 331 | |
---|
| 332 | </div> |
---|
| 333 | </div><p> |
---|
| 334 | <a class="anchor" name="1d60ee8b4c48a768850e2915b6193fc8"></a><!-- doxytag: member="itpp::Turbo_Codec::encode" ref="1d60ee8b4c48a768850e2915b6193fc8" args="(const bvec &input, bvec &output)" --> |
---|
| 335 | <div class="memitem"> |
---|
| 336 | <div class="memproto"> |
---|
| 337 | <table class="memname"> |
---|
| 338 | <tr> |
---|
| 339 | <td class="memname">void itpp::Turbo_Codec::encode </td> |
---|
| 340 | <td>(</td> |
---|
| 341 | <td class="paramtype">const bvec & </td> |
---|
| 342 | <td class="paramname"> <em>input</em>, </td> |
---|
| 343 | </tr> |
---|
| 344 | <tr> |
---|
| 345 | <td class="paramkey"></td> |
---|
| 346 | <td></td> |
---|
| 347 | <td class="paramtype">bvec & </td> |
---|
| 348 | <td class="paramname"> <em>output</em></td><td> </td> |
---|
| 349 | </tr> |
---|
| 350 | <tr> |
---|
| 351 | <td></td> |
---|
| 352 | <td>)</td> |
---|
| 353 | <td></td><td></td><td></td> |
---|
| 354 | </tr> |
---|
| 355 | </table> |
---|
| 356 | </div> |
---|
| 357 | <div class="memdoc"> |
---|
| 358 | |
---|
| 359 | <p> |
---|
| 360 | Encoder function. |
---|
| 361 | <p> |
---|
| 362 | This function can encode several consecutive coding blocks. The output is organized as follows:<p> |
---|
| 363 | <p class="formulaDsp"> |
---|
| 364 | <img class="formulaDsp" alt="\[ s(1), p_{1,1}(1), p_{1,2}(1), \ldots , p_{1,n_1}(1), p_{2,1}(1), p_{2,2}(1), \ldots , p_{2,n_2}(1), s(2), \ldots \]" src="form_319.png"> |
---|
| 365 | <p> |
---|
| 366 | <p> |
---|
| 367 | In the above expression <img class="formulaInl" alt="$s(n)$" src="form_320.png"> is the n-th systematic bit and <img class="formulaInl" alt="$p_{l,k}(n)$" src="form_321.png"> is the n-th bit from the k-th encoder polynomial of the l-th constituent encoder. A tail of both systematic and parity bits is added after each coding block to force both encoder to the zero state. The tail of each encoder is structured as follows (using encoder one as an example):<p> |
---|
| 368 | <p class="formulaDsp"> |
---|
| 369 | <img class="formulaDsp" alt="\[ t_1(1), pt_{1,1}(1), pt_{1,2}(1), \ldots , pt_{1,n_1}(1), \ldots pt_{1,n_1}(m) \]" src="form_322.png"> |
---|
| 370 | <p> |
---|
| 371 | <p> |
---|
| 372 | The tailbits from the first encoder are placed before the tailbits from the second encoder.<p> |
---|
| 373 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 374 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 375 | <tr><td valign="top"></td><td valign="top"><em>input</em> </td><td>The input bits to the encoder. Must contain an integer number of code blocks </td></tr> |
---|
| 376 | <tr><td valign="top"></td><td valign="top"><em>output</em> </td><td>The encoded bits including two tail, one from each constituent encoder, after each coding block. </td></tr> |
---|
| 377 | </table> |
---|
| 378 | </dl> |
---|
| 379 | |
---|
| 380 | <p>References <a class="el" href="turbo_8cpp-source.html#l00306">encode_block()</a>.</p> |
---|
| 381 | |
---|
| 382 | </div> |
---|
| 383 | </div><p> |
---|
| 384 | <a class="anchor" name="dba243060d5bbf6076173e6d48589f7b"></a><!-- doxytag: member="itpp::Turbo_Codec::encode_block" ref="dba243060d5bbf6076173e6d48589f7b" args="(const bvec &input, bvec &in1, bvec &in2, bmat &parity1, bmat &parity2)" --> |
---|
| 385 | <div class="memitem"> |
---|
| 386 | <div class="memproto"> |
---|
| 387 | <table class="memname"> |
---|
| 388 | <tr> |
---|
| 389 | <td class="memname">void itpp::Turbo_Codec::encode_block </td> |
---|
| 390 | <td>(</td> |
---|
| 391 | <td class="paramtype">const bvec & </td> |
---|
| 392 | <td class="paramname"> <em>input</em>, </td> |
---|
| 393 | </tr> |
---|
| 394 | <tr> |
---|
| 395 | <td class="paramkey"></td> |
---|
| 396 | <td></td> |
---|
| 397 | <td class="paramtype">bvec & </td> |
---|
| 398 | <td class="paramname"> <em>in1</em>, </td> |
---|
| 399 | </tr> |
---|
| 400 | <tr> |
---|
| 401 | <td class="paramkey"></td> |
---|
| 402 | <td></td> |
---|
| 403 | <td class="paramtype">bvec & </td> |
---|
| 404 | <td class="paramname"> <em>in2</em>, </td> |
---|
| 405 | </tr> |
---|
| 406 | <tr> |
---|
| 407 | <td class="paramkey"></td> |
---|
| 408 | <td></td> |
---|
| 409 | <td class="paramtype"><a class="el" href="mat_8h.html#f90acd1af41bf2d1d8a4bb23662fff69">bmat</a> & </td> |
---|
| 410 | <td class="paramname"> <em>parity1</em>, </td> |
---|
| 411 | </tr> |
---|
| 412 | <tr> |
---|
| 413 | <td class="paramkey"></td> |
---|
| 414 | <td></td> |
---|
| 415 | <td class="paramtype"><a class="el" href="mat_8h.html#f90acd1af41bf2d1d8a4bb23662fff69">bmat</a> & </td> |
---|
| 416 | <td class="paramname"> <em>parity2</em></td><td> </td> |
---|
| 417 | </tr> |
---|
| 418 | <tr> |
---|
| 419 | <td></td> |
---|
| 420 | <td>)</td> |
---|
| 421 | <td></td><td></td><td></td> |
---|
| 422 | </tr> |
---|
| 423 | </table> |
---|
| 424 | </div> |
---|
| 425 | <div class="memdoc"> |
---|
| 426 | |
---|
| 427 | <p> |
---|
| 428 | Encode a single block. |
---|
| 429 | <p> |
---|
| 430 | This function is useful if rate matching is to be applied after the turbo encoder. The size of <em>in1</em> and <em>in2</em> equals the size of <em>input</em> plus the tail bits. Tailbits are appended ate the end of <em>in1</em> and <em>in2</em>. The number of rows in <em>parity1</em> and <em>parity2</em> equals the lengths of <em>in1</em> and <em>in2</em> respectively. The number of columns of <em>parity1</em> and <em>parity2</em> equals the number of parity bits from the first and the second constituent encoders respectively.<p> |
---|
| 431 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 432 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 433 | <tr><td valign="top"></td><td valign="top"><em>input</em> </td><td>The input bits to the encoder. Must contain a single code block </td></tr> |
---|
| 434 | <tr><td valign="top"></td><td valign="top"><em>in1</em> </td><td>The input bits to the first constituent encoder with a tail added at the end </td></tr> |
---|
| 435 | <tr><td valign="top"></td><td valign="top"><em>in2</em> </td><td>The input bits to the second constituent encoder (i.e. the interleaved data bits) with a tail added at the end </td></tr> |
---|
| 436 | <tr><td valign="top"></td><td valign="top"><em>parity1</em> </td><td>The parity bits from the first constituent encoder (including parity bits for the first tail) </td></tr> |
---|
| 437 | <tr><td valign="top"></td><td valign="top"><em>parity2</em> </td><td>The parity bits from the second constituent encoder (including parity bits for the second tail) </td></tr> |
---|
| 438 | </table> |
---|
| 439 | </dl> |
---|
| 440 | |
---|
| 441 | <p>References <a class="el" href="rec__syst__conv__code_8cpp-source.html#l00124">itpp::Rec_Syst_Conv_Code::encode_tail()</a>, <a class="el" href="interleave_8h-source.html#l00474">itpp::Sequence_Interleaver< T >::interleave()</a>, and <a class="el" href="itassert_8h-source.html#l00094">it_assert</a>.</p> |
---|
| 442 | |
---|
| 443 | <p>Referenced by <a class="el" href="turbo_8cpp-source.html#l00158">encode()</a>.</p> |
---|
| 444 | |
---|
| 445 | </div> |
---|
| 446 | </div><p> |
---|
| 447 | <a class="anchor" name="60f04c11332860b10e2f44aac414604a"></a><!-- doxytag: member="itpp::Turbo_Codec::set_adaptive_stop" ref="60f04c11332860b10e2f44aac414604a" args="(bool in_adaptive_stop=true)" --> |
---|
| 448 | <div class="memitem"> |
---|
| 449 | <div class="memproto"> |
---|
| 450 | <table class="memname"> |
---|
| 451 | <tr> |
---|
| 452 | <td class="memname">void itpp::Turbo_Codec::set_adaptive_stop </td> |
---|
| 453 | <td>(</td> |
---|
| 454 | <td class="paramtype">bool </td> |
---|
| 455 | <td class="paramname"> <em>in_adaptive_stop</em> = <code>true</code> </td> |
---|
| 456 | <td> ) </td> |
---|
| 457 | <td></td> |
---|
| 458 | </tr> |
---|
| 459 | </table> |
---|
| 460 | </div> |
---|
| 461 | <div class="memdoc"> |
---|
| 462 | |
---|
| 463 | <p> |
---|
| 464 | Use and adaptive number of iterations. |
---|
| 465 | <p> |
---|
| 466 | When the adaptive stop criterion is used the iterations will stop before the maximum number of iterations is executed if the decoding results after one full iteration equals the previous iteration. Default value is <code>true</code>. |
---|
| 467 | </div> |
---|
| 468 | </div><p> |
---|
| 469 | <a class="anchor" name="5628f72b58efd0425cbf94e6db23e57e"></a><!-- doxytag: member="itpp::Turbo_Codec::set_awgn_channel_parameters" ref="5628f72b58efd0425cbf94e6db23e57e" args="(double in_Ec, double in_N0)" --> |
---|
| 470 | <div class="memitem"> |
---|
| 471 | <div class="memproto"> |
---|
| 472 | <table class="memname"> |
---|
| 473 | <tr> |
---|
| 474 | <td class="memname">void itpp::Turbo_Codec::set_awgn_channel_parameters </td> |
---|
| 475 | <td>(</td> |
---|
| 476 | <td class="paramtype">double </td> |
---|
| 477 | <td class="paramname"> <em>in_Ec</em>, </td> |
---|
| 478 | </tr> |
---|
| 479 | <tr> |
---|
| 480 | <td class="paramkey"></td> |
---|
| 481 | <td></td> |
---|
| 482 | <td class="paramtype">double </td> |
---|
| 483 | <td class="paramname"> <em>in_N0</em></td><td> </td> |
---|
| 484 | </tr> |
---|
| 485 | <tr> |
---|
| 486 | <td></td> |
---|
| 487 | <td>)</td> |
---|
| 488 | <td></td><td></td><td></td> |
---|
| 489 | </tr> |
---|
| 490 | </table> |
---|
| 491 | </div> |
---|
| 492 | <div class="memdoc"> |
---|
| 493 | |
---|
| 494 | <p> |
---|
| 495 | Set parameters for decoding on an AWGN channel. |
---|
| 496 | <p> |
---|
| 497 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 498 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 499 | <tr><td valign="top"></td><td valign="top"><em>in_Ec</em> </td><td>The received energy per channel symbol (i.e. per soft input bit) </td></tr> |
---|
| 500 | <tr><td valign="top"></td><td valign="top"><em>in_N0</em> </td><td>The single sided spectral density of the AWGN noise </td></tr> |
---|
| 501 | </table> |
---|
| 502 | </dl> |
---|
| 503 | |
---|
| 504 | <p>References <a class="el" href="elem__math_8h-source.html#l00126">itpp::sqrt()</a>.</p> |
---|
| 505 | |
---|
| 506 | </div> |
---|
| 507 | </div><p> |
---|
| 508 | <a class="anchor" name="8fe840d1a8a93baadd8b53f479ddc9dd"></a><!-- doxytag: member="itpp::Turbo_Codec::set_interleaver" ref="8fe840d1a8a93baadd8b53f479ddc9dd" args="(const ivec &interleaver_sequence)" --> |
---|
| 509 | <div class="memitem"> |
---|
| 510 | <div class="memproto"> |
---|
| 511 | <table class="memname"> |
---|
| 512 | <tr> |
---|
| 513 | <td class="memname">void itpp::Turbo_Codec::set_interleaver </td> |
---|
| 514 | <td>(</td> |
---|
| 515 | <td class="paramtype">const ivec & </td> |
---|
| 516 | <td class="paramname"> <em>interleaver_sequence</em> </td> |
---|
| 517 | <td> ) </td> |
---|
| 518 | <td></td> |
---|
| 519 | </tr> |
---|
| 520 | </table> |
---|
| 521 | </div> |
---|
| 522 | <div class="memdoc"> |
---|
| 523 | |
---|
| 524 | <p> |
---|
| 525 | Set a new internal interleaver sequence for the turbo encoder/decoder. |
---|
| 526 | <p> |
---|
| 527 | By changing the interleaver sequence it is possible to change the code word size of the turbo codec. Note that you still must use the <em>set_parameters</em> function first to set the other parameters of the turbo codec. |
---|
| 528 | <p>References <a class="el" href="interleave_8h-source.html#l00189">itpp::Sequence_Interleaver< T >::set_interleaver_depth()</a>, and <a class="el" href="interleave_8h-source.html#l00541">itpp::Sequence_Interleaver< T >::set_interleaver_sequence()</a>.</p> |
---|
| 529 | |
---|
| 530 | </div> |
---|
| 531 | </div><p> |
---|
| 532 | <a class="anchor" name="31ea59c9a56e20d8016efd730204d1c2"></a><!-- doxytag: member="itpp::Turbo_Codec::set_metric" ref="31ea59c9a56e20d8016efd730204d1c2" args="(std::string in_metric="LOGMAX", double in_logmax_scale_factor=1.0, LLR_calc_unit lcalc=LLR_calc_unit())" --> |
---|
| 533 | <div class="memitem"> |
---|
| 534 | <div class="memproto"> |
---|
| 535 | <table class="memname"> |
---|
| 536 | <tr> |
---|
| 537 | <td class="memname">void itpp::Turbo_Codec::set_metric </td> |
---|
| 538 | <td>(</td> |
---|
| 539 | <td class="paramtype">std::string </td> |
---|
| 540 | <td class="paramname"> <em>in_metric</em> = <code>"LOGMAX"</code>, </td> |
---|
| 541 | </tr> |
---|
| 542 | <tr> |
---|
| 543 | <td class="paramkey"></td> |
---|
| 544 | <td></td> |
---|
| 545 | <td class="paramtype">double </td> |
---|
| 546 | <td class="paramname"> <em>in_logmax_scale_factor</em> = <code>1.0</code>, </td> |
---|
| 547 | </tr> |
---|
| 548 | <tr> |
---|
| 549 | <td class="paramkey"></td> |
---|
| 550 | <td></td> |
---|
| 551 | <td class="paramtype"><a class="el" href="classitpp_1_1LLR__calc__unit.html">LLR_calc_unit</a> </td> |
---|
| 552 | <td class="paramname"> <em>lcalc</em> = <code><a class="el" href="classitpp_1_1LLR__calc__unit.html">LLR_calc_unit</a>()</code></td><td> </td> |
---|
| 553 | </tr> |
---|
| 554 | <tr> |
---|
| 555 | <td></td> |
---|
| 556 | <td>)</td> |
---|
| 557 | <td></td><td></td><td></td> |
---|
| 558 | </tr> |
---|
| 559 | </table> |
---|
| 560 | </div> |
---|
| 561 | <div class="memdoc"> |
---|
| 562 | |
---|
| 563 | <p> |
---|
| 564 | Set the decoder metric. |
---|
| 565 | <p> |
---|
| 566 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 567 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 568 | <tr><td valign="top"></td><td valign="top"><em>in_metric</em> </td><td>Determines the decoder metric: "MAP", LOGMAP", "LOGMAX", or "TABLE". The default is "LOGMAX". </td></tr> |
---|
| 569 | <tr><td valign="top"></td><td valign="top"><em>in_logmax_scale_factor</em> </td><td>The extrinsic information from each constituent decoder is to optimistic when LOGMAX decoding is used. This parameter allows for a down-scaling of the extrinsic information that will be passed on to the next decoder. The default value is 1.0. This parameter is ignored for other metrics than "LOGMAX".</td></tr> |
---|
| 570 | <tr><td valign="top"></td><td valign="top"><em>lcalc</em> </td><td>This parameter can be used to provide a specific <code><a class="el" href="classitpp_1_1LLR__calc__unit.html" title="Log-likelihood algebra calculation unit.">LLR_calc_unit</a></code> which defines the resolution in the table-lookup if decoding with the metric "TABLE" is used. </td></tr> |
---|
| 571 | </table> |
---|
| 572 | </dl> |
---|
| 573 | |
---|
| 574 | <p>References <a class="el" href="itassert_8h-source.html#l00126">it_error</a>, and <a class="el" href="rec__syst__conv__code_8cpp-source.html#l00724">itpp::Rec_Syst_Conv_Code::set_llrcalc()</a>.</p> |
---|
| 575 | |
---|
| 576 | </div> |
---|
| 577 | </div><p> |
---|
| 578 | <a class="anchor" name="d06b57aa228a2f4984b87cccd7e26d53"></a><!-- doxytag: member="itpp::Turbo_Codec::set_parameters" ref="d06b57aa228a2f4984b87cccd7e26d53" args="(ivec gen1, ivec gen2, int constraint_length, const ivec &interleaver_sequence, int in_iterations=8, std::string in_metric="LOGMAX", double in_logmax_scale_factor=1.0, bool in_adaptive_stop=false, LLR_calc_unit lcalc=LLR_calc_unit())" --> |
---|
| 579 | <div class="memitem"> |
---|
| 580 | <div class="memproto"> |
---|
| 581 | <table class="memname"> |
---|
| 582 | <tr> |
---|
| 583 | <td class="memname">void itpp::Turbo_Codec::set_parameters </td> |
---|
| 584 | <td>(</td> |
---|
| 585 | <td class="paramtype">ivec </td> |
---|
| 586 | <td class="paramname"> <em>gen1</em>, </td> |
---|
| 587 | </tr> |
---|
| 588 | <tr> |
---|
| 589 | <td class="paramkey"></td> |
---|
| 590 | <td></td> |
---|
| 591 | <td class="paramtype">ivec </td> |
---|
| 592 | <td class="paramname"> <em>gen2</em>, </td> |
---|
| 593 | </tr> |
---|
| 594 | <tr> |
---|
| 595 | <td class="paramkey"></td> |
---|
| 596 | <td></td> |
---|
| 597 | <td class="paramtype">int </td> |
---|
| 598 | <td class="paramname"> <em>constraint_length</em>, </td> |
---|
| 599 | </tr> |
---|
| 600 | <tr> |
---|
| 601 | <td class="paramkey"></td> |
---|
| 602 | <td></td> |
---|
| 603 | <td class="paramtype">const ivec & </td> |
---|
| 604 | <td class="paramname"> <em>interleaver_sequence</em>, </td> |
---|
| 605 | </tr> |
---|
| 606 | <tr> |
---|
| 607 | <td class="paramkey"></td> |
---|
| 608 | <td></td> |
---|
| 609 | <td class="paramtype">int </td> |
---|
| 610 | <td class="paramname"> <em>in_iterations</em> = <code>8</code>, </td> |
---|
| 611 | </tr> |
---|
| 612 | <tr> |
---|
| 613 | <td class="paramkey"></td> |
---|
| 614 | <td></td> |
---|
| 615 | <td class="paramtype">std::string </td> |
---|
| 616 | <td class="paramname"> <em>in_metric</em> = <code>"LOGMAX"</code>, </td> |
---|
| 617 | </tr> |
---|
| 618 | <tr> |
---|
| 619 | <td class="paramkey"></td> |
---|
| 620 | <td></td> |
---|
| 621 | <td class="paramtype">double </td> |
---|
| 622 | <td class="paramname"> <em>in_logmax_scale_factor</em> = <code>1.0</code>, </td> |
---|
| 623 | </tr> |
---|
| 624 | <tr> |
---|
| 625 | <td class="paramkey"></td> |
---|
| 626 | <td></td> |
---|
| 627 | <td class="paramtype">bool </td> |
---|
| 628 | <td class="paramname"> <em>in_adaptive_stop</em> = <code>false</code>, </td> |
---|
| 629 | </tr> |
---|
| 630 | <tr> |
---|
| 631 | <td class="paramkey"></td> |
---|
| 632 | <td></td> |
---|
| 633 | <td class="paramtype"><a class="el" href="classitpp_1_1LLR__calc__unit.html">LLR_calc_unit</a> </td> |
---|
| 634 | <td class="paramname"> <em>lcalc</em> = <code><a class="el" href="classitpp_1_1LLR__calc__unit.html">LLR_calc_unit</a>()</code></td><td> </td> |
---|
| 635 | </tr> |
---|
| 636 | <tr> |
---|
| 637 | <td></td> |
---|
| 638 | <td>)</td> |
---|
| 639 | <td></td><td></td><td></td> |
---|
| 640 | </tr> |
---|
| 641 | </table> |
---|
| 642 | </div> |
---|
| 643 | <div class="memdoc"> |
---|
| 644 | |
---|
| 645 | <p> |
---|
| 646 | Set parameters for the turbo encoder/decoder. |
---|
| 647 | <p> |
---|
| 648 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 649 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 650 | <tr><td valign="top"></td><td valign="top"><em>gen1</em> </td><td>A vector with <em>n1</em> elements containing the generator polynomials for the first constituent encoder </td></tr> |
---|
| 651 | <tr><td valign="top"></td><td valign="top"><em>gen2</em> </td><td>A vector with <em>n2</em> elements containing the generator polynomials for the second constituent encoder </td></tr> |
---|
| 652 | <tr><td valign="top"></td><td valign="top"><em>constraint_length</em> </td><td>The constraint length of the two constituent encoders </td></tr> |
---|
| 653 | <tr><td valign="top"></td><td valign="top"><em>interleaver_sequence</em> </td><td>An ivec defining the internal turbo interleaver. </td></tr> |
---|
| 654 | <tr><td valign="top"></td><td valign="top"><em>in_iterations</em> </td><td>The number of decoding iterations. Default value is 8. </td></tr> |
---|
| 655 | <tr><td valign="top"></td><td valign="top"><em>in_metric</em> </td><td>Determines the decoder metric: "MAP", LOGMAP", "LOGMAX", or "TABLE". The default is "LOGMAX". </td></tr> |
---|
| 656 | <tr><td valign="top"></td><td valign="top"><em>in_logmax_scale_factor</em> </td><td>The extrinsic information from each constituent decoder is to optimistic when LOGMAX decoding is used. This parameter allows for a down-scaling of the extrinsic information that will be passed on to the next decoder. The default value is 1.0. This parameter is ignored for other metrics than "LOGMAX". </td></tr> |
---|
| 657 | <tr><td valign="top"></td><td valign="top"><em>in_adaptive_stop</em> </td><td>If this parameter is true, then the iterations will stop if the decoding results after one full iteration equals the previous iteration. Default value is false.</td></tr> |
---|
| 658 | <tr><td valign="top"></td><td valign="top"><em>lcalc</em> </td><td>This parameter can be used to provide a specific <code><a class="el" href="classitpp_1_1LLR__calc__unit.html" title="Log-likelihood algebra calculation unit.">LLR_calc_unit</a></code> which defines the resolution in the table-lookup if decoding with the metric "TABLE" is used. </td></tr> |
---|
| 659 | </table> |
---|
| 660 | </dl> |
---|
| 661 | |
---|
| 662 | <p>References <a class="el" href="itassert_8h-source.html#l00094">it_assert</a>, <a class="el" href="itassert_8h-source.html#l00126">it_error</a>, <a class="el" href="rec__syst__conv__code_8cpp-source.html#l00069">itpp::Rec_Syst_Conv_Code::set_generator_polynomials()</a>, <a class="el" href="interleave_8h-source.html#l00189">itpp::Sequence_Interleaver< T >::set_interleaver_depth()</a>, <a class="el" href="interleave_8h-source.html#l00541">itpp::Sequence_Interleaver< T >::set_interleaver_sequence()</a>, and <a class="el" href="rec__syst__conv__code_8cpp-source.html#l00724">itpp::Rec_Syst_Conv_Code::set_llrcalc()</a>.</p> |
---|
| 663 | |
---|
| 664 | </div> |
---|
| 665 | </div><p> |
---|
| 666 | <a class="anchor" name="ea92e6bef3a0d537eccd49d5ef6d09c4"></a><!-- doxytag: member="itpp::Turbo_Codec::set_scaling_factor" ref="ea92e6bef3a0d537eccd49d5ef6d09c4" args="(double in_Lc)" --> |
---|
| 667 | <div class="memitem"> |
---|
| 668 | <div class="memproto"> |
---|
| 669 | <table class="memname"> |
---|
| 670 | <tr> |
---|
| 671 | <td class="memname">void itpp::Turbo_Codec::set_scaling_factor </td> |
---|
| 672 | <td>(</td> |
---|
| 673 | <td class="paramtype">double </td> |
---|
| 674 | <td class="paramname"> <em>in_Lc</em> </td> |
---|
| 675 | <td> ) </td> |
---|
| 676 | <td></td> |
---|
| 677 | </tr> |
---|
| 678 | </table> |
---|
| 679 | </div> |
---|
| 680 | <div class="memdoc"> |
---|
| 681 | |
---|
| 682 | <p> |
---|
| 683 | Set scaling factor for decoding on e.g. Rayleigh fading channels. |
---|
| 684 | <p> |
---|
| 685 | Setting the correct value of the channel reliability function is important for MAP decoder algorithms. However, if the Log-MAX decoding algorithm is used, then the value of <em>Lc</em> is not important. Assuming that the received soft values <img class="formulaInl" alt="$r_k$" src="form_278.png"> from the channel equal<p> |
---|
| 686 | <p class="formulaDsp"> |
---|
| 687 | <img class="formulaDsp" alt="\[ r_k = h_k c_k + w_k \]" src="form_312.png"> |
---|
| 688 | <p> |
---|
| 689 | <p> |
---|
| 690 | where <img class="formulaInl" alt="$h_k$" src="form_313.png"> is the (complex valued) channel gain, <img class="formulaInl" alt="$c_k$" src="form_253.png"> is the transmitted symbol equal to <img class="formulaInl" alt="$\{-\sqrt{E_c},+\sqrt{E_c}\}$" src="form_314.png">, and <img class="formulaInl" alt="$w_k$" src="form_315.png"> is the AWGN (complex valued) noise with total variance of the real plus imaginary part equal to <img class="formulaInl" alt="$N_0$" src="form_233.png">. The input to the turbo decoder shall then be<p> |
---|
| 691 | <p class="formulaDsp"> |
---|
| 692 | <img class="formulaDsp" alt="\[ z_k = \hat{h}_k^{*} r_k \]" src="form_316.png"> |
---|
| 693 | <p> |
---|
| 694 | <p> |
---|
| 695 | where <img class="formulaInl" alt="$\hat{h}_k^{*}$" src="form_317.png"> is the conjugate of the channel estimate. Assuming that the channel estimate is perfect, the channel reliability factor shall be set to<p> |
---|
| 696 | <p class="formulaDsp"> |
---|
| 697 | <img class="formulaDsp" alt="\[ L_c = 4\sqrt{E_c} / {N_0} \]" src="form_318.png"> |
---|
| 698 | <p> |
---|
| 699 | <p> |
---|
| 700 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 701 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 702 | <tr><td valign="top"></td><td valign="top"><em>in_Lc</em> </td><td>the channel reliability factor of the channel. </td></tr> |
---|
| 703 | </table> |
---|
| 704 | </dl> |
---|
| 705 | |
---|
| 706 | </div> |
---|
| 707 | </div><p> |
---|
| 708 | <hr>The documentation for this class was generated from the following files:<ul> |
---|
| 709 | <li><a class="el" href="turbo_8h-source.html">turbo.h</a><li><a class="el" href="turbo_8cpp.html">turbo.cpp</a></ul> |
---|
| 710 | </div> |
---|
| 711 | <hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:19 2009 for mixpp by |
---|
| 712 | <a href="http://www.doxygen.org/index.html"> |
---|
| 713 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> |
---|
| 714 | </body> |
---|
| 715 | </html> |
---|