# Vectors for GNU Radio Python Blocks

**URL:** <https://www.ruby-forum.com/t/vectors-for-gnu-radio-python-blocks/233492>\
**Category:** GNU Radio\
**Created:** [December 17, 2014, 6:43pm UTC](https://www.ruby-forum.com/t/vectors-for-gnu-radio-python-blocks/233492 "2014-12-17T18:43:38Z")\
**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:** [December 17, 2014, 6:43pm UTC](https://www.ruby-forum.com/t/vectors-for-gnu-radio-python-blocks/233492/1 "2014-12-17T18:43:38Z")

</div>

Hi all,

How do I write the init section for a Python block with an complex input  
vector of length v\_len, so I need to adapt the following…

“def **init** (self, Nb, Ns, mapping, v\_len):  
gr.basic\_block. **init** (self,  
name=“Demodulator\_relay\_py\_cd”,  
in\_sig=[numpy.complex64],  
out\_sig=[numpy.int32,numpy.uint8])?”

Thanks!

David

* * *

NOTE: The information in this email and any attachments may be  
confidential and/or legally privileged. This message may be read, copied  
and used only by the intended recipient. If you are not the intended  
recipient, please destroy this message, delete any copies held on your  
system and notify the sender immediately.

Toshiba Research Europe Limited, registered in England and Wales  
(2519556). Registered Office 208 Cambridge Science Park, Milton Road,  
Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [December 17, 2014, 6:56pm UTC](https://www.ruby-forum.com/t/vectors-for-gnu-radio-python-blocks/233492/2 "2014-12-17T18:56:32Z")

</div>

Hi David,

in\_sig=[(numpy.complex64,v\_len)]

Greetings,  
Marcus

PS: Because people might find this post later on: A point where this is  
explained would be  
[http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided\_Tutorial\_GNU\_Radio\_in\_Python#323-Modifying-the-Python-Block-File](http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorial_GNU_Radio_in_Python#323-Modifying-the-Python-Block-File)
