# Give sample rate to throttle block dynamically

**URL:** <https://www.ruby-forum.com/t/give-sample-rate-to-throttle-block-dynamically/237449>\
**Category:** GNU Radio\
**Created:** [November 13, 2013, 4:43pm UTC](https://www.ruby-forum.com/t/give-sample-rate-to-throttle-block-dynamically/237449 "2013-11-13T16:43:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [November 13, 2013, 4:43pm UTC](https://www.ruby-forum.com/t/give-sample-rate-to-throttle-block-dynamically/237449/1 "2013-11-13T16:43:58Z")

</div>

Hi,  
I am parsing the sample rate from a file name and would like to  
dynamically pass that to a downstream block (for instance the throttle  
block). I tried using a function proble to get the sample rate value and  
having the throttle getthe sample rate from it. It seems like the  
throttle is only getting the initial value from the function probe  
though and not updating. Please let me know if I’m on the right track,  
or if there is a better way to pass the sample rate to other blocks.  
Thanks!

---

<div class="post-metadata">

**Author:** ![Jenny\_Galasso](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/779978/32.png) [@Jenny\_Galasso](https://www.ruby-forum.com/u/Jenny_Galasso)\
**Post date:** [November 13, 2013, 8:00pm UTC](https://www.ruby-forum.com/t/give-sample-rate-to-throttle-block-dynamically/237449/2 "2013-11-13T20:00:52Z")

</div>

On Wed, Nov 13, 2013 at 07:42:35AM -0800, Jenny Galasso wrote:

> I am parsing the sample rate from a file name and would like to dynamically  
> pass that to a downstream block (for instance the throttle block). I tried  
> using a function proble to get the sample rate value and having the throttle  
> get the sample rate from it. It seems like the throttle is only getting the  
> initial value from the function probe though and not updating. Please let me  
> know if I’m on the right track, or if there is a better way to pass the sample  
> rate to other blocks.

Hi Jenny,

the throttle block is really only used to run offline flowgraphs and  
make sure  
they don’t swamp the CPU. Do you have any other clocks in your  
flowgraph, or is this the only one?

If you’re reading the sample rate from a file name, my suggestion is to  
figure that out before you start the FG, and set it while initializing.

If you want to change sampling rates dynamically, this calls for stream  
tags. However, there’s no block in stock GNU Radio that reads sampling  
rates from stream tags.

MB

–  
Karlsruhe Institute of Technology (KIT)  
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin B.  
Research Associate

Kaiserstraße 12  
Building 05.01  
76131 Karlsruhe

Phone: +49 721 608-43790  
Fax: +49 721 608-46071  
www.cel.kit.edu

KIT – University of the State of Baden-Württemberg and  
National Laboratory of the Helmholtz Association

---

<div class="post-metadata">

**Author:** ![Jenny\_Galasso](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/779978/32.png) [@Jenny\_Galasso](https://www.ruby-forum.com/u/Jenny_Galasso)\
**Post date:** [November 14, 2013, 2:29pm UTC](https://www.ruby-forum.com/t/give-sample-rate-to-throttle-block-dynamically/237449/3 "2013-11-14T14:29:45Z")

</div>

Hi Jenny,

please stick to the mailing list.

On Wed, Nov 13, 2013 at 12:07:19PM -0800, Jenny Galasso wrote:

> Thanks for your response, Martin- It’s very helpful. I still have some  
> confusion about the function probe though. Briefly, how do I query it’s value  
> from another block?

I’m not sure what you mean. You can write the variable name from the  
function probe into any field that has a callback.

MB

–  
Karlsruhe Institute of Technology (KIT)  
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin B.  
Research Associate

Kaiserstraße 12  
Building 05.01  
76131 Karlsruhe

Phone: +49 721 608-43790  
Fax: +49 721 608-46071  
www.cel.kit.edu

KIT – University of the State of Baden-Württemberg and  
National Laboratory of the Helmholtz Association
