# How to change PSK roll-off during runtime (or an arbitrary parameter)

**URL:** <https://www.ruby-forum.com/t/how-to-change-psk-roll-off-during-runtime-or-an-arbitrary-parameter/243042>\
**Category:** GNU Radio\
**Created:** [August 17, 2015, 4:39pm UTC](https://www.ruby-forum.com/t/how-to-change-psk-roll-off-during-runtime-or-an-arbitrary-parameter/243042 "2015-08-17T16:39:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [August 17, 2015, 4:39pm UTC](https://www.ruby-forum.com/t/how-to-change-psk-roll-off-during-runtime-or-an-arbitrary-parameter/243042/1 "2015-08-17T16:39:28Z")

</div>

Hi all!

Thank you for contributing to gnuradio and providing new users like me  
with help.

I have read and worked through some of the guided tutorials. However I  
come to a point now where it seems that own Python code has to be  
written. Unfortunately I am more like a C++ guy and would appreciate it  
if someone could give me some advice.

Let us please take a look at the QPSK transmitter example of tutorial 6  
[1]. It gives a nice example and you can play around with the parameters  
of the PSK Mod block in gnuradio-companion. What we would like to do is  
to change the roll-off factor during runtime using a Qt GUI Range  
element (i.e. a slider control) to demonstrate its effect. As the  
associated parameter is not underlined in the properties dialogue I  
wonder how this can be done during runtime.

When looking at the generated sourcecode it can be seen that an instance  
of `digital.psk.psk_mod` is created in ` __init__ ` method and stored in  
element `self.digital_psk_mod_0`. I tried to add code in the slider’s  
callback function `def set_excess_bw_slider(self, excess_bw_slider)`.  
But it does not show changes in constellation and spectrum plot though  
printing debug messages like `RRC roll-off factor: 0.15` on the command  
line.

I tried:

- to access the excess\_bw property of the digital.psk.psk\_mod directly  
to be modified
- to create a new instance of digital.psk.psk\_mod in the callback  
function and overwriting the original one  
(in C++ this would be bad practice probably leading to memory leaks  
and might be the same for Python)

I did not really find the documentation of the digital.psk.psk\_mod  
class, except at [2]. And in the sources themselves [3].

A short hint where to take a closer look would be great!

Thank you in advance  
Matthias

[1]  
[https://raw.githubusercontent.com/gnuradio/gr-tutorial/master/examples/tutorial6/gr-tutorial-qpsk-tx.grc](https://raw.githubusercontent.com/gnuradio/gr-tutorial/master/examples/tutorial6/gr-tutorial-qpsk-tx.grc)  
[2] [http://www.reynwar.net/gnuradio/sphinx/digital/blocks.html](http://www.reynwar.net/gnuradio/sphinx/digital/blocks.html)  
[3]  
[http://gnuradio.org/redmine/projects/gnuradio/repository/revisions/master/entry/gr-digital/python/digital/psk.py](http://gnuradio.org/redmine/projects/gnuradio/repository/revisions/master/entry/gr-digital/python/digital/psk.py)

---

<div class="post-metadata">

**Author:** ![mawi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/eb8c5e/32.png) [@mawi](https://www.ruby-forum.com/u/mawi)\
**Post date:** [August 17, 2015, 8:07pm UTC](https://www.ruby-forum.com/t/how-to-change-psk-roll-off-during-runtime-or-an-arbitrary-parameter/243042/2 "2015-08-17T20:07:27Z")

</div>

Matthias,

I can see how this would be a pretty cool demo. Off the top off my head,  
some thoughts:

- The RRC is implemented as a FIR in C++ (a pfb\_arb\_resampler\_ccf, to be  
precise). But this doesn’t have a method to update the taps 😕
- An update-able filter would be interesting, though. If you want to  
take a crack at it, people here would surely be interested.
- You’d need to consider how to handle history (what happens when you  
change the number of filter taps?). Not sure what the best way is here.

M

On 17.08.2015 07:38, Matthias W. wrote:

> Let us please take a look at the QPSK transmitter example of tutorial  
> the slider’s callback function `def set\_excess\_bw\_slider(self,  
> I did not really find the documentation of the digital.psk.psk\_mod

[2] [http://www.reynwar.net/gnuradio/sphinx/digital/blocks.html](http://www.reynwar.net/gnuradio/sphinx/digital/blocks.html)
