[Top][All Lists]

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

Re: [Discuss-gnuradio] Comparison of filters in C++ vs Python

From: Jim Borynec
Subject: Re: [Discuss-gnuradio] Comparison of filters in C++ vs Python
Date: Fri, 15 Sep 2006 13:45:02 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915

Sorry, it could be my misunderstanding of Gnuradio.

As I understand it, the basic metaphor of Gnuradio is a graph with vertexes and 
Each vertex is a component (some of which are in C++, others in Python.
You connect the vertexes with edges defined in the whatever main python program.
and turn it "on".  Each vertex is essentially a state machine,
taking in inputs, doing computations and handing over outputs to the next 

My question relates to the performance of this architecture.

How much overhead is associated with the "machine" as opposed to the actual 

Let us take a look at simple filters as an example.
One filter will multiply an input stream to get a gain on the signal.
Another filter will add a constant to an input stream to translate it's 

We can string these two filters in a row to do a translate and amplify filter.

However, we might already have a single filter which already does a translate 
and amplify function.

So my question is, how much less efficient is stringing the two filters in a 
row compared with using the combined filter.

The larger motivation here is to understand the trade off between simply gluing 
existing filters together versus writing my own custom filter.

Also, what are the tradeoffs between python and C++.

Do these questions make sense?


Eric Blossom wrote:

On Fri, Sep 15, 2006 at 10:29:36AM -0600, Jim Borynec wrote:


Has anyone determined the basic overhead of a filter?
I can't help but feel that stringing two filters in a row
(e.g. one to add a value and the other to multiply something)
would be less efficient than a single filter which does both operations internally.

Does the overhead of a filter basically swamp the computation involved?

I understand the advantages of being able to quickly assemble a complicated filter from simpler filters.

Also, has anyone quantified the cost advantage to using C++ (as compared to Python).

Is a single Python filter (which does an add and a multiply internally) more
efficient than two C++ filters strung together?


Hi Jim,

I'm not sure that I'm following these questions.
The computationally expensive part of GNU Radio is coded in C++.
Python is used to glue it all together, but is generally out of the
performance critical path.


reply via email to

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