# PSK.py script giving errors

**URL:** <https://www.ruby-forum.com/t/psk-py-script-giving-errors/234222>\
**Category:** GNU Radio\
**Created:** [February 17, 2015, 12:16pm UTC](https://www.ruby-forum.com/t/psk-py-script-giving-errors/234222 "2015-02-17T12:16:49Z")\
**Posts on this page:** 2\
**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:** [February 17, 2015, 12:16pm UTC](https://www.ruby-forum.com/t/psk-py-script-giving-errors/234222/1 "2015-02-17T12:16:49Z")

</div>

Hi All,

I am trying to make the following system.

Packet Generator ------\> BPSK Modulator --------\> Frequency Hopper  
---------------\> UHD Sink

I read that the generic block psk.py can be used as a BPSK modulator so  
for  
the 1st two blocks I use the class psk\_mod(generic\_mod), setting the  
constellations as 2. Also the input to this block is a byte stream. So  
the  
1st two blocks of my system are set.

For frequency hopper () I want to send every new BPSK modulated packet  
on a  
different frequency seperated at 5MHz starting from 2.40Ghz) as I use  
the  
frequency\_hopping.py module which uses stream\_tags for frequenncy  
tuning.  
and Finally connecting it to the usrp sink.

Final system looking like this psk\_mod (hier\_block2),  
hopper\_block(hier\_block2)

self.connect(psk\_mod, hopper\_block, self.sink)

However the PSK block gives the following errors.

1. Traceback (most recent call last):  
File “./psk\_fh.py”, line 301, in   
main()  
File “./psk\_fh.py”, line 294, in main  
top\_block = FlowGraph(args)  
File “./psk\_fh.py”, line 258, in **init**  
src = psk\_mod()  
File “./psk\_fh.py”, line 119, in **init**  
super(psk\_mod, self). **init** (constellation, differential, \*args,  
\*\*kwargs)  
TypeError: **init** () takes exactly 4 arguments (3 given)

Any help to resolve this or another approach to this system is  
appriciated.

- 

Vaibhav Kulkarni  
ETH Zurich

---

<div class="post-metadata">

**Author:** ![vaibhav\_kulkarni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5fc32e/32.png) [@vaibhav\_kulkarni](https://www.ruby-forum.com/u/vaibhav_kulkarni)\
**Post date:** [February 17, 2015, 10:07pm UTC](https://www.ruby-forum.com/t/psk-py-script-giving-errors/234222/2 "2015-02-17T22:07:32Z")

</div>

On Tue, Feb 17, 2015 at 6:15 AM, vaibhav kulkarni \<  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:

> 1st two blocks of my system are set.
> 
> ```
> super(psk_mod, self). __init__ (constellation, differential, *args,
> 
> ```
> 
> \*\*kwargs)  
> TypeError: **init** () takes exactly 4 arguments (3 given)
> 
> Any help to resolve this or another approach to this system is  
> appriciated.
> 
> - 
> 
> Vaibhav Kulkarni  
> ETH Zurich

This is probably related to a change in version for the psk\_mod class.  
Take  
a look at the psk.py file you have. The current version looks like:

```
 def __init__ (self, constellation_points=_def_constellation_points,
             mod_code=_def_mod_code,
             differential=_def_differential,
             *args, **kwargs):

```

So you need that mod\_code value set, as well. It’s described in the  
class  
documentation.

Tom
