GNU Radio 3.7.1 C++ API
gr::blocks::peak_detector_sb Class Reference

Detect the peak of a signal. More...

#include <peak_detector_sb.h>

Inheritance diagram for gr::blocks::peak_detector_sb:

List of all members.

Public Types

typedef boost::shared_ptr
< peak_detector_sb
sptr

Public Member Functions

virtual void set_threshold_factor_rise (float thr)=0
 Set the threshold factor value for the rise time.
virtual void set_threshold_factor_fall (float thr)=0
 Set the threshold factor value for the fall time.
virtual void set_look_ahead (int look)=0
 Set the look-ahead factor.
virtual void set_alpha (int alpha)=0
 Set the running average alpha.
virtual float threshold_factor_rise ()=0
 Get the threshold factor value for the rise time.
virtual float threshold_factor_fall ()=0
 Get the threshold factor value for the fall time.
virtual int look_ahead ()=0
 Get the look-ahead factor value.
virtual float alpha ()=0
 Get the alpha value of the running average.

Static Public Member Functions

static sptr make (float threshold_factor_rise=0.25, float threshold_factor_fall=0.40, int look_ahead=10, float alpha=0.001)

Detailed Description

Detect the peak of a signal.

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


Member Typedef Documentation


Member Function Documentation

virtual float gr::blocks::peak_detector_sb::alpha ( ) [pure virtual]

Get the alpha value of the running average.

Returns:
alpha
virtual int gr::blocks::peak_detector_sb::look_ahead ( ) [pure virtual]

Get the look-ahead factor value.

Returns:
look-ahead factor
static sptr gr::blocks::peak_detector_sb::make ( float  threshold_factor_rise = 0.25,
float  threshold_factor_fall = 0.40,
int  look_ahead = 10,
float  alpha = 0.001 
) [static]

Make a peak detector block.

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
virtual void gr::blocks::peak_detector_sb::set_alpha ( int  alpha) [pure virtual]

Set the running average alpha.

Parameters:
alphanew alpha for running average
virtual void gr::blocks::peak_detector_sb::set_look_ahead ( int  look) [pure virtual]

Set the look-ahead factor.

Parameters:
looknew look-ahead factor
virtual void gr::blocks::peak_detector_sb::set_threshold_factor_fall ( float  thr) [pure virtual]

Set the threshold factor value for the fall time.

Parameters:
thrnew threshold factor
virtual void gr::blocks::peak_detector_sb::set_threshold_factor_rise ( float  thr) [pure virtual]

Set the threshold factor value for the rise time.

Parameters:
thrnew threshold factor
virtual float gr::blocks::peak_detector_sb::threshold_factor_fall ( ) [pure virtual]

Get the threshold factor value for the fall time.

Returns:
threshold factor
virtual float gr::blocks::peak_detector_sb::threshold_factor_rise ( ) [pure virtual]

Get the threshold factor value for the rise time.

Returns:
threshold factor

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