<!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"/> <title>GNU Radio 3.3.0 C++ API: gr_peak_detector_ib Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.3 --> <div class="contents"> <h1>gr_peak_detector_ib Class Reference<br/> <small> [<a class="el" href="group__level__blk.html">Signal Level Control (AGC)</a>]</small> </h1><!-- doxytag: class="gr_peak_detector_ib" --><!-- doxytag: inherits="gr_sync_block" --> <p>Detect the peak of a signalIf a peak is detected, this block outputs a 1, or it outputs 0's. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="gr__peak__detector__ib_8h_source.html">gr_peak_detector_ib.h</a>></code></p> <div class="dynheader"> Inheritance diagram for gr_peak_detector_ib:</div> <div class="dynsection"> <div class="center"><img src="classgr__peak__detector__ib__inherit__graph.png" border="0" usemap="#gr__peak__detector__ib_inherit__map" alt="Inheritance graph"/></div> <map name="gr__peak__detector__ib_inherit__map" id="gr__peak__detector__ib_inherit__map"> <area shape="rect" id="node2" href="classgr__sync__block.html" title="synchronous 1:1 input to output with historyOverride work to provide the signal processing..." alt="" coords="21,315,128,344"/><area shape="rect" id="node4" href="classgr__block.html" title="The abstract base class for all 'terminal' processing blocks.A signal processing..." alt="" coords="40,237,109,267"/><area shape="rect" id="node6" href="classgr__basic__block.html" title="The abstract base class for all signal processing blocks.Basic blocks are the bare..." alt="" coords="20,160,129,189"/><area shape="rect" id="node8" href="classgr__msg__accepter.html" title="Accepts messages and inserts them into a message queue, then notifies subclass gr_basic_block..." alt="" coords="13,83,136,112"/><area shape="rect" id="node10" href="classgruel_1_1msg__accepter.html" title="Virtual base class that accepts messages." alt="" coords="5,5,144,35"/></map> <center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div> <p><a href="classgr__peak__detector__ib-members.html">List of all members.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__peak__detector__ib.html#ac726371694c6d8b9e77fc3e92ecb3d77">set_threshold_factor_rise</a> (float thr)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the threshold factor value for the rise time. <a href="#ac726371694c6d8b9e77fc3e92ecb3d77"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__peak__detector__ib.html#a4ef44ee51e8a0ed9129b7870aabfd574">set_threshold_factor_fall</a> (float thr)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the threshold factor value for the fall time. <a href="#a4ef44ee51e8a0ed9129b7870aabfd574"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__peak__detector__ib.html#a80cf9f8c4d639e3ec9882e84a8ebda02">set_look_ahead</a> (int look)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the look-ahead factor. <a href="#a80cf9f8c4d639e3ec9882e84a8ebda02"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__peak__detector__ib.html#af9ad814ac46e88c40512ecf132bb819c">set_alpha</a> (int alpha)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the running average alpha. <a href="#af9ad814ac46e88c40512ecf132bb819c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__peak__detector__ib.html#a16cccafdfe9de755a679e851c41e2c7c">threshold_factor_rise</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the threshold factor value for the rise time. <a href="#a16cccafdfe9de755a679e851c41e2c7c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__peak__detector__ib.html#a8ed69f2548b5325a39b9b731c3b8bee2">threshold_factor_fall</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the threshold factor value for the fall time. <a href="#a8ed69f2548b5325a39b9b731c3b8bee2"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__peak__detector__ib.html#ad13fcd580c7e78039110ddd225651066">look_ahead</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the look-ahead factor value. <a href="#ad13fcd580c7e78039110ddd225651066"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__peak__detector__ib.html#a47b1a8139b256051bd333ee42d1a445d">alpha</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the alpha value of the running average. <a href="#a47b1a8139b256051bd333ee42d1a445d"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__peak__detector__ib.html#ad6e0eed7edf68ace59b559c442e9cd07">work</a> (int noutput_items, <a class="el" href="classstd_1_1vector.html">gr_vector_const_void_star</a> &input_items, <a class="el" href="classstd_1_1vector.html">gr_vector_void_star</a> &output_items)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">just like <a class="el" href="classgr__block.html#a137b93d87dc83bbdb6369d33f4ea8197" title="compute output items from input items">gr_block::general_work</a>, only this arranges to call consume_each for you <a href="#ad6e0eed7edf68ace59b559c442e9cd07"></a><br/></td></tr> <tr><td colspan="2"><h2>Friends</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classboost_1_1shared__ptr.html">gr_peak_detector_ib_sptr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__peak__detector__ib.html#a22adb1eb6863a3402df3c7250ff162c5">gr_make_peak_detector_ib</a> (float threshold_factor_rise, float threshold_factor_fall, int look_ahead, float alpha)</td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>Detect the peak of a signal</p> <p>If a peak is detected, this block outputs a 1, or it outputs 0's. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>threshold_factor_rise</em> </td><td>The threshold factor determins when a peak has started. An average of the signal is calculated and when the value of the signal goes over threshold_factor_rise*average, we start looking for a peak. </td></tr> <tr><td valign="top"></td><td valign="top"><em>threshold_factor_fall</em> </td><td>The threshold factor determins when a peak has ended. An average of the signal is calculated and when the value of the signal goes bellow threshold_factor_fall*average, we stop looking for a peak. </td></tr> <tr><td valign="top"></td><td valign="top"><em>look_ahead</em> </td><td>The look-ahead value is used when the threshold is found to look if there another peak within this step range. If there is a larger value, we set that as the peak and look ahead again. This is continued until the highest point is found with This look-ahead range. </td></tr> <tr><td valign="top"></td><td valign="top"><em>alpha</em> </td><td>The gain value of a moving average filter </td></tr> </table> </dd> </dl> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a47b1a8139b256051bd333ee42d1a445d"></a><!-- doxytag: member="gr_peak_detector_ib::alpha" ref="a47b1a8139b256051bd333ee42d1a445d" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">float gr_peak_detector_ib::alpha </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Get the alpha value of the running average. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>alpha </dd></dl> </div> </div> <a class="anchor" id="ad13fcd580c7e78039110ddd225651066"></a><!-- doxytag: member="gr_peak_detector_ib::look_ahead" ref="ad13fcd580c7e78039110ddd225651066" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int gr_peak_detector_ib::look_ahead </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Get the look-ahead factor value. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>look-ahead factor </dd></dl> </div> </div> <a class="anchor" id="af9ad814ac46e88c40512ecf132bb819c"></a><!-- doxytag: member="gr_peak_detector_ib::set_alpha" ref="af9ad814ac46e88c40512ecf132bb819c" args="(int alpha)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void gr_peak_detector_ib::set_alpha </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>alpha</em></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Set the running average alpha. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>alpha</em> </td><td>new alpha for running average </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a80cf9f8c4d639e3ec9882e84a8ebda02"></a><!-- doxytag: member="gr_peak_detector_ib::set_look_ahead" ref="a80cf9f8c4d639e3ec9882e84a8ebda02" args="(int look)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void gr_peak_detector_ib::set_look_ahead </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>look</em></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Set the look-ahead factor. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>look</em> </td><td>new look-ahead factor </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a4ef44ee51e8a0ed9129b7870aabfd574"></a><!-- doxytag: member="gr_peak_detector_ib::set_threshold_factor_fall" ref="a4ef44ee51e8a0ed9129b7870aabfd574" args="(float thr)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void gr_peak_detector_ib::set_threshold_factor_fall </td> <td>(</td> <td class="paramtype">float </td> <td class="paramname"> <em>thr</em></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Set the threshold factor value for the fall time. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>thr</em> </td><td>new threshold factor </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="ac726371694c6d8b9e77fc3e92ecb3d77"></a><!-- doxytag: member="gr_peak_detector_ib::set_threshold_factor_rise" ref="ac726371694c6d8b9e77fc3e92ecb3d77" args="(float thr)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void gr_peak_detector_ib::set_threshold_factor_rise </td> <td>(</td> <td class="paramtype">float </td> <td class="paramname"> <em>thr</em></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Set the threshold factor value for the rise time. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>thr</em> </td><td>new threshold factor </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a8ed69f2548b5325a39b9b731c3b8bee2"></a><!-- doxytag: member="gr_peak_detector_ib::threshold_factor_fall" ref="a8ed69f2548b5325a39b9b731c3b8bee2" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">float gr_peak_detector_ib::threshold_factor_fall </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Get the threshold factor value for the fall time. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>threshold factor </dd></dl> </div> </div> <a class="anchor" id="a16cccafdfe9de755a679e851c41e2c7c"></a><!-- doxytag: member="gr_peak_detector_ib::threshold_factor_rise" ref="a16cccafdfe9de755a679e851c41e2c7c" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">float gr_peak_detector_ib::threshold_factor_rise </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Get the threshold factor value for the rise time. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>threshold factor </dd></dl> </div> </div> <a class="anchor" id="ad6e0eed7edf68ace59b559c442e9cd07"></a><!-- doxytag: member="gr_peak_detector_ib::work" ref="ad6e0eed7edf68ace59b559c442e9cd07" args="(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int gr_peak_detector_ib::work </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>noutput_items</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classstd_1_1vector.html">gr_vector_const_void_star</a> & </td> <td class="paramname"> <em>input_items</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classstd_1_1vector.html">gr_vector_void_star</a> & </td> <td class="paramname"> <em>output_items</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>just like <a class="el" href="classgr__block.html#a137b93d87dc83bbdb6369d33f4ea8197" title="compute output items from input items">gr_block::general_work</a>, only this arranges to call consume_each for you </p> <p>The user must override work to define the signal processing code </p> <p>Implements <a class="el" href="classgr__sync__block.html#a0c523f4285a6eb690f677ee6295ab117">gr_sync_block</a>.</p> </div> </div> <hr/><h2>Friends And Related Function Documentation</h2> <a class="anchor" id="a22adb1eb6863a3402df3c7250ff162c5"></a><!-- doxytag: member="gr_peak_detector_ib::gr_make_peak_detector_ib" ref="a22adb1eb6863a3402df3c7250ff162c5" args="(float threshold_factor_rise, float threshold_factor_fall, int look_ahead, float alpha)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classboost_1_1shared__ptr.html">gr_peak_detector_ib_sptr</a> gr_make_peak_detector_ib </td> <td>(</td> <td class="paramtype">float </td> <td class="paramname"> <em>threshold_factor_rise</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float </td> <td class="paramname"> <em>threshold_factor_fall</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>look_ahead</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float </td> <td class="paramname"> <em>alpha</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [friend]</code></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="gr__peak__detector__ib_8h_source.html">gr_peak_detector_ib.h</a></li> </ul> </div> <hr class="footer"/><address style="text-align: right;"><small>Generated on Wed Dec 29 19:52:52 2010 for GNU Radio 3.3.0 C++ API by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address> </body> </html>