[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/06: blocks: fixed problem with setting p
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/06: blocks: fixed problem with setting peak detector's alpha value. |
Date: |
Wed, 8 Apr 2015 23:27:16 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 86759e94bb1cc7d3ff071e398e972ec1a6ceed70
Author: Tom Rondeau <address@hidden>
Date: Wed Apr 8 12:20:08 2015 -0400
blocks: fixed problem with setting peak detector's alpha value.
This changes the public interface from an int to a float. But the
alpha must be between 0 and 1 for it to make any sense, so if this is
being used, it's never producing the right answer. Also, it's likely
that this change will be transparent to anyone who is trying to set
it.
---
gr-blocks/include/gnuradio/blocks/peak_detector2_fb.h | 2 +-
gr-blocks/lib/peak_detector2_fb_impl.cc | 8 ++------
gr-blocks/lib/peak_detector2_fb_impl.h | 2 +-
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/gr-blocks/include/gnuradio/blocks/peak_detector2_fb.h
b/gr-blocks/include/gnuradio/blocks/peak_detector2_fb.h
index 7336a46..da2d9fc 100644
--- a/gr-blocks/include/gnuradio/blocks/peak_detector2_fb.h
+++ b/gr-blocks/include/gnuradio/blocks/peak_detector2_fb.h
@@ -71,7 +71,7 @@ namespace gr {
/*! \brief Set the running average alpha
* \param alpha new alpha for running average
*/
- virtual void set_alpha(int alpha) = 0;
+ virtual void set_alpha(float alpha) = 0;
/*! \brief Get the threshold factor value for the rise time
* \return threshold factor
diff --git a/gr-blocks/lib/peak_detector2_fb_impl.cc
b/gr-blocks/lib/peak_detector2_fb_impl.cc
index dd1b677..7ff7f54 100644
--- a/gr-blocks/lib/peak_detector2_fb_impl.cc
+++ b/gr-blocks/lib/peak_detector2_fb_impl.cc
@@ -43,8 +43,8 @@ namespace gr {
peak_detector2_fb_impl::peak_detector2_fb_impl(float threshold_factor_rise,
int look_ahead, float alpha)
: sync_block("peak_detector2_fb",
- io_signature::make(1, 1, sizeof(float)),
- io_signature::make2(1, 2, sizeof(char), sizeof(float))),
+ io_signature::make(1, 1, sizeof(float)),
+ io_signature::make2(1, 2, sizeof(char), sizeof(float))),
d_threshold_factor_rise(threshold_factor_rise),
d_look_ahead(look_ahead), d_alpha(alpha), d_avg(0.0f), d_found(false)
{
@@ -62,8 +62,6 @@ namespace gr {
float *iptr = (float *)input_items[0];
char *optr = (char *)output_items[0];
- assert(noutput_items >= 2);
-
memset(optr, 0, noutput_items*sizeof(char));
for(int i = 0; i < noutput_items; i++) {
@@ -114,5 +112,3 @@ namespace gr {
} /* namespace blocks */
} /* namespace gr */
-
-
diff --git a/gr-blocks/lib/peak_detector2_fb_impl.h
b/gr-blocks/lib/peak_detector2_fb_impl.h
index 53c06ca..f5a8ac1 100644
--- a/gr-blocks/lib/peak_detector2_fb_impl.h
+++ b/gr-blocks/lib/peak_detector2_fb_impl.h
@@ -47,7 +47,7 @@ namespace gr {
void set_threshold_factor_rise(float thr) { d_threshold_factor_rise =
thr; }
void set_look_ahead(int look) { d_look_ahead = look; }
- void set_alpha(int alpha) { d_alpha = alpha; }
+ void set_alpha(float alpha) { d_alpha = alpha; }
float threshold_factor_rise() { return d_threshold_factor_rise; }
int look_ahead() { return d_look_ahead; }
- [Commit-gnuradio] [gnuradio] branch master updated (d8ffe56 -> e2815ab), git, 2015/04/08
- [Commit-gnuradio] [gnuradio] 06/06: Merge remote-tracking branch 'sdh11/qt-range', git, 2015/04/08
- [Commit-gnuradio] [gnuradio] 02/06: qtgui: Slight modification to the precision of the counter in the qt range., git, 2015/04/08
- [Commit-gnuradio] [gnuradio] 04/06: qtgui: Fixed issue where clicking on the range widget jumped to the wrong location, git, 2015/04/08
- [Commit-gnuradio] [gnuradio] 01/06: blocks: fixed problem with setting peak detector's alpha value.,
git <=
- [Commit-gnuradio] [gnuradio] 05/06: Merge remote-tracking branch 'tom/blocks/peak_detector2_alpha', git, 2015/04/08
- [Commit-gnuradio] [gnuradio] 03/06: qtgui: Refactored range widget. Enabled slider focus, fixed issue where slider event caused counter to round, and fixed whitespace to match PEP8., git, 2015/04/08