GNU Radio 3.5.3.2 C++ API
gr_peak_detector_ib Class Reference

Detect the peak of a signalIf a peak is detected, this block outputs a 1, or it outputs 0's. More...

#include <gr_peak_detector_ib.h>

Inheritance diagram for gr_peak_detector_ib:

List of all members.

Public Member Functions

void set_threshold_factor_rise (float thr)
 Set the threshold factor value for the rise time.
void set_threshold_factor_fall (float thr)
 Set the threshold factor value for the fall time.
void set_look_ahead (int look)
 Set the look-ahead factor.
void set_alpha (int alpha)
 Set the running average alpha.
float threshold_factor_rise ()
 Get the threshold factor value for the rise time.
float threshold_factor_fall ()
 Get the threshold factor value for the fall time.
int look_ahead ()
 Get the look-ahead factor value.
float alpha ()
 Get the alpha value of the running average.
int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
 just like gr_block::general_work, only this arranges to call consume_each for you

Friends

GR_CORE_API
gr_peak_detector_ib_sptr 
gr_make_peak_detector_ib (float threshold_factor_rise, float threshold_factor_fall, int look_ahead, float alpha)

Detailed Description

Detect the peak of a signal

If a peak is detected, this block outputs a 1, or it outputs 0's.

Parameters:
threshold_factor_riseThe 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.
threshold_factor_fallThe 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.
look_aheadThe 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.
alphaThe gain value of a moving average filter

Member Function Documentation

float gr_peak_detector_ib::alpha ( ) [inline]

Get the alpha value of the running average.

Returns:
alpha
int gr_peak_detector_ib::look_ahead ( ) [inline]

Get the look-ahead factor value.

Returns:
look-ahead factor
void gr_peak_detector_ib::set_alpha ( int  alpha) [inline]

Set the running average alpha.

Parameters:
alphanew alpha for running average
void gr_peak_detector_ib::set_look_ahead ( int  look) [inline]

Set the look-ahead factor.

Parameters:
looknew look-ahead factor
void gr_peak_detector_ib::set_threshold_factor_fall ( float  thr) [inline]

Set the threshold factor value for the fall time.

Parameters:
thrnew threshold factor
void gr_peak_detector_ib::set_threshold_factor_rise ( float  thr) [inline]

Set the threshold factor value for the rise time.

Parameters:
thrnew threshold factor
float gr_peak_detector_ib::threshold_factor_fall ( ) [inline]

Get the threshold factor value for the fall time.

Returns:
threshold factor
float gr_peak_detector_ib::threshold_factor_rise ( ) [inline]

Get the threshold factor value for the rise time.

Returns:
threshold factor
int gr_peak_detector_ib::work ( int  noutput_items,
gr_vector_const_void_star input_items,
gr_vector_void_star output_items 
) [virtual]

just like gr_block::general_work, only this arranges to call consume_each for you

The user must override work to define the signal processing code

Implements gr_sync_block.


Friends And Related Function Documentation

GR_CORE_API gr_peak_detector_ib_sptr gr_make_peak_detector_ib ( float  threshold_factor_rise,
float  threshold_factor_fall,
int  look_ahead,
float  alpha 
) [friend]

The documentation for this class was generated from the following file: