# Change bitrate dynamically in tunnel.py

**URL:** <https://www.ruby-forum.com/t/change-bitrate-dynamically-in-tunnel-py/215576>\
**Category:** GNU Radio\
**Created:** [January 9, 2012, 8:17am UTC](https://www.ruby-forum.com/t/change-bitrate-dynamically-in-tunnel-py/215576 "2012-01-09T08:17:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [January 9, 2012, 8:17am UTC](https://www.ruby-forum.com/t/change-bitrate-dynamically-in-tunnel-py/215576/1 "2012-01-09T08:17:44Z")

</div>

Hi all,

Now I use tunnel.py with USRP2.

I set bitrate when I run tunnel.py.  
I cannot change the bitrate until I finish tunnel.py.  
But, I want to change bitrate dynamically when I am running tunnel.py.

Does anyone know the ways to change bitrate dynamically?

regards,  
kouta

---

<div class="post-metadata">

**Author:** ![Kouta\_NISHIDA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/858c86/32.png) [@Kouta\_NISHIDA](https://www.ruby-forum.com/u/Kouta_NISHIDA)\
**Post date:** [January 10, 2012, 1:38am UTC](https://www.ruby-forum.com/t/change-bitrate-dynamically-in-tunnel-py/215576/2 "2012-01-10T01:38:55Z")

</div>

On Mon, Jan 9, 2012 at 2:24 AM, Kouta NISHIDA \<  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:

> regards,  
> kouta

Hi Kouta,  
It’s not set up to work that way right now, but you should be able to  
hack  
it to do what you want.

There are a couple of settings that affect the bitrate: the rate of the  
USRP and the number of samples per symbol (sps). In the current  
implementations of the PSK modulations, you can set a real number for  
the  
sps, so you should be able to change that to affect the bit rate. But  
remember, look for any place that is used since you’ll have to also  
reset  
the taps for the filters on both the RX and TX sides.

You can also set the sample rate of the USRP as well to affect this.

Let us know how you do with this.

Tom

---

<div class="post-metadata">

**Author:** ![Kouta\_NISHIDA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/858c86/32.png) [@Kouta\_NISHIDA](https://www.ruby-forum.com/u/Kouta_NISHIDA)\
**Post date:** [January 10, 2012, 9:39am UTC](https://www.ruby-forum.com/t/change-bitrate-dynamically-in-tunnel-py/215576/3 "2012-01-10T09:39:00Z")

</div>

Tom R. wrote:

> ```
> But, I want to change bitrate dynamically when I am running tunnel.py.
> 
> ```
> 
> hack it to do what you want.  
> Let us know how you do with this.
> 
> Tom

Thank you for your advice.

I will try setting the sample rate of the USRP to change bitrate  
dynamically.

I found the parameter that Actual Bitrate with pick\_bitrate.py  
Is the sample rate of the USRP Actual Bitrate ?

Would you tell me it if there are the file and parameter that I should  
pay attention to ?

regards,  
kouta

---

<div class="post-metadata">

**Author:** ![Kouta\_NISHIDA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/858c86/32.png) [@Kouta\_NISHIDA](https://www.ruby-forum.com/u/Kouta_NISHIDA)\
**Post date:** [January 15, 2012, 6:49pm UTC](https://www.ruby-forum.com/t/change-bitrate-dynamically-in-tunnel-py/215576/4 "2012-01-15T18:49:33Z")

</div>

On Tue, Jan 10, 2012 at 3:37 AM, Kouta NISHIDA \<  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:

> > 
> 
> dynamically.
> 
> I found the parameter that Actual Bitrate with pick\_bitrate.py  
> Is the sample rate of the USRP Actual Bitrate ?
> 
> Would you tell me it if there are the file and parameter that I should pay  
> attention to ?
> 
> regards,  
> kouta

Kouta,  
If you’re still using the pick\_bitrate.py file, it sounds like you are  
on  
an older release (pre 3.5). In that case, you might have more trouble  
changing the bitrate (at least arbitrarily). But if you are using that  
version, you use that script to set the interpolation or decimation  
rates  
of the USRP as well as the number of samples per symbol based on a  
desired  
rate. So using it, if you want to set a new bit rate, you will receive  
new  
values for both of these parameters.

Tom
