discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] making gnuradio blocks entirely in python


From: Josh Blum
Subject: [Discuss-gnuradio] making gnuradio blocks entirely in python
Date: Sun, 25 Sep 2011 19:58:54 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13

So there is a useful feature I think gnuradio is missing, and thats the
ability to rapidly prototype signal processing in python. It would be
great if a python block would have access to all the facilities
available to a block written in a c++ environment.

So I put together pyblock (not to be confused with those other project
by the same name). Its a stand-alone build that links against gnuradio.
https://github.com/guruofquality/pyblock

Theres a few demos: an adder, using tags, interp and decim blocks.
https://github.com/guruofquality/pyblock/tree/master/examples

The interesting thing is that the work functions just call into numpy
routines, so there is a chance that the implementations can be
reasonably fast.

I would like to be able to support history so i can implement a filter
using numpy but I am a little lacking in the basic understanding so fill
me in if you know. Suppose I have this work function:

int work(int noutput_items, gr_vector_const_void_star
&input_items,gr_vector_void_star &output_items){
const float *in = reinterpret_cast<const float *>(input_items[0]);

I am assuming history is on the input buffer.
Is the vector "in" ninput_items + history() items long? Where
ninput_items = noutput_items*/some_factor.
Whats the first index of the first item? Is in[0] or in[0-history()]?

-Josh



reply via email to

[Prev in Thread] Current Thread [Next in Thread]