/usr/share/doc/libitpp-dev/html/reedsolomon.html is in libitpp-doc 4.3.1-8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Welcome to IT++!</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="favicon.ico">
</head>
<body>
<div style="width: 100%; height: 40px; background-color: #ffff00; border: 1px solid #b0b0b0; margin: 5px 5px 5px 0; padding: 2px;">
<a href="http://itpp.sourceforge.net"><img src="itpp_logo.png" alt="IT++ Logo" style="float: left; border: 0;"></a>
</div>
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,true,'search.php','Search');
$(document).ready(function() {
if ($('.searchresults').length > 0) { searchBox.DOMSearchField().focus(); }
});
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Simulation of a Reed-Solomon Block Code </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>A Reed-Solomon code is a <img class="formulaInl" alt="$q^m$" src="form_306.png"/>-ary BCH code of length <img class="formulaInl" alt="$q^m-1$" src="form_307.png"/>. The generator polynomial for a <img class="formulaInl" alt="$t$" src="form_198.png"/>-error correcting code is <img class="formulaInl" alt="$g(x) = (x-\alpha) (x-\alpha^1) \ldots (x-\alpha^{2t-1})$" src="form_308.png"/>. The decoder uses the Berlkamp-Massey algorithm for decoding as described in: S. B. Wicker, "Error Control Systems for digital communication and storage," Prentice Hall. The following example simulates a binary (i.e. <img class="formulaInl" alt="$q=2$" src="form_309.png"/>) Reed-Solomon code with parameters <img class="formulaInl" alt="$m$" src="form_310.png"/> and <img class="formulaInl" alt="$t$" src="form_198.png"/>:</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include <<a class="code" href="itcomm_8h.html">itpp/itcomm.h</a>></span></div><div class="line"></div><div class="line"><span class="keyword">using namespace </span><a class="code" href="namespaceitpp.html">itpp</a>;</div><div class="line"></div><div class="line"><span class="comment">//These lines are needed for use of cout and endl</span></div><div class="line"><span class="keyword">using</span> std::cout;</div><div class="line"><span class="keyword">using</span> std::endl;</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line"></div><div class="line"> <span class="comment">//Scalars and vectors:</span></div><div class="line"> <span class="keywordtype">int</span> m, t, n, k, q, NumBits, NumCodeWords;</div><div class="line"> <span class="keywordtype">double</span> p;</div><div class="line"> bvec uncoded_bits, coded_bits, received_bits, decoded_bits;</div><div class="line"></div><div class="line"> <span class="comment">//Set parameters:</span></div><div class="line"> NumCodeWords = 1000; <span class="comment">//Number of Reed-Solomon code-words to simulate</span></div><div class="line"> p = 0.01; <span class="comment">//BSC Error probability</span></div><div class="line"> m = 3; <span class="comment">//Reed-Solomon parameter m</span></div><div class="line"> t = 2; <span class="comment">//Reed-Solomon parameter t</span></div><div class="line"></div><div class="line"> cout << <span class="stringliteral">"Number of Reed-Solomon code-words to simulate: "</span> << NumCodeWords << endl;</div><div class="line"> cout << <span class="stringliteral">"BSC Error probability : "</span> << p << endl;</div><div class="line"> cout << <span class="stringliteral">"RS m: "</span> << m << endl;</div><div class="line"> cout << <span class="stringliteral">"RS t: "</span> << t << endl;</div><div class="line"></div><div class="line"> <span class="comment">//Classes:</span></div><div class="line"> <a class="code" href="classitpp_1_1Reed__Solomon.html">Reed_Solomon</a> reed_solomon(m, t);</div><div class="line"> <a class="code" href="classitpp_1_1BSC.html">BSC</a> bsc(p);</div><div class="line"> <a class="code" href="classitpp_1_1BERC.html">BERC</a> berc;</div><div class="line"></div><div class="line"> <a class="code" href="group__randgen.html#ga001a62b1a1e3092d3bc60f71c95208cd">RNG_randomize</a>();</div><div class="line"></div><div class="line"> <span class="comment">//Calculate parameters for the Reed-Solomon Code:</span></div><div class="line"> n = <a class="code" href="group__convertfunc.html#ga14bb8e68d119b1dfa214a77d4b3fd382">round_i</a>(<a class="code" href="group__logexpfunc.html#ga0c42d158b1f623f9b72c1ccde7e2fd09">pow</a>(2.0, m) - 1);</div><div class="line"> k = <a class="code" href="group__convertfunc.html#ga14bb8e68d119b1dfa214a77d4b3fd382">round_i</a>(<a class="code" href="group__logexpfunc.html#ga0c42d158b1f623f9b72c1ccde7e2fd09">pow</a>(2.0, m)) - 1 - 2 * t;</div><div class="line"> q = <a class="code" href="group__convertfunc.html#ga14bb8e68d119b1dfa214a77d4b3fd382">round_i</a>(<a class="code" href="group__logexpfunc.html#ga0c42d158b1f623f9b72c1ccde7e2fd09">pow</a>(2.0, m));</div><div class="line"></div><div class="line"> cout << <span class="stringliteral">"Simulating an Reed-Solomon code with the following parameters:"</span> << endl;</div><div class="line"> cout << <span class="stringliteral">"n = "</span> << n << endl;</div><div class="line"> cout << <span class="stringliteral">"k = "</span> << k << endl;</div><div class="line"> cout << <span class="stringliteral">"q = "</span> << q << endl;</div><div class="line"></div><div class="line"> NumBits = m * k * NumCodeWords;</div><div class="line"> uncoded_bits = <a class="code" href="group__randgen.html#ga5aa06887cf1fd3301b040987924068f0">randb</a>(NumBits);</div><div class="line"> coded_bits = reed_solomon.encode(uncoded_bits);</div><div class="line"> received_bits = bsc(coded_bits);</div><div class="line"> decoded_bits = reed_solomon.decode(received_bits);</div><div class="line"></div><div class="line"> berc.<a class="code" href="classitpp_1_1BERC.html#a539b0c989badff3027d97e4693fc9cd7">count</a>(uncoded_bits, decoded_bits);</div><div class="line"> cout << <span class="stringliteral">"The bit error probability after decoding is "</span> << berc.<a class="code" href="classitpp_1_1BERC.html#a4c66254b338ac55bfce1008fff5ce6db">get_errorrate</a>() << endl;</div><div class="line"></div><div class="line"> <span class="comment">//Exit program:</span></div><div class="line"> <span class="keywordflow">return</span> 0;</div><div class="line"></div><div class="line">}</div></div><!-- fragment --><p>A typical run of this program can look like this:</p>
<div class="fragment"><div class="line">Number of Reed-Solomon code-words to simulate: 1000</div><div class="line">BSC Error probability : 0.01</div><div class="line">RS m: 3</div><div class="line">RS t: 2</div><div class="line">Simulating an Reed-Solomon code with the following parameters:</div><div class="line">n = 7</div><div class="line">k = 3</div><div class="line">q = 8</div><div class="line">The bit error probability after decoding is 0.000333333</div></div><!-- fragment --> </div></div><!-- contents -->
<div style="clear: both; width: 100%; height: 31px; background-color: #ffff00; border: 1px solid #b0b0b0; margin: 5px 5px 5px 0; padding: 2px;">
<p style="padding-left: 10px; font-size: 85%;">Generated on Sat Sep 30 2017 07:04:09 for IT++ by <a href="http://www.doxygen.org/index.html">Doxygen</a> 1.8.13</p>
</div>
</body>
</html>
|