# Help me help myself

**URL:** <https://www.ruby-forum.com/t/help-me-help-myself/233536>\
**Category:** GNU Radio\
**Created:** [December 23, 2014, 12:39am UTC](https://www.ruby-forum.com/t/help-me-help-myself/233536 "2014-12-23T00:39:10Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [December 23, 2014, 12:39am UTC](https://www.ruby-forum.com/t/help-me-help-myself/233536/1 "2014-12-23T00:39:10Z")

</div>

Hi all,

The goal of this email is to learn how to find answers using available  
resources on my own in the future. To do this, I will explain what I’ve  
done to try and find the answer and then I hope someone can tell me how  
to  
finish the process so that next time I can do it on my own.

I’m working through the details of the MM Timing Recovery block. In the  
process of doing this I’ve come across the following line in source:

d\_omega = d\_omega\_mid + gr::branchless\_clip(d\_omega-d\_omega\_mid,  
d\_omega\_lim);

I don’t know what gr::branchless\_clip does, so I started looking for  
answers on google and the gnuradio API manual. In the manual, I find  
this:

[http://gnuradio.org/doc/doxygen/namespacegr.html#ace35e8c3e3ad45a5100217d2b6826e1b](http://gnuradio.org/doc/doxygen/namespacegr.html#ace35e8c3e3ad45a5100217d2b6826e1b)

but that doesn’t tell me what it does. I can’t find anymore reference to  
branchless\_clip then this.

From the source code, I don’t know how to track down the reference. I’ve  
searched my laptop for branchless\_clip, but I get no returns.

So the question is, how do I find what branchless\_clip does in the MM  
Timing Recovery block? I care more about the “how do I find” part of the  
question then the actual answer, though I do want the actual answer.

Thanks,  
Rich

---

<div class="post-metadata">

**Author:** ![reback](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@reback](https://www.ruby-forum.com/u/reback)\
**Post date:** [December 23, 2014, 12:44am UTC](https://www.ruby-forum.com/t/help-me-help-myself/233536/2 "2014-12-23T00:44:07Z")

</div>

On 12/22/2014 06:37 PM, Richard B. wrote:

> d\_omega = d\_omega\_mid + gr::branchless\_clip(d\_omega-d\_omega\_mid,  
> From the source code, I don’t know how to track down the reference.  
> I’ve searched my laptop for branchless\_clip, but I get no returns.
> 
> So the question is, how do I find what branchless\_clip does in the MM  
> Timing Recovery block? I care more about the “how do I find” part of  
> the question then the actual answer, though I do want the actual answer.

I used the following “find” command:

find gnuradio -name “_._” -exec grep -H branchless\_clip ‘{}’ ‘;’

And found the definition in:

gnuradio/gnuradio-runtime/include/gnuradio/math.h:  
branchless\_clip(float x, float clip)

–  
Marcus L.  
Principal Investigator  
Shirleys Bay Radio Astronomy Consortium

> **[Live Draw HK Tercepat | Result HK | HK Pools | Live HK | HK Prize Hari Ini](https://www.sbrac.org/)**
>
> Temukan live draw hk tercepat melalui halaman hk pools yang resmi dan dapatkan result hk prize melalui live hk secara langsung di situs kami.

---

<div class="post-metadata">

**Author:** ![reback](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@reback](https://www.ruby-forum.com/u/reback)\
**Post date:** [December 23, 2014, 12:47am UTC](https://www.ruby-forum.com/t/help-me-help-myself/233536/3 "2014-12-23T00:47:12Z")

</div>

On 12/22/2014 06:42 PM, Marcus D. Leech wrote:

> > but that doesn’t tell me what it does. I can’t find anymore reference
> 
> find gnuradio -name “_._” -exec grep -H branchless\_clip ‘{}’ ‘;’
> 
> And found the definition in:
> 
> gnuradio/gnuradio-runtime/include/gnuradio/math.h:  
> branchless\_clip(float x, float clip)

I’m not as smart as Marcus, so I googled “branchless clip”,

[http://stackoverflow.com/questions/427477/fastest-way-to-clamp-a-real-fixed-floating-point-value](http://stackoverflow.com/questions/427477/fastest-way-to-clamp-a-real-fixed-floating-point-value)

Philip

---

<div class="post-metadata">

**Author:** ![reback](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@reback](https://www.ruby-forum.com/u/reback)\
**Post date:** [December 23, 2014, 12:49am UTC](https://www.ruby-forum.com/t/help-me-help-myself/233536/4 "2014-12-23T00:49:04Z")

</div>

On 12/22/2014 06:45 PM, Philip B. wrote:

> On 12/22/2014 06:42 PM, Marcus D. Leech wrote:
> 
> I’m not as smart as Marcus, so I googled “branchless clip”,

[http://stackoverflow.com/questions/427477/fastest-way-to-clamp-a-real-fixed-floating-point-value](http://stackoverflow.com/questions/427477/fastest-way-to-clamp-a-real-fixed-floating-point-value)

> Philip  
> I think that at the end of the day, questions like this boil down to  
> “how do I get comfortable with the tools of the trade in software  
> development”.

That’s not something that the Gnu Radio community can economically  
address.

–  
Marcus L.  
Principal Investigator  
Shirleys Bay Radio Astronomy Consortium

> **[Live Draw HK Tercepat | Result HK | HK Pools | Live HK | HK Prize Hari Ini](https://www.sbrac.org/)**
>
> Temukan live draw hk tercepat melalui halaman hk pools yang resmi dan dapatkan result hk prize melalui live hk secara langsung di situs kami.

---

<div class="post-metadata">

**Author:** ![reback](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@reback](https://www.ruby-forum.com/u/reback)\
**Post date:** [December 23, 2014, 1:21am UTC](https://www.ruby-forum.com/t/help-me-help-myself/233536/5 "2014-12-23T01:21:50Z")

</div>

Hi Richard,

actually, I kind of liked your question and the answers you’ve got 🙂  
As a community, it’s always kind of hard to know where people actually  
encounter obstacles, and you’re _exactly_ the kind of future user we’d  
like to address: Able and willing to solve one’s own problems, but not  
to shy to ask questions on how to do stuff. Also, you don’t seem to be a  
complete stranger to the concepts of GNU Radio, so yours is an  
interesting angle.

Being part of the GNU Radio development easily makes one blind to the  
problems “normal people” have when getting into GNU Radio. For example,  
we’ve created a set of new guided tutorials, which I now habitually link  
to [1], but they were written by people who “guess” what new users  
should know based on the questions that get asked. And the questions  
that actually get asked might be quite different from the questions new  
users actually have. So we asked people to give their feedback on that  
(please feel encouraged to do so, too!). This all illustrates what  
Marcus L. concluded in “something that the GR community can’t  
economically address”, and I sure hope you’ll feel motivated to find  
your very own way through Software (defined radio) Development!

Keep up the good questions,

Greetings,  
Marcus

[1] [http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided\_Tutorials](http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorials)

---

<div class="post-metadata">

**Author:** ![reback](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@reback](https://www.ruby-forum.com/u/reback)\
**Post date:** [December 23, 2014, 1:00am UTC](https://www.ruby-forum.com/t/help-me-help-myself/233536/6 "2014-12-23T01:00:49Z")

</div>

Actually, your replies helped. I was not aware or in the mindset that  
branchless\_clip was a generally used method for clamping fixed or  
floating  
point values. Because of that, I was limiting my searches to gnuradio  
related stuff (googling “gnuradio branchless\_clip”). Now I know it is a  
general method of doing something.

Helping people who are getting comfortable is a good thing to do. It  
will  
ensure they use the tools. There is a limit to this of course. No one  
wants  
to see basic level questions being asked all day.

---

<div class="post-metadata">

**Author:** ![reback](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@reback](https://www.ruby-forum.com/u/reback)\
**Post date:** [December 23, 2014, 1:32am UTC](https://www.ruby-forum.com/t/help-me-help-myself/233536/7 "2014-12-23T01:32:57Z")

</div>

MLeech I really understand where you’re coming from. But I think that’s  
the  
point of a community. If you are personally tired of answering low level  
questions, then you should not feel like you have to. Others in the  
community might be happy to do it, and you can stick to the advanced  
questions. Correct me if I’m wrong, but this is how other communities  
seem  
to work that I’ve been involved with.

MMuller, thank you. I do my best to help myself before I ask a question  
here. Often, I feel like I’m asking a legit question, until the  
responses  
make me feel like i just asked the equivalent of “what does 2+2 equal?”  
Its  
always hard until you ask. Shrug.

Rich

---

<div class="post-metadata">

**Author:** ![reback](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@reback](https://www.ruby-forum.com/u/reback)\
**Post date:** [December 23, 2014, 1:24am UTC](https://www.ruby-forum.com/t/help-me-help-myself/233536/8 "2014-12-23T01:24:18Z")

</div>

On 12/22/2014 06:59 PM, Richard B. wrote:

> Actually, your replies helped. I was not aware or in the mindset that  
> branchless\_clip was a generally used method for clamping fixed or  
> floating point values. Because of that, I was limiting my searches to  
> gnuradio related stuff (googling “gnuradio branchless\_clip”). Now I  
> know it is a general method of doing something.
> 
> Helping people who are getting comfortable is a good thing to do. It  
> will ensure they use the tools. There is a limit to this of course. No  
> one wants to see basic level questions being asked all day.  
> I’ve been on this mailing list for, gosh, a decade?

In that time, what I’ve noticed is that in the last couple of years,  
there’s a significant fraction of folks who are encountering not only  
Gnu Radio and  
SDR/DSP for the first time, but _software development in general_.  
I’m not sure why that is, but I’m pretty sure that the list isn’t, in  
general, well-equipped to deal with that kind of thing.

My own patience for that type of thing varies considerably, and I try to  
avoid giving any answers at all when my patience is perhaps not as  
generous as it should be, and try to give cheerful answers when  
possible.

I certainly don’t want people to leave with the impression that we’re  
unhelpful here, but on the other hand, I don’t think it would be good  
for  
the list (and the community) if we became a “free CS101 course” for  
the huddled masses. Just my opinion…

…funny anecdote time.

I once helped run an internal help-desk doing Unix technical support  
within the Nortel empire. We’d assembled a team of  
pretty-darned-competent people to do front-line support. _Vastly_  
better than your typical help-desk. Like, could debug shell scripts  
for customers while waiting on the phone. So, we got a bit of a  
reputation of being pretty-much the best at what we did. To the extent  
that our phone number leaked out into the greater world, and we  
started getting support calls from random not-Nortel places, which  
we obviously couldn’t support, since it wasn’t our mandate.

Sometimes, I think we do that here…

---

<div class="post-metadata">

**Author:** ![reback](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@reback](https://www.ruby-forum.com/u/reback)\
**Post date:** [December 23, 2014, 1:49am UTC](https://www.ruby-forum.com/t/help-me-help-myself/233536/9 "2014-12-23T01:49:02Z")

</div>

On 12/22/2014 07:31 PM, Richard B. wrote:

> does 2+2 equal?" Its always hard until you ask. Shrug.
> 
> Rich  
> Richard:

I certainly didn’t mean to imply that you’d asked a “stupid question”.  
There aren’t any stupid questions. Only stupid/ill-considered answers.

Your post just triggered one of my many soap-box moments. If I had a  
beard, it would be grey. Think of me as the grumpy old greybeard  
muttering incoherently over there in the corner…

–  
Marcus L.  
Principal Investigator  
Shirleys Bay Radio Astronomy Consortium

> **[Live Draw HK Tercepat | Result HK | HK Pools | Live HK | HK Prize Hari Ini](https://www.sbrac.org/)**
>
> Temukan live draw hk tercepat melalui halaman hk pools yang resmi dan dapatkan result hk prize melalui live hk secara langsung di situs kami.

---

<div class="post-metadata">

**Author:** ![reback](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@reback](https://www.ruby-forum.com/u/reback)\
**Post date:** [December 23, 2014, 7:35am UTC](https://www.ruby-forum.com/t/help-me-help-myself/233536/10 "2014-12-23T07:35:02Z")

</div>

Use cscope and/or ctags next time

---

<div class="post-metadata">

**Author:** ![reback](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@reback](https://www.ruby-forum.com/u/reback)\
**Post date:** [December 23, 2014, 8:27pm UTC](https://www.ruby-forum.com/t/help-me-help-myself/233536/11 "2014-12-23T20:27:10Z")

</div>

On 12/23/2014 12:42 AM, Marcus D. Leech wrote:

> I used the following “find” command:
> 
> find gnuradio -name “_._” -exec grep -H branchless\_clip ‘{}’ ‘;’

A nice tool for searching source trees is ‘ack’: [http://beyondgrep.com/](http://beyondgrep.com/)

It also has a vim plugin.

Cheers,  
M

---

<div class="post-metadata">

**Author:** ![reback](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@reback](https://www.ruby-forum.com/u/reback)\
**Post date:** [December 23, 2014, 8:31pm UTC](https://www.ruby-forum.com/t/help-me-help-myself/233536/12 "2014-12-23T20:31:30Z")

</div>

On 12/23/2014 12:59 AM, Richard B. wrote:

> Actually, your replies helped. I was not aware or in the mindset that  
> branchless\_clip was a generally used method for clamping fixed or  
> floating point values. Because of that, I was limiting my searches to  
> gnuradio related stuff (googling “gnuradio branchless\_clip”). Now I know  
> it is a general method of doing something.
> 
> Helping people who are getting comfortable is a good thing to do. It  
> will ensure they use the tools. There is a limit to this of course. No  
> one wants to see basic level questions being asked all day.

Hey Richard,

you’re in a very interesting spot where you’re learning all these  
things. This is a great time to write stuff down, amend the wiki etc. It  
would be a help to other people getting started if you added to the  
docs.

And welcome to the community,  
M

---

<div class="post-metadata">

**Author:** ![reback](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@reback](https://www.ruby-forum.com/u/reback)\
**Post date:** [December 24, 2014, 5:23am UTC](https://www.ruby-forum.com/t/help-me-help-myself/233536/13 "2014-12-24T05:23:51Z")

</div>

On Mon, Dec 22, 2014 at 6:59 PM, Richard B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Actually, your replies helped. I was not aware or in the mindset that  
> branchless\_clip was a generally used method for clamping fixed or floating  
> point values. Because of that, I was limiting my searches to gnuradio  
> related stuff (googling “gnuradio branchless\_clip”). Now I know it is a  
> general method of doing something.
> 
> Helping people who are getting comfortable is a good thing to do. It will  
> ensure they use the tools. There is a limit to this of course. No one wants  
> to see basic level questions being asked all day.

Another thing you can always do is create a simple test project to call  
a  
function or block that you don’t understand and see what outputs  
different  
kinds of inputs produce. It can be a pain to do this kind of thing,  
especially with a C++ project where the basic setup is more complicated  
than a simple Python script, but it’s good education anyways.

Also, to re-up Marin’s comment, when you’ve run into these situations  
where  
the documentation on something like this is lacking, please feel free to  
submit patches with better docs to help explain it to others.

Tom
