discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Python function processing block


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Python function processing block
Date: Mon, 2 Oct 2006 16:57:39 -0700
User-agent: Mutt/1.5.9i

On Mon, Oct 02, 2006 at 09:08:00AM -0700, Johnathan Corgan wrote:
> Marcus Leech wrote:
> 
> > There was discussion on the list a few months ago about adding the
> > ability to hook a python function
> >  into the processing chain.   I don't remember what the conclusion of
> > that discussion was.
> > 
> > I have a need to be able to hook a user-defined Python code snippet into
> > the processing chain, near the end
> >  where the sample rate is very low (1Hz).   Is this easily done, and if
> > so, how?
> 
> Take a look at gr.feval_xx class:
> 
> http://gnuradio.org/trac/browser/gnuradio/trunk/gnuradio-core/src/lib/general/gr_feval.h
> 
> It defines a function 'eval' that can be called either from C++ or from
> Python.  In Python you can subclass this and override the eval function
> with whatever you want.  When the function is called from C++, control
> flow passes to the Python interpreter to evaluate the function and return.
> 
> I haven't used it myself, but you can get a good feel for what is
> possible by looking at the QA code for the block at:
> 
> http://gnuradio.org/trac/browser/gnuradio/trunk/gnuradio-core/src/python/gnuradio/gr/qa_feval.py
> 
> Johnathan Corgan, AE6HO
> address@hidden

This is all good info.

You could build a few classes derived from gr_sync_block that would
use the same techniques.

Eric




reply via email to

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