<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.3"/> <title>GNU Radio 3.6.4.1 C++ API: gri_lfsr Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">GNU Radio 3.6.4.1 C++ API </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.3 --> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('classgri__lfsr.html','');}); </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="classgri__lfsr-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">gri_lfsr Class Reference<div class="ingroups"><a class="el" href="group__misc.html">Miscellaneous</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Fibonacci Linear Feedback Shift Register using specified polynomial maskGenerates a maximal length pseudo-random sequence of length 2^degree-1. <a href="classgri__lfsr.html#details">More...</a></p> <p><code>#include <<a class="el" href="gri__lfsr_8h_source.html">gri_lfsr.h</a>></code></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a9d75c0d9937724f0784ccbae11114950"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classgri__lfsr.html#a9d75c0d9937724f0784ccbae11114950">gri_lfsr</a> (<a class="el" href="stdint_8h.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> <a class="el" href="classgri__lfsr.html#ab11f525cf4205ac9e77ed3b23d353812">mask</a>, <a class="el" href="stdint_8h.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> seed, <a class="el" href="stdint_8h.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> reg_len)</td></tr> <tr class="separator:a9d75c0d9937724f0784ccbae11114950"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ab48a354944fe18d9d261be11aa558b0f"><td class="memItemLeft" align="right" valign="top">unsigned char </td><td class="memItemRight" valign="bottom"><a class="el" href="classgri__lfsr.html#ab48a354944fe18d9d261be11aa558b0f">next_bit</a> ()</td></tr> <tr class="separator:ab48a354944fe18d9d261be11aa558b0f"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:afd1989999dcc0306a1b73f5822d38357"><td class="memItemLeft" align="right" valign="top">unsigned char </td><td class="memItemRight" valign="bottom"><a class="el" href="classgri__lfsr.html#afd1989999dcc0306a1b73f5822d38357">next_bit_scramble</a> (unsigned char input)</td></tr> <tr class="separator:afd1989999dcc0306a1b73f5822d38357"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:af23672b2652cbfa71cd34d99b5b3edd2"><td class="memItemLeft" align="right" valign="top">unsigned char </td><td class="memItemRight" valign="bottom"><a class="el" href="classgri__lfsr.html#af23672b2652cbfa71cd34d99b5b3edd2">next_bit_descramble</a> (unsigned char input)</td></tr> <tr class="separator:af23672b2652cbfa71cd34d99b5b3edd2"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a7bddbd6bf10acb53c86239efbeef648e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="volk_8tmpl_8h.html#a8dc2b7da310a28e667530ba0e8ca4cc4">void</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classgri__lfsr.html#a7bddbd6bf10acb53c86239efbeef648e">reset</a> ()</td></tr> <tr class="separator:a7bddbd6bf10acb53c86239efbeef648e"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:af04de11f558b49d79265df6f32f343c1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="volk_8tmpl_8h.html#a8dc2b7da310a28e667530ba0e8ca4cc4">void</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classgri__lfsr.html#af04de11f558b49d79265df6f32f343c1">pre_shift</a> (int num)</td></tr> <tr class="separator:af04de11f558b49d79265df6f32f343c1"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ab11f525cf4205ac9e77ed3b23d353812"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classgri__lfsr.html#ab11f525cf4205ac9e77ed3b23d353812">mask</a> () const </td></tr> <tr class="separator:ab11f525cf4205ac9e77ed3b23d353812"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Fibonacci Linear Feedback Shift Register using specified polynomial mask</p> <p>Generates a maximal length pseudo-random sequence of length 2^degree-1. </p> <p>Constructor: gri_lfsr(int mask, int seed, int reg_len); </p> <pre class="fragment"> mask - polynomial coefficients representing the locations of feedback taps from a shift register which are xor'ed together to form the new high order bit. Some common masks might be: x^4 + x^3 + x^0 = 0x19 x^5 + x^3 + x^0 = 0x29 x^6 + x^5 + x^0 = 0x61 seed - the initialization vector placed into the register durring initialization. Low order bit corresponds to x^0 coefficient -- the first to be shifted as output. </pre><p>reg_len - specifies the length of the feedback shift register to be used. Durring each iteration, the register is rightshifted one and the new bit is placed in bit reg_len. reg_len should generally be at least order(mask) + 1</p> <p>see <a href="http://en.wikipedia.org/wiki/Linear_feedback_shift_register">http://en.wikipedia.org/wiki/Linear_feedback_shift_register</a> for more explanation.</p> <p><a class="el" href="classgri__lfsr.html#ab48a354944fe18d9d261be11aa558b0f">next_bit()</a> - Standard LFSR operation </p> <pre class="fragment">Perform one cycle of the LFSR. The output bit is taken from the shift register LSB. The shift register MSB is assigned from the modulo 2 sum of the masked shift register. </pre><p><a class="el" href="classgri__lfsr.html#afd1989999dcc0306a1b73f5822d38357">next_bit_scramble(unsigned char input)</a> - Scramble an input stream </p> <pre class="fragment">Perform one cycle of the LFSR. The output bit is taken from the shift register LSB. The shift register MSB is assigned from the modulo 2 sum of the masked shift register and the input LSB. </pre><p><a class="el" href="classgri__lfsr.html#af23672b2652cbfa71cd34d99b5b3edd2">next_bit_descramble(unsigned char input)</a> - Descramble an input stream </p> <pre class="fragment">Perform one cycle of the LFSR. The output bit is taken from the modulo 2 sum of the masked shift register and the input LSB. The shift register MSB is assigned from the LSB of the input. </pre><p>See <a href="http://en.wikipedia.org/wiki/Scrambler">http://en.wikipedia.org/wiki/Scrambler</a> for operation of these last two functions (see multiplicative scrambler.) </p> </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> <a class="anchor" id="a9d75c0d9937724f0784ccbae11114950"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">gri_lfsr::gri_lfsr </td> <td>(</td> <td class="paramtype"><a class="el" href="stdint_8h.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> </td> <td class="paramname"><em>mask</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="stdint_8h.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> </td> <td class="paramname"><em>seed</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="stdint_8h.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> </td> <td class="paramname"><em>reg_len</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="ab11f525cf4205ac9e77ed3b23d353812"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">int gri_lfsr::mask </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> </div> </div> <a class="anchor" id="ab48a354944fe18d9d261be11aa558b0f"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">unsigned char gri_lfsr::next_bit </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> </div> </div> <a class="anchor" id="af23672b2652cbfa71cd34d99b5b3edd2"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">unsigned char gri_lfsr::next_bit_descramble </td> <td>(</td> <td class="paramtype">unsigned char </td> <td class="paramname"><em>input</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> </div> </div> <a class="anchor" id="afd1989999dcc0306a1b73f5822d38357"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">unsigned char gri_lfsr::next_bit_scramble </td> <td>(</td> <td class="paramtype">unsigned char </td> <td class="paramname"><em>input</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> </div> </div> <a class="anchor" id="af04de11f558b49d79265df6f32f343c1"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="volk_8tmpl_8h.html#a8dc2b7da310a28e667530ba0e8ca4cc4">void</a> gri_lfsr::pre_shift </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"><em>num</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Rotate the register through x number of bits where we are just throwing away the results to get queued up correctly </p> </div> </div> <a class="anchor" id="a7bddbd6bf10acb53c86239efbeef648e"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="volk_8tmpl_8h.html#a8dc2b7da310a28e667530ba0e8ca4cc4">void</a> gri_lfsr::reset </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Reset shift register to initial seed value </p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="gri__lfsr_8h_source.html">gri_lfsr.h</a></li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="classgri__lfsr.html">gri_lfsr</a></li> <li class="footer">Generated on Fri Apr 19 2013 16:20:39 for GNU Radio 3.6.4.1 C++ API by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.3 </li> </ul> </div> </body> </html>