GNU Radio 3.5.1 C++ API
|
Detect the peak of a signalIf a peak is detected, this block outputs a 1, or it outputs 0's. A separate debug output may be connected, to view the internal EWMA described below. More...
#include <gr_peak_detector2_fb.h>
Public Member Functions | |
void | set_threshold_factor_rise (float thr) |
Set the threshold factor value for the rise 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. | |
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_detector2_fb_sptr | gr_make_peak_detector2_fb (float threshold_factor_rise, int look_ahead, float alpha) |
Detect the peak of a signal
If a peak is detected, this block outputs a 1, or it outputs 0's. A separate debug output may be connected, to view the internal EWMA described below.
threshold_factor_rise | The threshold factor determins when a peak is present. An EWMA average of the signal is calculated and when the value of the signal goes over threshold_factor_rise*average, we call the peak. |
look_ahead | The look-ahead value is used when the threshold is found to locate the peak within this range. |
alpha | The gain value of a single-pole moving average filter |
float gr_peak_detector2_fb::alpha | ( | ) | [inline] |
Get the alpha value of the running average.
int gr_peak_detector2_fb::look_ahead | ( | ) | [inline] |
Get the look-ahead factor value.
void gr_peak_detector2_fb::set_alpha | ( | int | alpha | ) | [inline] |
Set the running average alpha.
alpha | new alpha for running average |
void gr_peak_detector2_fb::set_look_ahead | ( | int | look | ) | [inline] |
Set the look-ahead factor.
look | new look-ahead factor |
void gr_peak_detector2_fb::set_threshold_factor_rise | ( | float | thr | ) | [inline] |
Set the threshold factor value for the rise time.
thr | new threshold factor |
float gr_peak_detector2_fb::threshold_factor_rise | ( | ) | [inline] |
Get the threshold factor value for the rise time.
int gr_peak_detector2_fb::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.
GR_CORE_API gr_peak_detector2_fb_sptr gr_make_peak_detector2_fb | ( | float | threshold_factor_rise, |
int | look_ahead, | ||
float | alpha | ||
) | [friend] |